linux/drivers/char/ipmi
Guenter Roeck 04610b7780 ipmi: Fix handling of messages with provided receive message pointer
commit e2c69490dd upstream

Prior to commit b52da4054e ("ipmi: Rework user message limit handling"),
i_ipmi_request() used to increase the user reference counter if the receive
message is provided by the caller of IPMI API functions. This is no longer
the case. However, ipmi_free_recv_msg() is still called and decreases the
reference counter. This results in the reference counter reaching zero,
the user data pointer is released, and all kinds of interesting crashes are
seen.

Fix the problem by increasing user reference counter if the receive message
has been provided by the caller.

Fixes: b52da4054e ("ipmi: Rework user message limit handling")
Reported-by: Eric Dumazet <edumazet@google.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Greg Thelen <gthelen@google.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Message-ID: <20251006201857.3433837-1-linux@roeck-us.net>
Signed-off-by: Corey Minyard <corey@minyard.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2025-10-19 16:34:04 +02:00
..
bt-bmc.c ipmi: bt-bmc: Convert to platform remove callback returning void 2024-04-17 14:55:04 -05:00
ipmb_dev_int.c ipmi: ipmb: Add check devm_kasprintf() returned value 2025-02-08 09:57:01 +01:00
ipmi_bt_sm.c ipmi: Clean up some printks 2020-09-15 09:57:45 -05:00
ipmi_devintf.c ipmi: make ipmi_class a static const structure 2023-06-20 09:49:08 -05:00
ipmi_dmi.c ipmi_si: Rework some include files 2019-08-02 07:25:03 -05:00
ipmi_dmi.h ipmi_si: Rework some include files 2019-08-02 07:25:03 -05:00
ipmi_ipmb.c ipmi: Drop explicit initialization of struct i2c_device_id::driver_data to 0 2024-07-08 15:05:18 -05:00
ipmi_kcs_sm.c Revert "ipmi: fix msg stack when IPMI is disconnected" 2025-10-19 16:33:52 +02:00
ipmi_msghandler.c ipmi: Fix handling of messages with provided receive message pointer 2025-10-19 16:34:04 +02:00
ipmi_plat_data.c ipmi: Handle device properties with software node API 2021-03-10 19:00:02 -06:00
ipmi_plat_data.h ipmi: Add the i2c-addr property for SSIF interfaces 2019-04-24 09:02:53 -05:00
ipmi_powernv.c ipmi: ipmi_powernv: Convert to platform remove callback returning void 2024-04-17 14:55:04 -05:00
ipmi_poweroff.c char-misc: Remove the now superfluous sentinel element from ctl_table array 2023-10-11 12:16:13 -07:00
ipmi_si.h parisc: Make struct parisc_driver::remove() return void 2021-08-30 10:18:25 +02:00
ipmi_si_hardcode.c ipmi: Use regspacings passed as a module parameter 2023-12-19 06:32:27 -06:00
ipmi_si_hotmod.c ipmi_si: Join string literals back 2021-04-02 12:53:42 -05:00
ipmi_si_intf.c char: ipmi: handle HAS_IOPORT dependencies 2024-04-17 14:55:04 -05:00
ipmi_si_mem_io.c ipmi_si: Rework some include files 2019-08-02 07:25:03 -05:00
ipmi_si_parisc.c parisc: Make struct parisc_driver::remove() return void 2021-08-30 10:18:25 +02:00
ipmi_si_pci.c char: ipmi: handle HAS_IOPORT dependencies 2024-04-17 14:55:04 -05:00
ipmi_si_platform.c ipmi: ipmi_si_platform: Convert to platform remove callback returning void 2024-04-17 14:55:04 -05:00
ipmi_si_port_io.c ipmi_si: Rework some include files 2019-08-02 07:25:03 -05:00
ipmi_si_sm.h ipmi_si: Rework some include files 2019-08-02 07:25:03 -05:00
ipmi_smic_sm.c ipmi: Clean up some printks 2020-09-15 09:57:45 -05:00
ipmi_ssif.c Some minor fixes and cleanups for IPMI. Nothing big. 2024-09-19 09:33:44 +02:00
ipmi_watchdog.c ipmi: Fix strcpy source and destination the same 2025-08-20 18:30:48 +02:00
Kconfig ipmi: ASPEED_BT_IPMI_BMC: select REGMAP_MMIO instead of depending on it 2023-03-02 16:14:15 -06:00
kcs_bmc.c ipmi: fix potential deadlock on &kcs_bmc->lock 2023-07-04 09:22:45 -05:00
kcs_bmc.h ipmi: kcs_bmc: Allow clients to control KCS IRQ state 2021-06-21 19:50:28 -05:00
kcs_bmc_aspeed.c ipmi: kcs_bmc_aspeed: Convert to platform remove callback returning void 2024-04-17 14:55:04 -05:00
kcs_bmc_cdev_ipmi.c ipmi: Add __init/__exit annotations to module init/exit funcs 2022-09-22 10:55:46 -05:00
kcs_bmc_client.h ipmi: kcs_bmc: Allow clients to control KCS IRQ state 2021-06-21 19:50:28 -05:00
kcs_bmc_device.h ipmi: kcs_bmc: Allow clients to control KCS IRQ state 2021-06-21 19:50:28 -05:00
kcs_bmc_npcm7xx.c ipmi: kcs_bmc_npcm7xx: Convert to platform remove callback returning void 2024-04-17 14:55:04 -05:00
kcs_bmc_serio.c ipmi: Add __init/__exit annotations to module init/exit funcs 2022-09-22 10:55:46 -05:00
Makefile char: ipmi: handle HAS_IOPORT dependencies 2024-04-17 14:55:04 -05:00
ssif_bmc.c ipmi: ssif_bmc: Fix new request loss when bmc ready for a response 2025-02-08 09:57:10 +01:00