Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ipmi: ssif_bmc: prevent integer overflow on 32bit systems
[ Upstream commit 0627cef ] There are actually two bugs here. First, we need to ensure that count is at least sizeof(u32) or msg.len will be uninitialized data. The "msg.len" variable is a u32 that comes from the user. On 32bit systems the "sizeof_field(struct ipmi_ssif_msg, len) + msg.len" addition can overflow if "msg.len" is greater than U32_MAX - 4. Valid lengths for "msg.len" are 1-254. Add a check for that to prevent the integer overflow. Fixes: dd2bc5c ("ipmi: ssif_bmc: Add SSIF BMC driver") Signed-off-by: Dan Carpenter <[email protected]> Message-Id: <[email protected]> Signed-off-by: Corey Minyard <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
- Loading branch information