]> git.baikalelectronics.ru Git - kernel.git/commit
ipmi: fix oob access due to uninit smi_msg type
authorJakub Kicinski <kuba@kernel.org>
Wed, 24 Nov 2021 21:03:23 +0000 (13:03 -0800)
committerCorey Minyard <cminyard@mvista.com>
Thu, 25 Nov 2021 14:21:13 +0000 (08:21 -0600)
commitd019e39ff738baa2820ad5544150edcd579a3589
tree42323dab0427115a55c21f0d0b418672841cd802
parent1312f36874cf4a803404d4f89f688b5ab256c173
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: cbb891cfd0ad ("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>
drivers/char/ipmi/ipmi_msghandler.c