Re: [syzbot] [PATCH] MTD: fix slab-use-after-free due to dangling pointer in notifier chain

From: syzbot
Date: Sun Dec 08 2024 - 02:51:17 EST


For archival purposes, forwarding an incoming command email to
linux-kernel@xxxxxxxxxxxxxxx.

***

Subject: [PATCH] MTD: fix slab-use-after-free due to dangling pointer in notifier chain
Author: dennis.lamerice@xxxxxxxxx

Signed-off-by: Dennis Lam <dennis.lamerice@xxxxxxxxx>
---
#syz test

drivers/mtd/ubi/wl.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c
index 4f6f339d8fb8..31a1e5515d98 100644
--- a/drivers/mtd/ubi/wl.c
+++ b/drivers/mtd/ubi/wl.c
@@ -1995,6 +1995,7 @@ static void protection_queue_destroy(struct ubi_device *ubi)
void ubi_wl_close(struct ubi_device *ubi)
{
dbg_wl("close the WL sub-system");
+ unregister_reboot_notifier(&ubi->wl_reboot_notifier);
ubi_fastmap_close(ubi);
shutdown_work(ubi);
protection_queue_destroy(ubi);
--
2.47.0