Skip to content
Snippets Groups Projects
Commit ca542764 authored by Sarannya S's avatar Sarannya S Committed by Gerrit - the friendly Code Review server
Browse files

net: ipc_router: Add bounds check on tx path


Add bounds check on values read from shared memory in the tx path.
In cases where the VM is misbehaving, the ipcrtr fifo xport should
exit and print a warning when bogus values may cause out of bounds to
be read.

Change-Id: I2d219b36a4d7ddb137f232f47f4fe2e662add98d
Signed-off-by: default avatarSarannya S <quic_sarannya@quicinc.com>
parent ce99fe71
No related branches found
No related tags found
No related merge requests found
......@@ -129,6 +129,9 @@ static size_t fifo_tx_avail(struct msm_ipc_pipe *pipe)
else
avail = tail - head;
if (WARN_ON_ONCE(avail > pipe->length))
avail = 0;
return avail;
}
......@@ -139,6 +142,8 @@ static void fifo_tx_write(struct msm_ipc_pipe *pipe,
u32 head;
head = le32_to_cpu(*pipe->head);
if (WARN_ON_ONCE(head > pipe->length))
return;
len = min_t(size_t, count, pipe->length - head);
if (len)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment