public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Julian Sun <sunjunchao2870@gmail.com>
To: syzbot <syzbot+5833b186650f87c5b7c4@syzkaller.appspotmail.com>,
	 clm@fb.com, dsterba@suse.com, josef@toxicpanda.com,
	linux-btrfs@vger.kernel.org,  linux-kernel@vger.kernel.org,
	syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [btrfs?] kernel BUG in btrfs_run_defrag_inodes (2)
Date: Tue, 27 Aug 2024 17:42:46 +0800	[thread overview]
Message-ID: <b65a238dd9852158d381156aa6db92c0ef09562e.camel@gmail.com> (raw)
In-Reply-To: <0000000000009e7183061ee0a25f@google.com>

On Sun, 2024-08-04 at 12:33 -0700, syzbot wrote:

#syz dup: kernel BUG in clear_inode

As mentioned in fix[1], there are two threads simultaneously evicting
the same inode, which may trigger the BUG(inode->i_state & I_CLEAR)
statement both within clear_inode() and iput().
So this report specifically triggered the BUG(inode->i_state & I_CLEAR)
statement in iput(). And I did encounter this issue when I attempted to
reproduce and fix it.

[1]:https://lore.kernel.org/linux-btrfs/20240823130730.658881-1-sunjunchao2870@gmail.com/

> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    e4fc196f5ba3 Merge tag 'for-6.11-rc1-tag' of
> git://git.ker..
> git tree:       upstream
> console output:
> https://syzkaller.appspot.com/x/log.txt?x=133acef9980000
> kernel config: 
> https://syzkaller.appspot.com/x/.config?x=8b0cca2f3880513d
> dashboard link:
> https://syzkaller.appspot.com/bug?extid=5833b186650f87c5b7c4
> compiler:       Debian clang version 15.0.6, GNU ld (GNU Binutils for
> Debian) 2.40
> 
> Unfortunately, I don't have any reproducer for this issue yet.
> 
> Downloadable assets:
> disk image:
> https://storage.googleapis.com/syzbot-assets/c4bed4c74b59/disk-e4fc196f.raw.xz
> vmlinux:
> https://storage.googleapis.com/syzbot-assets/f90c5ef25b80/vmlinux-e4fc196f.xz
> kernel image:
> https://storage.googleapis.com/syzbot-assets/3a4dad9a7e8e/bzImage-e4fc196f.xz
> 
> IMPORTANT: if you fix the issue, please add the following tag to the
> commit:
> Reported-by: syzbot+5833b186650f87c5b7c4@syzkaller.appspotmail.com
> 
> ------------[ cut here ]------------
> kernel BUG at fs/inode.c:1819!
> Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN NOPTI
> CPU: 1 UID: 0 PID: 10710 Comm: btrfs-cleaner Not tainted 6.11.0-rc1-
> syzkaller-00062-ge4fc196f5ba3 #0
> Hardware name: Google Google Compute Engine/Google Compute Engine,
> BIOS Google 06/27/2024
> RIP: 0010:iput+0x928/0x930 fs/inode.c:1819
> Code: ff e9 a7 fb ff ff 44 89 f1 80 e1 07 80 c1 03 38 c1 0f 8c 45 fe
> ff ff 4c 89 f7 e8 33 aa e7 ff e9 38 fe ff ff e8 29 71 80 ff 90 <0f>
> 0b 66 0f 1f 44 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90
> RSP: 0018:ffffc900041ffc50 EFLAGS: 00010293
> RAX: ffffffff8212f547 RBX: 0000000000000040 RCX: ffff888023d05a00
> RDX: 0000000000000000 RSI: 0000000000000040 RDI: 0000000000000000
> RBP: ffff88805e4f48e0 R08: ffffffff8212ec80 R09: 1ffffffff202f495
> R10: dffffc0000000000 R11: fffffbfff202f496 R12: ffff88805e4f49b0
> R13: ffff88806c102028 R14: 0000000000000005 R15: ffff888068e60350
> FS:  0000000000000000(0000) GS:ffff8880b9300000(0000)
> knlGS:0000000000000000
> CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: 00007f1c9b094108 CR3: 000000005d542000 CR4: 0000000000350ef0
> Call Trace:
>  <TASK>
>  __btrfs_run_defrag_inode fs/btrfs/defrag.c:281 [inline]
>  btrfs_run_defrag_inodes+0xa80/0xdf0 fs/btrfs/defrag.c:327
>  cleaner_kthread+0x28c/0x3d0 fs/btrfs/disk-io.c:1527
>  kthread+0x2f2/0x390 kernel/kthread.c:389
>  ret_from_fork+0x4d/0x80 arch/x86/kernel/process.c:147
>  ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
>  </TASK>
> Modules linked in:
> ---[ end trace 0000000000000000 ]---
> RIP: 0010:iput+0x928/0x930 fs/inode.c:1819
> Code: ff e9 a7 fb ff ff 44 89 f1 80 e1 07 80 c1 03 38 c1 0f 8c 45 fe
> ff ff 4c 89 f7 e8 33 aa e7 ff e9 38 fe ff ff e8 29 71 80 ff 90 <0f>
> 0b 66 0f 1f 44 00 00 90 90 90 90 90 90 90 90 90 90 90 90 90 90
> RSP: 0018:ffffc900041ffc50 EFLAGS: 00010293
> RAX: ffffffff8212f547 RBX: 0000000000000040 RCX: ffff888023d05a00
> RDX: 0000000000000000 RSI: 0000000000000040 RDI: 0000000000000000
> RBP: ffff88805e4f48e0 R08: ffffffff8212ec80 R09: 1ffffffff202f495
> R10: dffffc0000000000 R11: fffffbfff202f496 R12: ffff88805e4f49b0
> R13: ffff88806c102028 R14: 0000000000000005 R15: ffff888068e60350
> FS:  0000000000000000(0000) GS:ffff8880b9300000(0000)
> knlGS:0000000000000000
> CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: 00007f1c9b094108 CR3: 000000006b99e000 CR4: 0000000000350ef0
> 
> 
> ---
> 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

Thanks,
-- 
Julian Sun <sunjunchao2870@gmail.com>

      reply	other threads:[~2024-08-27  9:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-04 19:33 [syzbot] [btrfs?] kernel BUG in btrfs_run_defrag_inodes (2) syzbot
2024-08-27  9:42 ` Julian Sun [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b65a238dd9852158d381156aa6db92c0ef09562e.camel@gmail.com \
    --to=sunjunchao2870@gmail.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+5833b186650f87c5b7c4@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox