Re: [syzbot] [mm?] BUG: corrupted list in do_compact_page

From: Hillf Danton
Date: Thu Oct 03 2024 - 07:00:07 EST


On Wed, 02 Oct 2024 22:22:24 -0700
> syzbot has found a reproducer for the following issue on:
>
> HEAD commit: f23aa4c0761a Merge tag 'hid-for-linus-2024090201' of git:/..
> git tree: upstream
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=174ab580580000

#syz test

--- x/mm/z3fold.c
+++ y/mm/z3fold.c
@@ -1351,8 +1351,11 @@ static void z3fold_page_putback(struct p
pool = zhdr_to_pool(zhdr);

z3fold_page_lock(zhdr);
- if (!list_empty(&zhdr->buddy))
+ if (!list_empty(&zhdr->buddy)) {
+ spin_lock(&pool->lock);
list_del_init(&zhdr->buddy);
+ spin_unlock(&pool->lock);
+ }
INIT_LIST_HEAD(&page->lru);
if (put_z3fold_locked(zhdr))
return;
--