]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ipmi: Rework user message limit handling
authorCorey Minyard <corey@minyard.net>
Thu, 16 Oct 2025 18:50:57 +0000 (13:50 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 19 Oct 2025 14:23:21 +0000 (16:23 +0200)
commitf63723ca7d7623f9dae1990973cd158671f03c56
tree24694ef54855c7873cd5f52debc5b147f32ef98b
parent5ef5ee7999dc604d16019e4e2b95319ff5b17a00
ipmi: Rework user message limit handling

commit b52da4054ee0bf9ecb44996f2c83236ff50b3812 upstream

This patch required quite a bit of work to backport due to a number
of unrelated changes that do not make sense to backport.  This has
been run against my test suite and passes all tests.

The limit on the number of user messages had a number of issues,
improper counting in some cases and a use after free.

Restructure how this is all done to handle more in the receive message
allocation routine, so all refcouting and user message limit counts
are done in that routine.  It's a lot cleaner and safer.

Reported-by: Gilles BULOZ <gilles.buloz@kontron.com>
Closes: https://lore.kernel.org/lkml/aLsw6G0GyqfpKs2S@mail.minyard.net/
Fixes: 8e76741c3d8b ("ipmi: Add a limit on the number of users that may use IPMI")
Cc: <stable@vger.kernel.org> # 4.19
Signed-off-by: Corey Minyard <corey@minyard.net>
Tested-by: Gilles BULOZ <gilles.buloz@kontron.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/ipmi/ipmi_msghandler.c