syzbot


general protection fault in btrfs_stop_all_workers

Status: fixed on 2023/02/24 13:50
Subsystems: btrfs
[Documentation on labels]
Reported-by: syzbot+a2c720e0f056114ea7c6@syzkaller.appspotmail.com
Fix commit: 385de0ef387d btrfs: use a normal workqueue for rmw_workers
First crash: 900d, last: 894d
Cause bisection: introduced by (bisect log) :
commit 9d7bd4c387c1b4776832cf8c895ab934efaa2f08
Author: Christoph Hellwig <hch@lst.de>
Date: Mon Apr 18 04:43:11 2022 +0000

  btrfs: use a normal workqueue for rmw_workers

Crash: general protection fault in btrfs_stop_all_workers (log)
Repro: C syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] general protection fault in btrfs_stop_all_workers 1 (3) 2022/04/28 05:05
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in btrfs_stop_all_workers (2) btrfs 307 108d 151d 26/28 fixed on 2024/07/31 03:12
Last patch testing requests (3)
Created Duration User Patch Repo Result
2022/11/23 22:30 20m retest repro linux-next error
2022/04/27 23:48 17m hdanton@sina.com patch https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/ 088fb7eff349 OK
2022/04/27 23:02 17m hch@lst.de git://git.infradead.org/users/hch/misc.git btrfs-workqueue-fix OK

