]> 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:49:16 +0000 (13:49 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 19 Oct 2025 14:34:04 +0000 (16:34 +0200)
commit53d6e403affbf6df2c859a0ea00ccfc1e72090ca
tree12d74daab5abba6139ed6743fe42940ed3d4cf37
parent1e059ce9cc7b20f19d3c4b6e39e72ecb42da1ce8
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