<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/char/ipmi, branch master</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>ipmi: Fix use-after-free of cmd_rcvr in _ipmi_destroy_user()</title>
<updated>2026-08-25T23:55:02+00:00</updated>
<author>
<name>Yifei Gao</name>
<email>gyf161023@gmail.com</email>
</author>
<published>2026-08-25T23:46:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=05ec76cfbce653e07cec19b9b8b20e33449d5d87'/>
<id>05ec76cfbce653e07cec19b9b8b20e33449d5d87</id>
<content type='text'>
Commit 9e91f8a6c868 ("ipmi:msghandler: Remove srcu for the
ipmi_interfaces list") dropped the synchronize_rcu() between unlinking
the command receivers from intf-&gt;cmd_rcvrs and freeing them, updating
only the comment that explains why the barrier is needed.

The cmd_rcvrs list is still traversed under plain RCU: find_cmd_rcvr()
walks it inside rcu_read_lock(), and handle_ipmb_get_msg_cmd() borrows
rcvr-&gt;user from that lookup within the same read-side section. Without
the grace period, _ipmi_destroy_user() can kfree() a cmd_rcvr while a
reader still holds a pointer to it, causing a use-after-free.

The rework only made srcu unnecessary for the interfaces list; the
cmd_rcvrs list still relies on plain RCU. Restore the synchronize_rcu()
before freeing the receivers.

Fixes: 9e91f8a6c868 ("ipmi:msghandler: Remove srcu for the ipmi_interfaces list")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Yifei Gao &lt;gyf161023@gmail.com&gt;
Message-ID: &lt;20260825234630.1196170-1-gyf161023@gmail.com&gt;
Signed-off-by: Corey Minyard &lt;corey@minyard.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 9e91f8a6c868 ("ipmi:msghandler: Remove srcu for the
ipmi_interfaces list") dropped the synchronize_rcu() between unlinking
the command receivers from intf-&gt;cmd_rcvrs and freeing them, updating
only the comment that explains why the barrier is needed.

The cmd_rcvrs list is still traversed under plain RCU: find_cmd_rcvr()
walks it inside rcu_read_lock(), and handle_ipmb_get_msg_cmd() borrows
rcvr-&gt;user from that lookup within the same read-side section. Without
the grace period, _ipmi_destroy_user() can kfree() a cmd_rcvr while a
reader still holds a pointer to it, causing a use-after-free.

The rework only made srcu unnecessary for the interfaces list; the
cmd_rcvrs list still relies on plain RCU. Restore the synchronize_rcu()
before freeing the receivers.

Fixes: 9e91f8a6c868 ("ipmi:msghandler: Remove srcu for the ipmi_interfaces list")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-opus-4-8
Signed-off-by: Yifei Gao &lt;gyf161023@gmail.com&gt;
Message-ID: &lt;20260825234630.1196170-1-gyf161023@gmail.com&gt;
Signed-off-by: Corey Minyard &lt;corey@minyard.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipmi:msghandler: Cancel work cleanly on an error</title>
<updated>2026-08-19T11:25:45+00:00</updated>
<author>
<name>Corey Minyard</name>
<email>corey@minyard.net</email>
</author>
<published>2026-08-18T17:49:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ae84a2536577057e97f23f75a202e26d0e86cf01'/>
<id>ae84a2536577057e97f23f75a202e26d0e86cf01</id>
<content type='text'>
If an error occurs during startup of an IPMI interface, it may have
scheduled work to run.  The work needs to be canceled before the
interface can be freed.

Reported-by: Nilay Shroff &lt;nilay@linux.ibm.com&gt;
Closes: https://sourceforge.net/p/openipmi/mailman/message/59375605/
Fixes: 62cd145453d5 ("ipmi:msghandler: Handle error returns from the SMI sender")
Cc: stable@vger.kernel.org # 7.0
Tested-by: Nilay Shroff &lt;nilay@linux.ibm.com&gt;
Signed-off-by: Corey Minyard &lt;corey@minyard.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If an error occurs during startup of an IPMI interface, it may have
scheduled work to run.  The work needs to be canceled before the
interface can be freed.

Reported-by: Nilay Shroff &lt;nilay@linux.ibm.com&gt;
Closes: https://sourceforge.net/p/openipmi/mailman/message/59375605/
Fixes: 62cd145453d5 ("ipmi:msghandler: Handle error returns from the SMI sender")
Cc: stable@vger.kernel.org # 7.0
Tested-by: Nilay Shroff &lt;nilay@linux.ibm.com&gt;
Signed-off-by: Corey Minyard &lt;corey@minyard.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipmi:si: Add async init to ipmi_si</title>
<updated>2026-08-18T17:54:52+00:00</updated>
<author>
<name>Michal Clapinski</name>
<email>mclapinski@google.com</email>
</author>
<published>2026-08-10T07:48:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=ed98f8e27a93dae225a99ac41ad48f967fd19842'/>
<id>ed98f8e27a93dae225a99ac41ad48f967fd19842</id>
<content type='text'>
Added a new config option to allow offloading individual calls to
try_smi_init() using workqueue.

Saves 100ms on my system.

Signed-off-by: Michal Clapinski &lt;mclapinski@google.com&gt;
Message-ID: &lt;20260810074851.306979-1-mclapinski@google.com&gt;
Signed-off-by: Corey Minyard &lt;corey@minyard.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Added a new config option to allow offloading individual calls to
try_smi_init() using workqueue.

Saves 100ms on my system.

Signed-off-by: Michal Clapinski &lt;mclapinski@google.com&gt;
Message-ID: &lt;20260810074851.306979-1-mclapinski@google.com&gt;
Signed-off-by: Corey Minyard &lt;corey@minyard.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>char: ipmi: use named initializers for acpi_device_id</title>
<updated>2026-08-12T21:16:43+00:00</updated>
<author>
<name>Pawel Zalewski (The Capable Hub)</name>
<email>pzalewski@thegoodpenguin.co.uk</email>
</author>
<published>2026-08-07T11:26:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=eee1ea58c81ecb4d05c7267c05da73544386f3d9'/>
<id>eee1ea58c81ecb4d05c7267c05da73544386f3d9</id>
<content type='text'>
Use a named initializer for the acpi_device_id fields which
makes the code more readable and consistent with how lists
are initialized in the rest of the kernel code base. Also
drop explicitly setting fields to 0 where it is redundant.

While we are at it - unify the list terminator to have
a single space between the brackets and no trailing
comma.

Signed-off-by: Pawel Zalewski (The Capable Hub) &lt;pzalewski@thegoodpenguin.co.uk&gt;
Message-ID: &lt;20260807-acpi-char-v1-3-742c450254dd@thegoodpenguin.co.uk&gt;
Signed-off-by: Corey Minyard &lt;corey@minyard.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use a named initializer for the acpi_device_id fields which
makes the code more readable and consistent with how lists
are initialized in the rest of the kernel code base. Also
drop explicitly setting fields to 0 where it is redundant.

While we are at it - unify the list terminator to have
a single space between the brackets and no trailing
comma.

Signed-off-by: Pawel Zalewski (The Capable Hub) &lt;pzalewski@thegoodpenguin.co.uk&gt;
Message-ID: &lt;20260807-acpi-char-v1-3-742c450254dd@thegoodpenguin.co.uk&gt;
Signed-off-by: Corey Minyard &lt;corey@minyard.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipmi: Fix leak in __ipmi_bmc_register</title>
<updated>2026-08-12T21:16:42+00:00</updated>
<author>
<name>Michail Tatas</name>
<email>michail.tatas@gmail.com</email>
</author>
<published>2026-08-06T22:30:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=18e633dd9674c8bf118ea8583bb5a531edc2728a'/>
<id>18e633dd9674c8bf118ea8583bb5a531edc2728a</id>
<content type='text'>
In case that ida_alloc(&amp;ipmi_bmc_ida,...) succeeds and then
platform_device_register() fails, ipmi_bmc_ida is leaked.
Fix by freeing the error path

Signed-off-by: Michail Tatas &lt;michail.tatas@gmail.com&gt;
Message-ID: &lt;anUK_HOy_pCgvsBm@michalis-linux&gt;
Signed-off-by: Corey Minyard &lt;corey@minyard.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In case that ida_alloc(&amp;ipmi_bmc_ida,...) succeeds and then
platform_device_register() fails, ipmi_bmc_ida is leaked.
Fix by freeing the error path

Signed-off-by: Michail Tatas &lt;michail.tatas@gmail.com&gt;
Message-ID: &lt;anUK_HOy_pCgvsBm@michalis-linux&gt;
Signed-off-by: Corey Minyard &lt;corey@minyard.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipmi: Remove all sysfs files on registration failure</title>
<updated>2026-08-12T21:16:42+00:00</updated>
<author>
<name>Yuho Choi</name>
<email>dbgh9129@gmail.com</email>
</author>
<published>2026-08-03T01:55:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b6c46ab0bdee90c238e96ea4a74972118c97900d'/>
<id>b6c46ab0bdee90c238e96ea4a74972118c97900d</id>
<content type='text'>
ipmi_add_smi() creates the nr_users and nr_msgs files before trying to
create the maintenance_mode file. If that last creation fails, the error
path removes only nr_users before dropping the final reference to the
interface.

Remove nr_msgs as well so no sysfs attribute embedded in the freed
interface remains registered.

Fixes: 627118470fcc ("ipmi: Add a maintenance mode sysfs file")
Cc: stable@vger.kernel.org # 6.18
Signed-off-by: Yuho Choi &lt;dbgh9129@gmail.com&gt;
Message-ID: &lt;20260803015550.618808-1-dbgh9129@gmail.com&gt;
Signed-off-by: Corey Minyard &lt;corey@minyard.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ipmi_add_smi() creates the nr_users and nr_msgs files before trying to
create the maintenance_mode file. If that last creation fails, the error
path removes only nr_users before dropping the final reference to the
interface.

Remove nr_msgs as well so no sysfs attribute embedded in the freed
interface remains registered.

Fixes: 627118470fcc ("ipmi: Add a maintenance mode sysfs file")
Cc: stable@vger.kernel.org # 6.18
Signed-off-by: Yuho Choi &lt;dbgh9129@gmail.com&gt;
Message-ID: &lt;20260803015550.618808-1-dbgh9129@gmail.com&gt;
Signed-off-by: Corey Minyard &lt;corey@minyard.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipmi: si: Fix NULL pointer dereference after failed registration</title>
<updated>2026-07-02T11:46:53+00:00</updated>
<author>
<name>Seiji Nishikawa</name>
<email>snishika@redhat.com</email>
</author>
<published>2026-06-30T17:43:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6d920a75df9a83ab096b3cde7a643b656e4fdfeb'/>
<id>6d920a75df9a83ab096b3cde7a643b656e4fdfeb</id>
<content type='text'>
try_smi_init() allocates new_smi-&gt;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-&gt;si_sm, and sets
smi_info-&gt;si_sm and smi_info-&gt;intf to NULL.

However, intf-&gt;in_shutdown is not set on this failed-registration
rollback path. Therefore, the asynchronous redo_bmc_reg work item can
still retry BMC device-id probing after the lower driver has already
cleared its SI state machine data. In the observed case, that retry path
reached start_next_msg(), which passed the NULL smi_info-&gt;si_sm pointer
to the selected KCS state machine handler:

BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
Workqueue: events redo_bmc_reg [ipmi_msghandler]
RIP: start_kcs_transaction+0x2c/0x190 [ipmi_si]
Call Trace:
 start_next_msg+0x50/0x80 [ipmi_si]
 check_start_timer_thread.part.9+0x3b/0x50 [ipmi_si]
 sender+0x69/0x80 [ipmi_si]
 i_ipmi_request+0x2ac/0x9d0 [ipmi_msghandler]
 __get_device_id.isra.29+0xaa/0x180 [ipmi_msghandler]
 __bmc_get_device_id+0xef/0x950 [ipmi_msghandler]
 redo_bmc_reg+0x52/0x60 [ipmi_msghandler]
 process_one_work+0x1a7/0x360

Set intf-&gt;in_shutdown on the out_err_started path before invoking the
lower driver's shutdown callback. This prevents later redo_bmc_reg
retries from using an interface whose lower driver state has been
cleaned up, and applies the same shutdown state to other IPMI interfaces
as well.

Fixes: 2512e40e48d2 ("ipmi: Rework SMI registration failure")
Cc: stable@vger.kernel.org
Signed-off-by: Seiji Nishikawa &lt;snishika@redhat.com&gt;
Message-ID: &lt;20260630174348.1483814-1-snishika@redhat.com&gt;
Signed-off-by: Corey Minyard &lt;corey@minyard.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
try_smi_init() allocates new_smi-&gt;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-&gt;si_sm, and sets
smi_info-&gt;si_sm and smi_info-&gt;intf to NULL.

However, intf-&gt;in_shutdown is not set on this failed-registration
rollback path. Therefore, the asynchronous redo_bmc_reg work item can
still retry BMC device-id probing after the lower driver has already
cleared its SI state machine data. In the observed case, that retry path
reached start_next_msg(), which passed the NULL smi_info-&gt;si_sm pointer
to the selected KCS state machine handler:

BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
Workqueue: events redo_bmc_reg [ipmi_msghandler]
RIP: start_kcs_transaction+0x2c/0x190 [ipmi_si]
Call Trace:
 start_next_msg+0x50/0x80 [ipmi_si]
 check_start_timer_thread.part.9+0x3b/0x50 [ipmi_si]
 sender+0x69/0x80 [ipmi_si]
 i_ipmi_request+0x2ac/0x9d0 [ipmi_msghandler]
 __get_device_id.isra.29+0xaa/0x180 [ipmi_msghandler]
 __bmc_get_device_id+0xef/0x950 [ipmi_msghandler]
 redo_bmc_reg+0x52/0x60 [ipmi_msghandler]
 process_one_work+0x1a7/0x360

Set intf-&gt;in_shutdown on the out_err_started path before invoking the
lower driver's shutdown callback. This prevents later redo_bmc_reg
retries from using an interface whose lower driver state has been
cleaned up, and applies the same shutdown state to other IPMI interfaces
as well.

Fixes: 2512e40e48d2 ("ipmi: Rework SMI registration failure")
Cc: stable@vger.kernel.org
Signed-off-by: Seiji Nishikawa &lt;snishika@redhat.com&gt;
Message-ID: &lt;20260630174348.1483814-1-snishika@redhat.com&gt;
Signed-off-by: Corey Minyard &lt;corey@minyard.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipmi: ipmb: validate write message length</title>
<updated>2026-07-02T11:46:25+00:00</updated>
<author>
<name>Yousef Alhouseen</name>
<email>alhouseenyousef@gmail.com</email>
</author>
<published>2026-06-24T17:53:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=53637506884dbd5c91a89b1a3547d99d80f8ed2c'/>
<id>53637506884dbd5c91a89b1a3547d99d80f8ed2c</id>
<content type='text'>
ipmb_write() read message fields before validating the length byte.

A zero or short write can read uninitialized stack bytes.

A length smaller than the SMBus header underflows the block write length.

Require a non-empty buffer and the minimum IPMB request length.

Also require the length byte plus payload before parsing the message.

Fixes: 51bd6f291583 ("Add support for IPMB driver")
Cc: stable@vger.kernel.org
Signed-off-by: Yousef Alhouseen &lt;alhouseenyousef@gmail.com&gt;
Message-ID: &lt;20260624175353.8592-1-alhouseenyousef@gmail.com&gt;
Signed-off-by: Corey Minyard &lt;corey@minyard.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ipmb_write() read message fields before validating the length byte.

A zero or short write can read uninitialized stack bytes.

A length smaller than the SMBus header underflows the block write length.

Require a non-empty buffer and the minimum IPMB request length.

Also require the length byte plus payload before parsing the message.

Fixes: 51bd6f291583 ("Add support for IPMB driver")
Cc: stable@vger.kernel.org
Signed-off-by: Yousef Alhouseen &lt;alhouseenyousef@gmail.com&gt;
Message-ID: &lt;20260624175353.8592-1-alhouseenyousef@gmail.com&gt;
Signed-off-by: Corey Minyard &lt;corey@minyard.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipmi: Drop unused assignment of platform_device_id driver data</title>
<updated>2026-06-16T19:26:36+00:00</updated>
<author>
<name>Uwe Kleine-König (The Capable Hub)</name>
<email>u.kleine-koenig@baylibre.com</email>
</author>
<published>2026-06-16T14:29:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=9961c88b1cfb444ee03e9c1641cf170e9684c532'/>
<id>9961c88b1cfb444ee03e9c1641cf170e9684c532</id>
<content type='text'>
The driver explicitly sets the .driver_data member of struct
platform_device_id to zero without relying on that value. Drop these
unused assignments.

Signed-off-by: Uwe Kleine-König (The Capable Hub) &lt;u.kleine-koenig@baylibre.com&gt;
Message-ID: &lt;9afdb7b0894f51fba78c64612428f7bb117901d1.1781620139.git.u.kleine-koenig@baylibre.com&gt;
Signed-off-by: Corey Minyard &lt;corey@minyard.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The driver explicitly sets the .driver_data member of struct
platform_device_id to zero without relying on that value. Drop these
unused assignments.

Signed-off-by: Uwe Kleine-König (The Capable Hub) &lt;u.kleine-koenig@baylibre.com&gt;
Message-ID: &lt;9afdb7b0894f51fba78c64612428f7bb117901d1.1781620139.git.u.kleine-koenig@baylibre.com&gt;
Signed-off-by: Corey Minyard &lt;corey@minyard.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ipmi: si: Use platform_get_irq_optional() to retrieve interrupt</title>
<updated>2026-06-04T11:19:19+00:00</updated>
<author>
<name>Rosen Penev</name>
<email>rosenp@gmail.com</email>
</author>
<published>2026-06-03T19:25:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=39851b7e580a65bee732e5364f0efb974b242370'/>
<id>39851b7e580a65bee732e5364f0efb974b242370</id>
<content type='text'>
Use platform_get_irq_optional() to retrieve the interrupt resource
instead of directly parsing and mapping the OF node via
irq_of_parse_and_map().  This is the standard pattern for platform
devices.  irq_of_parse_and_map() requires ire_dispose_mapping(), which
is missing.

Assisted-by: Antigravity:Gemini-3.5-Flash
Signed-off-by: Rosen Penev &lt;rosenp@gmail.com&gt;
Message-ID: &lt;20260603192511.6869-1-rosenp@gmail.com&gt;
[Handle a negative return from platform_get_irq_optional() to mean
 no interrupt is assigned.]
Signed-off-by: Corey Minyard &lt;corey@minyard.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use platform_get_irq_optional() to retrieve the interrupt resource
instead of directly parsing and mapping the OF node via
irq_of_parse_and_map().  This is the standard pattern for platform
devices.  irq_of_parse_and_map() requires ire_dispose_mapping(), which
is missing.

Assisted-by: Antigravity:Gemini-3.5-Flash
Signed-off-by: Rosen Penev &lt;rosenp@gmail.com&gt;
Message-ID: &lt;20260603192511.6869-1-rosenp@gmail.com&gt;
[Handle a negative return from platform_get_irq_optional() to mean
 no interrupt is assigned.]
Signed-off-by: Corey Minyard &lt;corey@minyard.net&gt;
</pre>
</div>
</content>
</entry>
</feed>
