BUG: Bad page state in z_erofs_do_read_page
#syz test
fs/erofs/zdata.c +2 -0
@@ -1538,6 +1538,8 @@ static struct page *pickup_page_for_submission(struct z_erofs_pcluster *pcl, }unlock_page (page);put_page (page); +/* since pcl->compressed_bvecs[nr].page has changed above */ + oldpage = page; out_allocpage: page =erofs_allocpage (pagepool, gfp | __GFP_NOFAIL); if (oldpage != cmpxchg(&pcl->compressed_bvecs[nr].page,
#syz test
fs/erofs/zdata.c +1 -0
@@ -1485,6 +1485,7 @@ static struct page *pickup_page_for_submission(struct z_erofs_pcluster *pcl,lock_page (page);if (likely (page->mapping == mc)) {WRITE_ONCE (pcl->compressed_bvecs[nr].page, page); + oldpage = page;/* * The cached folio is still in managed cache but without
syzbot has tested the proposed patch and the reproducer did not trigger any issue:
Hello,
syzbot has tested the proposed patch and the reproducer did not trigger any issue:
Reported-by [email protected]
Tested-by [email protected]
Tested on:
commit: 4fc00fe3 Linux 6.6.129 git tree: linux-6.6.y console output: https://syzkaller.appspot.com/x/log.txt?x=135ff6da580000 kernel config: https://syzkaller.appspot.com/x/.config?x=cf30d9e358c58220 dashboard link: https://syzkaller.appspot.com/bug?extid=b6353e35ae2bab997538 compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8 patch: https://syzkaller.appspot.com/x/patch.diff?x=1029ecba580000
Note: testing is done by a robot and is best-effort only.
syzbot
syzbotsyzbot tried to test the proposed patch but the build/boot failed:
Hello,
syzbot tried to test the proposed patch but the build/boot failed:
failed to apply patch:
checking file fs/erofs/zdata.c
Hunk #1 FAILED at 1538.
1 out of 1 hunk FAILED
Tested on:
commit: 4fc00fe3 Linux 6.6.129 git tree: linux-6.6.y kernel config: https://syzkaller.appspot.com/x/.config?x=691a6769a86ac817 dashboard link: https://syzkaller.appspot.com/bug?extid=b6353e35ae2bab997538
compiler:
patch: https://syzkaller.appspot.com/x/patch.diff?x=105721d6580000