History

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().

Jakub Kicinski committed 4 years ago

Commit c33fdfb1 parent 5a3ba991 file · +1 −0Browse files

Unified · Split

drivers/char/ipmi/ipmi_msghandler.c+1−0
@@ -5033,6 +5033,7 @@ struct ipmi_smi_msg *ipmi_alloc_smi_msg(void) · 5032 unmodified lines
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;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t