Sample crash report:
general protection fault, probably for non-canonical address 0xdffffc0000000023: 0000 [#1] PREEMPT SMP KASAN
KASAN: null-ptr-deref in range [0x0000000000000118-0x000000000000011f]
CPU: 0 PID: 3596 Comm: syz-executor105 Not tainted 5.18.0-rc4-next-20220426-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:workqueue_sysfs_unregister kernel/workqueue.c:5796 [inline]
RIP: 0010:destroy_workqueue+0x2e/0x800 kernel/workqueue.c:4430
Code: 49 89 fe 41 55 41 54 55 53 48 83 ec 08 e8 2a fe 2b 00 49 8d be 18 01 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 37 07 00 00 49 8b 9e 18 01 00 00 48 85 db 74 19
RSP: 0018:ffffc90002f6f818 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: ffff8880248b4000 RCX: 0000000000000000
RDX: 0000000000000023 RSI: ffffffff814e4606 RDI: 0000000000000118
RBP: ffff8880248b4000 R08: 0000000000000000 R09: ffffffff9007194f
R10: 0000000000000001 R11: 0000000000000001 R12: 00000000fffffff4
R13: 0000000000001000 R14: 0000000000000000 R15: ffff88801e866000
FS:  00007f4c1f989700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f4c1fa2ff78 CR3: 000000002490a000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 btrfs_stop_all_workers+0x14c/0x2fe fs/btrfs/disk-io.c:2286
 open_ctree+0x481f/0x493b fs/btrfs/disk-io.c:3959
 btrfs_fill_super fs/btrfs/super.c:1430 [inline]
 btrfs_mount_root.cold+0x15/0x162 fs/btrfs/super.c:1796
 legacy_get_tree+0x105/0x220 fs/fs_context.c:610
 vfs_get_tree+0x89/0x2f0 fs/super.c:1497
 fc_mount fs/namespace.c:1043 [inline]
 vfs_kern_mount.part.0+0xd3/0x170 fs/namespace.c:1073
 vfs_kern_mount+0x3c/0x60 fs/namespace.c:1060
 btrfs_mount+0x234/0xa60 fs/btrfs/super.c:1856
 legacy_get_tree+0x105/0x220 fs/fs_context.c:610
 vfs_get_tree+0x89/0x2f0 fs/super.c:1497
 do_new_mount fs/namespace.c:3040 [inline]
 path_mount+0x1320/0x1fa0 fs/namespace.c:3370
 do_mount fs/namespace.c:3383 [inline]
 __do_sys_mount fs/namespace.c:3591 [inline]
 __se_sys_mount fs/namespace.c:3568 [inline]
 __x64_sys_mount+0x27f/0x300 fs/namespace.c:3568
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f4c1f9e079a
Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 a8 00 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f4c1f989168 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f4c1f9891c0 RCX: 00007f4c1f9e079a
RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007f4c1f989180
RBP: 000000000000008e R08: 00007f4c1f9891c0 R09: 00007f4c1f9896b8
R10: 0000000000000000 R11: 0000000000000286 R12: 00007f4c1f989180
R13: 0000000020000f50 R14: 0000000000000003 R15: 0000000000000004
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:workqueue_sysfs_unregister kernel/workqueue.c:5796 [inline]
RIP: 0010:destroy_workqueue+0x2e/0x800 kernel/workqueue.c:4430
Code: 49 89 fe 41 55 41 54 55 53 48 83 ec 08 e8 2a fe 2b 00 49 8d be 18 01 00 00 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f 85 37 07 00 00 49 8b 9e 18 01 00 00 48 85 db 74 19
RSP: 0018:ffffc90002f6f818 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: ffff8880248b4000 RCX: 0000000000000000
RDX: 0000000000000023 RSI: ffffffff814e4606 RDI: 0000000000000118
RBP: ffff8880248b4000 R08: 0000000000000000 R09: ffffffff9007194f
R10: 0000000000000001 R11: 0000000000000001 R12: 00000000fffffff4
R13: 0000000000001000 R14: 0000000000000000 R15: ffff88801e866000
FS:  00007f4c1f989700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f4c1fa2ff78 CR3: 000000002490a000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	49 89 fe             	mov    %rdi,%r14
   3:	41 55                	push   %r13
   5:	41 54                	push   %r12
   7:	55                   	push   %rbp
   8:	53                   	push   %rbx
   9:	48 83 ec 08          	sub    $0x8,%rsp
   d:	e8 2a fe 2b 00       	callq  0x2bfe3c
  12:	49 8d be 18 01 00 00 	lea    0x118(%r14),%rdi
  19:	48 b8 00 00 00 00 00 	movabs $0xdffffc0000000000,%rax
  20:	fc ff df
  23:	48 89 fa             	mov    %rdi,%rdx
  26:	48 c1 ea 03          	shr    $0x3,%rdx
* 2a:	80 3c 02 00          	cmpb   $0x0,(%rdx,%rax,1) <-- trapping instruction
  2e:	0f 85 37 07 00 00    	jne    0x76b
  34:	49 8b 9e 18 01 00 00 	mov    0x118(%r14),%rbx
  3b:	48 85 db             	test   %rbx,%rbx
  3e:	74 19                	je     0x59

Crashes (554):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/04/26 22:11 linux-next 088fb7eff349 1fa34c1b .config console log report syz C ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/02 11:15 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/02 10:10 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/02 10:00 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/02 08:36 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/02 07:19 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/02 06:29 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/02 05:26 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/02 05:17 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/02 04:10 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/02 03:02 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/02 02:55 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/02 01:49 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/02 00:47 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 23:50 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 22:44 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 21:26 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 20:51 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 19:34 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 18:27 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 17:32 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 16:06 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 15:13 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 14:08 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 13:06 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 11:51 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 11:50 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 10:35 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 09:15 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 09:03 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 08:02 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 06:56 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 06:53 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 05:47 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 04:45 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 04:03 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 03:02 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 01:54 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 01:45 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/05/01 00:44 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/04/30 23:37 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/04/30 23:09 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/04/30 22:00 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/04/30 21:00 linux-next 5469f0c06732 2df221f6 .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
2022/04/26 10:40 linux-next 088fb7eff349 1fa34c1b .config console log report info ci-upstream-linux-next-kasan-gce-root general protection fault in btrfs_stop_all_workers
* Struck through repros no longer work on HEAD.