diff options
author | Jakub Kicinski <kuba@kernel.org> | 2021-11-24 22:03:23 +0100 |
---|---|---|
committer | Corey Minyard <cminyard@mvista.com> | 2021-11-25 15:21:13 +0100 |
commit | c33fdfbabb6c930454df017f3cd3507dc1a87d09 (patch) | |
tree | 42323dab0427115a55c21f0d0b418672841cd802 /drivers/char/ipmi | |
parent | ipmi: msghandler: Make symbol 'remove_work_wq' static (diff) | |
download | linux-c33fdfbabb6c930454df017f3cd3507dc1a87d09.tar.xz linux-c33fdfbabb6c930454df017f3cd3507dc1a87d09.zip |
ipmi: fix oob access due to uninit smi_msg type
We're hitting OOB accesses in handle_ipmb_direct_rcv_rsp() (memcpy of
size -1) after user space generates a message. Looks like the message
is incorrectly assumed to be of the new IPMB type, because type is never
set and message is allocated with kmalloc() not kzalloc().
Fixes: 059747c245f0 ("ipmi: Add support for IPMB direct messages")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Message-Id: <20211124210323.1950976-1-kuba@kernel.org>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'drivers/char/ipmi')
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index a2ec0171363a..7d7df17d8b3d 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c @@ -5033,6 +5033,7 @@ struct ipmi_smi_msg *ipmi_alloc_smi_msg(void) if (rv) { rv->done = free_smi_msg; rv->user_data = NULL; + rv->type = IPMI_SMI_MSG_TYPE_NORMAL; atomic_inc(&smi_msg_inuse_count); } return rv; |