Skip to content

Commit c33fdfb

Browse files
kuba-moocminyard
authored andcommitted
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: 059747c ("ipmi: Add support for IPMB direct messages") Signed-off-by: Jakub Kicinski <[email protected]> Message-Id: <[email protected]> Signed-off-by: Corey Minyard <[email protected]>
1 parent 5a3ba99 commit c33fdfb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/char/ipmi/ipmi_msghandler.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5033,6 +5033,7 @@ struct ipmi_smi_msg *ipmi_alloc_smi_msg(void)
50335033
if (rv) {
50345034
rv->done = free_smi_msg;
50355035
rv->user_data = NULL;
5036+
rv->type = IPMI_SMI_MSG_TYPE_NORMAL;
50365037
atomic_inc(&smi_msg_inuse_count);
50375038
}
50385039
return rv;

0 commit comments

Comments
 (0)