Skip to content

Commit

Permalink
ipm: cavs: Fix possible buffer overflow
Browse files Browse the repository at this point in the history
A buffer overflow happens in send() when size is negative because
it is promoted to signed when used in memcpy.

Signed-off-by: Flavio Ceolin <[email protected]>
(cherry picked from commit eeea26d)
  • Loading branch information
Flavio Ceolin authored and github-actions[bot] committed Sep 27, 2023
1 parent 0c3cb4b commit 29abb3c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/ipm/ipm_cavs_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static int send(const struct device *dev, int wait, uint32_t id,
return -EBUSY;
}

if (size > MAX_MSG) {
if ((size < 0) || (size > MAX_MSG)) {
return -EMSGSIZE;
}

Expand Down

0 comments on commit 29abb3c

Please sign in to comment.