From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.167.197 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796009860; b=cZGnETTgJRK6F0BdXBSqFzLs6CcqCHownYzP86P6d6NMHPHTv3zz3Yd5SJ4BpNWLO0aV IoF/Qdn4eZwXsj4Sy3sO7S+HvwuLC2Pfs5MNk/WaRHkvg4uf2amdoLcTMTId4i3W2Mp0t 6AAmJ4fxCsqMQX4pQOlgrV0e9BZnK1RgfiYG7Rj/90qlm1o2371+dGUJuqJZqQLH3Wjz/ vsXjJW4ftsGnVrz/B4u9ONkz/3pzlEH4SlVN/xCNqXaq9I2st934bXk1pQ2LTBJ5IsHyT fKWxrgsrOv//v/BcqPYZIqM9BO2CkZ2IF1ZPfljGEELFOIEMrWCDvaEYlhkkZMd6xLw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796009860; h=DMARC-Filter:Received:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:MIME-Version:X-Received:Date:In-Reply-To: X-Google-Appengine-App-Id:X-Google-Appengine-App-Id-Alias:Message-ID: Subject:From:To:Content-Type; bh=rEB/SvnEikyewY/98mQIEPHdWi6wbH0+SaEsBi0HiNM=; b=Mpf/+cKk9cnwt/WjB8QpXMAHINxph9JBgIuCyuLeTfynFSfQUDnGAsWrE4PZqGJiDc7Y 4HMoR2HcJ4STdZ/qsbmdutJ+NvT929ci4AQgXKZ0V7WRm2+5z5gtvFBFG3RPGDME59lyj YqRJRy0eQR4RcKNDmw8KRKBBbxWofIpjKOylLx1SkUvAjt28dHL7+jUHgCb9E55lgYX/8 KmHRnR+VpbnsAFCT5t5SFOFkeb5mF8UU8GXbjZIQ3ESMrhJpKsj7XCVqDSqz9r1sF6Lms 5Df5E9DSC4kbavKHif7eKZXHXrFuX5ON6KZtUO6eMOvIBHf5c8souA19AUg1/KTMWeA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.remote-ip=209.85.167.197 Received: from mail-oi1-f197.google.com (mail-oi1-f197.google.com [209.85.167.197]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 749D8606A325 for ; Mon, 30 Nov 2026 03:37:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 749D8606A325 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oi1-f197.google.com with SMTP id 5614622812f47-5713cd0fb42so11743018b6e.0 for ; Sun, 29 Nov 2026 19:37:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796009859; x=1796614659; h=content-type:to:from:subject:message-id:in-reply-to:date :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=rEB/SvnEikyewY/98mQIEPHdWi6wbH0+SaEsBi0HiNM=; b=INu22SPb//EgrbvhNRAW5Goh6KluMy5H6JekF0xDdSgjaPccT1G6kkWda50CvDK/LL YxnY6SA5YUIbmvGdHUhnoEGtD0ETHZoddIm0Xw2nPbfmYc2OOs1r6wMQnGwyOhmKYKZF T83ms3UP7Matfm4eFCuFM2ZCby0Z3ecHvzSz999TFzkWuyxt1Tc052eS4SZsahQu46m+ ZAxh2ZWJ0aZWRdVuoV48jIzkJ4QMXwfVpXTpI6LQwgzO/bOuQS02pSUSj1aQ7+X4tZQL kOkPikBdju1V0S4qjoOeVTOK/JE7A8Mjae7KLdrJHfMlHDh0x3HGFnQsIrj107vcSsQc gpcQ== X-Forwarded-Encrypted: i=1; AL+hErGk5o8CRck2k4Zl7RlMpJm7jTMedzISGvlTXt9hgCo2WSri3jwjAE1IXsmdVwDVaEjodB96jgWJDehWUko=@vger.kernel.org X-Gm-Message-State: APuU4Z8THTvRx+Zu5P18joCqgsEHeO18jwWaJ7Cjjz2ng0zY92l8Q9jU G8HuxGT4UjnpzQ7mSh3YCjPpE/rU32jru9aGWK2LEk+TN87kmuTuGOSYTNJcylE5LswY1T/wVTu 9MzfUyuxy98PKF/Cw+ZFzVWcP5XWPzl7OKjVjwNvwk25hludB5AlASVHoYWI= X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-Received: by 2002:a05:6808:2447:b0:4b8:4703:db90 with SMTP id 5614622812f47-5797cabc79emr25216711b6e.25.1796009859502; Sun, 29 Nov 2026 19:37:39 -0800 (PST) Date: Sun, 29 Nov 2026 19:37:39 -0800 In-Reply-To: <6b0bce4f.417e6985.1597c7.009f.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6b0cef83.3ba11d86.1c9c77.0006.GAE@google.com> Subject: Re: [syzbot] [f2fs?] kernel BUG in f2fs_put_super (6) From: syzbot To: chao@kernel.org, jaegeuk@kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" syzbot has found a reproducer for the following issue on: HEAD commit: 4f069ab1ec24 Merge tag 'scsi-fixes' of git://git.kernel.or.. git tree: upstream console+strace: https://syzkaller.appspot.com/x/log.txt?x=1141707e580000 kernel config: https://syzkaller.appspot.com/x/.config?x=fc1834b4a2e3ba54 dashboard link: https://syzkaller.appspot.com/bug?extid=467d56faa7809a907f05 compiler: Debian clang version 22.1.8 (1~deb13u5), Debian LLD 22.1.8 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13f858cd580000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17f858cd580000 Downloadable assets: disk image: https://storage.googleapis.com/syzbot-assets/66ff8e791620/disk-4f069ab1.raw.xz vmlinux: https://storage.googleapis.com/syzbot-assets/35a2aede79e4/vmlinux-4f069ab1.xz kernel image: https://storage.googleapis.com/syzbot-assets/408f236d215b/bzImage-4f069ab1.xz mounted in repro: https://storage.googleapis.com/syzbot-assets/d914a2a47804/mount_0.gz fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=11f858cd580000) The issue was bisected by AI to: commit 2c8a4a28233482ad697db92d86da10fcb498eaf7 Author: Jaegeuk Kim Date: Tue Nov 14 01:46:38 2017 +0000 f2fs: expose quota information in debugfs reasoning: https://syzkaller.appspot.com/ai_job?id=afdc04f1-1f8f-4df0-b173-64508745fa2f AI-generated root cause summary: In f2fs, sbi->nr_caches[F2FS_DIRTY_QDATA] is incremented in inode_inc_dirty_pages() and decremented in inode_dec_dirty_pages() conditionally on IS_NOQUOTA(inode) (S_NOQUOTA), which assumes S_NOQUOTA cannot change while an inode has dirty folios. However, f2fs_quota_on() flushes dirty pages via filemap_fdatawrite()/filemap_fdatawait() without holding inode_lock, filemap_invalidate_lock, or denying concurrent writes/mmap faults before dquot_quota_on() -> vfs_setup_quota_inode() sets S_NOQUOTA on the inode. A folio dirtied during that window increments F2FS_DIRTY_DATA without incrementing F2FS_DIRTY_QDATA, and when subsequently written back or invalidated (including by sync_filesystem() inside dquot_load_quota_sb()) after S_NOQUOTA is set, inode_dec_dirty_pages() decrements both F2FS_DIRTY_DATA and F2FS_DIRTY_QDATA, driving F2FS_DIRTY_QDATA to -1 and triggering f2fs_bug_on(sbi, 1) in f2fs_put_super(). full analysis: https://syzkaller.appspot.com/x/ai_root_cause?x=467d56faa7809a907f05 IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+467d56faa7809a907f05@syzkaller.appspotmail.com The bisection result may be wrong. If you agree with it, please also add: Fixes: 2c8a4a282334 ("f2fs: expose quota information in debugfs") F2FS-fs (loop3): detect filesystem reference count leak during umount, type: 2, count: -1, err: -5, cp_err: 1 ------------[ cut here ]------------ kernel BUG at fs/f2fs/super.c:2084! Oops: invalid opcode: 0000 [#1] SMP KASAN PTI CPU: 1 UID: 0 PID: 5626 Comm: syz-executor204 Not tainted syzkaller #0 PREEMPT_{RT,(full)} Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026 RIP: 0010:f2fs_put_super+0x145a/0x1460 fs/f2fs/super.c:2084 Code: c1 e8 03 83 e0 01 48 8b 7c 24 18 31 f6 48 c7 c2 60 54 df 8b 44 89 f9 4d 89 f0 44 8b 4c 24 28 50 e8 fb 21 fd ff 48 83 c4 08 90 <0f> 0b 0f 1f 40 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 0018:ffffc90004ce7800 EFLAGS: 00010296 RAX: 4b622689e1bfa200 RBX: dffffc0000000000 RCX: 4b622689e1bfa200 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc90004ce7a78 R08: 0000000000000000 R09: 0000000000000000 R10: dffffc0000000000 R11: fffff5200099ce89 R12: ffff88803621c084 R13: ffff88803621c087 R14: ffffffffffffffff R15: 0000000000000002 FS: 000055558cad3400(0000) GS:ffff8881247fa000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007ffd8e1178fc CR3: 000000004635a000 CR4: 00000000003526f0 Call Trace: generic_shutdown_super+0x140/0x2d0 fs/super.c:723 kill_block_super+0x44/0xa0 fs/super.c:1852 kill_f2fs_super+0x3b5/0x700 fs/f2fs/super.c:5788 deactivate_locked_super+0xbe/0x110 fs/super.c:558 cleanup_mnt+0x204/0x2a0 fs/namespace.c:1396 task_work_run+0x1d9/0x260 kernel/task_work.c:233 ptrace_notify+0x258/0x290 kernel/signal.c:2598 ptrace_report_syscall include/linux/ptrace.h:416 [inline] ptrace_report_syscall_exit+0x2d/0x50 include/linux/ptrace.h:477 arch_ptrace_report_syscall_exit include/linux/entry-common.h:240 [inline] syscall_exit_work include/linux/entry-common.h:273 [inline] syscall_exit_to_user_mode_work include/linux/entry-common.h:304 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:341 [inline] do_syscall_64+0x4c4/0x540 arch/x86/entry/syscall_64.c:107 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f13496c5717 Code: bf 41 4d 56 53 b8 9d 00 00 00 0f 05 83 f8 ea 75 a2 c7 05 b8 a3 0a 00 00 00 00 00 eb 96 e8 31 06 00 00 90 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 d0 ff ff ff f7 d8 64 89 02 b8 RSP: 002b:00007ffd8e1178e8 EFLAGS: 00000206 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 0000000000018830 RCX: 00007f13496c5717 RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffd8e1179a0 RBP: 00007ffd8e1179a0 R08: 00007ffd8e1189a0 R09: 00000000ffffffff R10: 0000000000000000 R11: 0000000000000206 R12: 00007ffd8e118a50 R13: 000055558cad4760 R14: 431bde82d7b634db R15: 00007ffd8e1189f4 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:f2fs_put_super+0x145a/0x1460 fs/f2fs/super.c:2084 Code: c1 e8 03 83 e0 01 48 8b 7c 24 18 31 f6 48 c7 c2 60 54 df 8b 44 89 f9 4d 89 f0 44 8b 4c 24 28 50 e8 fb 21 fd ff 48 83 c4 08 90 <0f> 0b 0f 1f 40 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 RSP: 0018:ffffc90004ce7800 EFLAGS: 00010296 RAX: 4b622689e1bfa200 RBX: dffffc0000000000 RCX: 4b622689e1bfa200 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffc90004ce7a78 R08: 0000000000000000 R09: 0000000000000000 R10: dffffc0000000000 R11: fffff5200099ce89 R12: ffff88803621c084 R13: ffff88803621c087 R14: ffffffffffffffff R15: 0000000000000002 FS: 000055558cad3400(0000) GS:ffff8881246fa000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055558cadc798 CR3: 000000004635a000 CR4: 00000000003526f0