]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ipmi: Check event message buffer response for bad data
authorCorey Minyard <corey@minyard.net>
Mon, 20 Apr 2026 17:50:09 +0000 (12:50 -0500)
committerCorey Minyard <corey@minyard.net>
Tue, 21 Apr 2026 12:29:04 +0000 (07:29 -0500)
The event message buffer response data size got checked later when
processing, but check it right after the response comes back.  It
appears some BMCs may return an empty message instead of an error
when fetching events.

There are apparently some new BMCs that make this error, so we need to
compensate.

Reported-by: Matt Fleming <mfleming@cloudflare.com>
Closes: https://lore.kernel.org/lkml/20260415115930.3428942-1-matt@readmodwrite.com/
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Cc: <stable@vger.kernel.org>
Signed-off-by: Corey Minyard <corey@minyard.net>
drivers/char/ipmi/ipmi_si_intf.c

index 4a9e9de4d684f9f8be1492342a102ee4b711be8b..08c208cc64c56be609649191898c8fa3c0a51d12 100644 (file)
@@ -630,7 +630,13 @@ static void handle_transaction_done(struct smi_info *smi_info)
                 */
                msg = smi_info->curr_msg;
                smi_info->curr_msg = NULL;
-               if (msg->rsp[2] != 0) {
+               /*
+                * It appears some BMCs, with no event data, return no
+                * data in the message and not a 0x80 error as the
+                * spec says they should.  Shut down processing if
+                * the data is not the right length.
+                */
+               if (msg->rsp[2] != 0 || msg->rsp_size != 19) {
                        /* Error getting event, probably done. */
                        msg->done(msg);