Re: [PATCH stable] ipmi:msghandler: Fix potential memory corruption in ipmi_create_user()

From: Greg KH
Date: Mon Jun 30 2025 - 14:10:27 EST


On Mon, Jun 30, 2025 at 05:09:02PM +0000, Brendan Jackman wrote:
> From: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
>
> commit fa332f5dc6fc662ad7d3200048772c96b861cf6b upstream
>
> The "intf" list iterator is an invalid pointer if the correct
> "intf->intf_num" is not found. Calling atomic_dec(&intf->nr_users) on
> and invalid pointer will lead to memory corruption.
>
> We don't really need to call atomic_dec() if we haven't called
> atomic_add_return() so update the if (intf->in_shutdown) path as well.
>
> Fixes: 8e76741c3d8b ("ipmi: Add a limit on the number of users that may use IPMI")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> Message-ID: <aBjMZ8RYrOt6NOgi@stanley.mountain>
> Signed-off-by: Corey Minyard <corey@xxxxxxxxxxx>
> Signed-off-by: Brendan Jackman <jackmanb@xxxxxxxxxx>
> ---
> I have tested this in 6.12 with Google's platform drivers added to
> reproduce the bug. The bug causes the panic notifier chain to get
> corrupted leading to a crash. With the fix this goes away.
>
> Applies to 6.6 too but I haven't tested it there.

So what kernels are you wanting this to be applied to?

thanks,

greg k-h