From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A34DF3859FF for ; Wed, 29 Apr 2026 07:40:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777448459; cv=none; b=B36bCixf2ko5YEs8E8/kye8XQOXagqK9EUm6ETiFB1KrEqnLLTHdsamJxwj9upVjT0edckwSTK1rDq62EJcyYhxKqCZzENPG6t2Kg7PBCGtdiHd+PDqBRh3KotvEOsA2R90jMWcbNSvP5QDDRGArAO/CPGsrgq5CkwcFczWXMsQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777448459; c=relaxed/simple; bh=I8c/tz/JamJde8CBVpYuI+nwBjWL0uESkEiXsvHZp0M=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=VcpZm6YEWtbCv9aKNof38wc7P7JNWMgfXhgWklJoCuwDUJCez4PoBmAOgsK+HcxSYmZ4Bb+9tu4ouEoQpXosqQeDSGtqwuJ9kbtgBjtlAa90vVzBGBmSCbn3oBUmHqQgOCeiZR1kHmyxZJjas2pT1WGLSExEPZFJb80iY7yFb/k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CSjwpSjH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CSjwpSjH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEF68C19425; Wed, 29 Apr 2026 07:40:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777448459; bh=I8c/tz/JamJde8CBVpYuI+nwBjWL0uESkEiXsvHZp0M=; h=Date:From:Subject:To:Cc:References:In-Reply-To:From; b=CSjwpSjHGnbf68KALGQNYkBk61jgwllnke4z09lz1g6vhIIZmt4NpGiM0frB0crZO +Ea9NJpYpYxnS/h9HSXdhcT4qqfN+mgELr3LhOar3SsR1Cw+Nd/VFOQn43gK+YMiIX ClExlHoNEMIk1+tqpWDJ/GZKRUmx12PtC5ri2s9LiccI0FRPboz4aNo97ZDm3KJ6XB eliWXViX5uvIm0hsYQUUytJb3/LyOgdsHyNfxM22oLp3Hquo+zXaEpIPfqm1LHSUQk YCWkEOzIkbZFocSZ3EjHdujquP6P6vXRa6MYgixBXxsmGyrkvh7zjAALb/mwhP83h3 oOB5YqEzbAapg== Message-ID: <7b290a95-d488-4c48-ad4b-ca2b371cbdff@kernel.org> Date: Wed, 29 Apr 2026 15:40:55 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Chao Yu Subject: Re: [syzbot] [f2fs?] kernel BUG in folio_end_read (3) To: syzbot , jaegeuk@kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Cc: chao@kernel.org References: <69ddb064.a00a0220.468cb.0057.GAE@google.com> Content-Language: en-US In-Reply-To: <69ddb064.a00a0220.468cb.0057.GAE@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit #syz fix f2fs: avoid reading already updated pages during GC On 4/14/2026 11:11 AM, syzbot wrote: > Hello, > > syzbot found the following issue on: > > HEAD commit: a55f7f5f29b3 Merge tag 'net-7.0-rc8' of git://git.kernel.o.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=15cc7bd6580000 > kernel config: https://syzkaller.appspot.com/x/.config?x=d46eab0cfd31c214 > dashboard link: https://syzkaller.appspot.com/bug?extid=337ec6af661bd91fa43a > compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8 > > Unfortunately, I don't have any reproducer for this issue yet. > > Downloadable assets: > disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/d900f083ada3/non_bootable_disk-a55f7f5f.raw.xz > vmlinux: https://storage.googleapis.com/syzbot-assets/6392912f99d3/vmlinux-a55f7f5f.xz > kernel image: https://storage.googleapis.com/syzbot-assets/9d6fd8c7dfa0/bzImage-a55f7f5f.xz > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > Reported-by: syzbot+337ec6af661bd91fa43a@syzkaller.appspotmail.com > > page: refcount:2 mapcount:0 mapping:ffff888046f3e788 index:0x1507 pfn:0x32d0e > memcg:ffff88801c6c8d40 > aops:f2fs_meta_aops ino:2 > flags: 0x4fff400000000a9(locked|waiters|uptodate|lru|node=1|zone=1|lastcpupid=0x7ff) > raw: 04fff400000000a9 ffffea0000d1b988 ffff888030450a80 ffff888046f3e788 > raw: 0000000000001507 0000000000000000 00000002ffffffff ffff88801c6c8d40 > page dumped because: VM_BUG_ON_FOLIO(success && folio_test_uptodate(folio)) > page_owner tracks the page as allocated > page last allocated via order 0, migratetype Unmovable, gfp_mask 0x40c40(GFP_NOFS|__GFP_COMP), pid 5318, tgid 5316 (syz.0.0), ts 76502021566, free_ts 42035680990 > set_page_owner include/linux/page_owner.h:32 [inline] > post_alloc_hook+0x231/0x280 mm/page_alloc.c:1889 > prep_new_page mm/page_alloc.c:1897 [inline] > get_page_from_freelist+0x24dc/0x2580 mm/page_alloc.c:3962 > __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5250 > alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2490 > alloc_frozen_pages_noprof mm/mempolicy.c:2561 [inline] > alloc_pages_noprof+0xa8/0x1a0 mm/mempolicy.c:2581 > folio_alloc_noprof+0x1e/0x30 mm/mempolicy.c:2591 > filemap_alloc_folio_noprof+0x111/0x470 mm/filemap.c:1013 > __filemap_get_folio_mpol+0x3fc/0xb00 mm/filemap.c:2011 > __filemap_get_folio include/linux/pagemap.h:763 [inline] > f2fs_filemap_get_folio fs/f2fs/f2fs.h:3065 [inline] > ra_data_block+0x544/0xd00 fs/f2fs/gc.c:1277 > gc_data_segment fs/f2fs/gc.c:1648 [inline] > do_garbage_collect+0x358d/0x7080 fs/f2fs/gc.c:1874 > f2fs_gc+0xca2/0x2570 fs/f2fs/gc.c:1981 > f2fs_balance_fs+0x657/0x840 fs/f2fs/segment.c:467 > f2fs_map_blocks+0x2958/0x4340 fs/f2fs/data.c:1826 > f2fs_iomap_begin+0x3bd/0x8f0 fs/f2fs/data.c:4527 > iomap_iter+0x600/0x1020 fs/iomap/iter.c:110 > __iomap_dio_rw+0x1360/0x1ea0 fs/iomap/direct-io.c:795 > page last free pid 15 tgid 15 stack trace: > reset_page_owner include/linux/page_owner.h:25 [inline] > __free_pages_prepare mm/page_alloc.c:1433 [inline] > __free_frozen_pages+0xc2b/0xdb0 mm/page_alloc.c:2978 > __tlb_remove_table_free mm/mmu_gather.c:228 [inline] > tlb_remove_table_rcu+0x85/0x100 mm/mmu_gather.c:291 > rcu_do_batch kernel/rcu/tree.c:2617 [inline] > rcu_core+0x7cd/0x1070 kernel/rcu/tree.c:2869 > handle_softirqs+0x22a/0x870 kernel/softirq.c:622 > run_ksoftirqd+0x36/0x60 kernel/softirq.c:1063 > smpboot_thread_fn+0x541/0xa50 kernel/smpboot.c:160 > kthread+0x388/0x470 kernel/kthread.c:436 > ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158 > ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 > ------------[ cut here ]------------ > kernel BUG at mm/filemap.c:1536! > Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI > CPU: 0 UID: 0 PID: 42 Comm: kworker/u4:3 Not tainted syzkaller #0 PREEMPT(full) > Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 > Workqueue: loop0 loop_workfn > RIP: 0010:folio_end_read+0x22e/0x230 mm/filemap.c:1536 > Code: 6f c3 ff 48 89 df 48 c7 c6 e0 c4 d7 8b e8 ba ba 25 ff 90 0f 0b e8 02 6f c3 ff 48 89 df 48 c7 c6 40 bb d7 8b e8 a3 ba 25 ff 90 <0f> 0b 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa > RSP: 0018:ffffc90000447478 EFLAGS: 00010246 > RAX: b965f80585da9300 RBX: ffffea0000cb4380 RCX: 0000000000000000 > RDX: 0000000000000006 RSI: ffffffff8deff28a RDI: 00000000ffffffff > RBP: 0000000000000001 R08: ffffffff9011feb7 R09: 1ffffffff2023fd6 > R10: dffffc0000000000 R11: fffffbfff2023fd7 R12: 1ffffd4000196871 > R13: 1ffffd4000196870 R14: ffffea0000cb4388 R15: 0000000000000008 > FS: 0000000000000000(0000) GS:ffff88808ca49000(0000) knlGS:0000000000000000 > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > CR2: 00007f8b147ff000 CR3: 0000000038c3d000 CR4: 0000000000352ef0 > Call Trace: > > f2fs_finish_read_bio+0x4fc/0x940 fs/f2fs/data.c:182 > blk_update_request+0x57e/0xe60 block/blk-mq.c:1016 > blk_mq_end_request+0x3e/0x70 block/blk-mq.c:1178 > lo_rw_aio_complete drivers/block/loop.c:337 [inline] > lo_rw_aio+0xcde/0xf00 drivers/block/loop.c:409 > do_req_filebacked drivers/block/loop.c:435 [inline] > loop_handle_cmd drivers/block/loop.c:1925 [inline] > loop_process_work+0x958/0x11a0 drivers/block/loop.c:1960 > process_one_work kernel/workqueue.c:3276 [inline] > process_scheduled_works+0xb6e/0x18c0 kernel/workqueue.c:3359 > worker_thread+0xa53/0xfc0 kernel/workqueue.c:3440 > kthread+0x388/0x470 kernel/kthread.c:436 > ret_from_fork+0x51e/0xb90 arch/x86/kernel/process.c:158 > ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 > > Modules linked in: > ---[ end trace 0000000000000000 ]--- > RIP: 0010:folio_end_read+0x22e/0x230 mm/filemap.c:1536 > Code: 6f c3 ff 48 89 df 48 c7 c6 e0 c4 d7 8b e8 ba ba 25 ff 90 0f 0b e8 02 6f c3 ff 48 89 df 48 c7 c6 40 bb d7 8b e8 a3 ba 25 ff 90 <0f> 0b 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 f3 0f 1e fa > RSP: 0018:ffffc90000447478 EFLAGS: 00010246 > RAX: b965f80585da9300 RBX: ffffea0000cb4380 RCX: 0000000000000000 > RDX: 0000000000000006 RSI: ffffffff8deff28a RDI: 00000000ffffffff > RBP: 0000000000000001 R08: ffffffff9011feb7 R09: 1ffffffff2023fd6 > R10: dffffc0000000000 R11: fffffbfff2023fd7 R12: 1ffffd4000196871 > R13: 1ffffd4000196870 R14: ffffea0000cb4388 R15: 0000000000000008 > FS: 0000000000000000(0000) GS:ffff88808ca49000(0000) knlGS:0000000000000000 > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > CR2: 00007f8b147ff000 CR3: 0000000038c3d000 CR4: 0000000000352ef0 > > > --- > This report is generated by a bot. It may contain errors. > See https://goo.gl/tpsmEJ for more information about syzbot. > syzbot engineers can be reached at syzkaller@googlegroups.com. > > syzbot will keep track of this issue. See: > https://goo.gl/tpsmEJ#status for how to communicate with syzbot. > > If the report is already addressed, let syzbot know by replying with: > #syz fix: exact-commit-title > > If you want to overwrite report's subsystems, reply with: > #syz set subsystems: new-subsystem > (See the list of subsystem names on the web dashboard) > > If the report is a duplicate of another one, reply with: > #syz dup: exact-subject-of-another-report > > If you want to undo deduplication, reply with: > #syz undup