ipmi: si: Fix NULL pointer dereference after failed registration
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 2512e40e48d21d8bac09f7e91d2c3ceb2d3b50b2 · < 53af3a8bae0a93c1342e1b5519812203332aca8e| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ipmi: si: Fix NULL pointer dereference after failed registration
try_smi_init() allocates new_smi->si_sm and later calls ipmi_register_smi_mod(), which maps to ipmi_add_smi().
During ipmi_add_smi(), the upper IPMI message handler obtains the initial BMC device information through __bmc_get_device_id(). This can fail if the BMC does not return a successful response to the Get Device ID command.
When the BMC returns a nonzero completion code, the device-id helper retries the command and eventually returns -EIO if the device ID still cannot be fetched.
On this failure path, ipmi_add_smi() logs "Unable to get the device id" and goes to out_err_started, where it invokes the lower driver's shutdown callback. try_smi_init() then logs the returned registration failure:
ipmi_si IPI0001:00: IPMI message handler: Unable to get the device id: -5 ipmi_si IPI0001:00: Unable to register device: error -5
For ipmi_si, the shutdown callback is shutdown_smi(), which cleans up the SI state machine data, frees smi_info->si_sm, and sets smi_info->si_sm and smi_info->intf to NULL.
From the CVE record · Linux
The Linux kernel IPMI SI driver can dereference a NULL pointer after BMC device-ID retrieval fails during registration and asynchronous retry work runs after cleanup. This can cause a kernel crash. The input does not identify an attacker access path or any authentication or user-interaction requirements.
Engineers running Linux systems that use the kernel IPMI SI driver should check their kernel versions against the vendor advisory; affected versions are not specified.