]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
spi: mpc52xx: fix use-after-free on unbind
authorJohan Hovold <johan@kernel.org>
Tue, 14 Apr 2026 13:43:15 +0000 (15:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 17 May 2026 15:16:29 +0000 (17:16 +0200)
commitbbcd6dd8e9f264440eaf6167382bf404911c1c46
treeb392872c9b1a3d91e7c628fe88b63961684c1e8b
parent7fea80d93bfd34051b2ac1cec07766c87d8d28be
spi: mpc52xx: fix use-after-free on unbind

commit 706b3dc2ac7a998c55e14b3fd2e8f934c367e6e0 upstream.

The state machine work is scheduled by the interrupt handler and
therefore needs to be cancelled after disabling interrupts to avoid a
potential use-after-free.

Fixes: 984836621aad ("spi: mpc52xx: Add cancel_work_sync before module remove")
Cc: stable@vger.kernel.org
Cc: Pei Xiao <xiaopei01@kylinos.cn>
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260414134319.978196-5-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spi/spi-mpc52xx.c