syzbot


BUG: using __this_cpu_add() in preemptible code in kernfs_fop_write_iter

Status: upstream: reported on 2024/04/16 00:37
Subsystems: kernfs
[Documentation on labels]
Reported-by: syzbot+ef8020e2f85fb6335ed1@syzkaller.appspotmail.com
First crash: 18d, last: 18d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [kernfs?] BUG: using __this_cpu_add() in preemptible code in kernfs_fop_write_iter 0 (1) 2024/04/16 00:37

Sample crash report:
BUG: using __this_cpu_add() in preemptible [00000000] code: syz-executor.1/5775
caller is __pv_queued_spin_lock_slowpath+0x272/0xc80 kernel/locking/qspinlock.c:565
CPU: 1 PID: 5775 Comm: syz-executor.1 Not tainted 6.8.0-syzkaller-08951-gfe46a7dd189e #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x16c/0x1f0 lib/dump_stack.c:114
 check_preemption_disabled+0xd0/0xe0 lib/smp_processor_id.c:49
 __pv_queued_spin_lock_slowpath+0x272/0xc80 kernel/locking/qspinlock.c:565
 pv_queued_spin_lock_slowpath arch/x86/include/asm/paravirt.h:584 [inline]
 queued_spin_lock_slowpath arch/x86/include/asm/qspinlock.h:51 [inline]
 queued_spin_lock include/asm-generic/qspinlock.h:114 [inline]
 lockdep_lock+0x1b8/0x200 kernel/locking/lockdep.c:144
 graph_lock kernel/locking/lockdep.c:170 [inline]
 lookup_chain_cache_add kernel/locking/lockdep.c:3804 [inline]
 validate_chain kernel/locking/lockdep.c:3837 [inline]
 __lock_acquire+0x15a8/0x3b30 kernel/locking/lockdep.c:5137
 lock_acquire kernel/locking/lockdep.c:5754 [inline]
 lock_acquire+0x1b1/0x540 kernel/locking/lockdep.c:5719
 __might_fault mm/memory.c:6080 [inline]
 __might_fault+0x11b/0x190 mm/memory.c:6073
 _copy_from_iter+0x1c4/0x1110 lib/iov_iter.c:259
 copy_from_iter include/linux/uio.h:204 [inline]
 kernfs_fop_write_iter+0x1a3/0x500 fs/kernfs/file.c:315
 call_write_iter include/linux/fs.h:2108 [inline]
 new_sync_write fs/read_write.c:497 [inline]
 vfs_write+0x6de/0x1100 fs/read_write.c:590
 ksys_write+0x12f/0x260 fs/read_write.c:643
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xd5/0x260 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x6d/0x75
RIP: 0033:0x7f2e4ea7de69
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f2e4f7ab0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f2e4ebabf80 RCX: 00007f2e4ea7de69
RDX: 0000000000000012 RSI: 0000000020000380 RDI: 0000000000000004
RBP: 00007f2e4eaca47a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f2e4ebabf80 R15: 00007ffd0de416f8
 </TASK>
------------[ cut here ]------------
DEBUG_LOCKS_WARN_ON(!irqs_disabled())
WARNING: CPU: 1 PID: 5775 at kernel/locking/lockdep.c:150 lockdep_unlock+0x1c1/0x290 kernel/locking/lockdep.c:150
Modules linked in:
CPU: 1 PID: 5775 Comm: syz-executor.1 Not tainted 6.8.0-syzkaller-08951-gfe46a7dd189e #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024
RIP: 0010:lockdep_unlock+0x1c1/0x290 kernel/locking/lockdep.c:150
Code: d0 7c 08 84 d2 0f 85 cc 00 00 00 8b 35 8c d2 33 0e 85 f6 75 19 90 48 c7 c6 e0 c7 0c 8b 48 c7 c7 60 c7 0c 8b e8 10 4e e5 ff 90 <0f> 0b 90 90 90 e9 80 fe ff ff 90 0f 0b 90 e8 0c b6 0a 03 85 c0 74
RSP: 0018:ffffc9000329f940 EFLAGS: 00010282
RAX: 0000000000000000 RBX: ffffffff9469aaa0 RCX: ffffc9000996a000
RDX: 0000000000040000 RSI: ffffffff8150f3f6 RDI: 0000000000000001
RBP: 0000000000000002 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000001 R12: ffff888020288000
R13: ffffffff9400a9b8 R14: ffff888020288b28 R15: 0000000000000001
FS:  00007f2e4f7ab6c0(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f2e4eada5b2 CR3: 0000000062612000 CR4: 0000000000350ef0
Call Trace:
 <TASK>
 graph_unlock kernel/locking/lockdep.c:186 [inline]
 validate_chain kernel/locking/lockdep.c:3873 [inline]
 __lock_acquire+0x1fb0/0x3b30 kernel/locking/lockdep.c:5137
 lock_acquire kernel/locking/lockdep.c:5754 [inline]
 lock_acquire+0x1b1/0x540 kernel/locking/lockdep.c:5719
 __might_fault mm/memory.c:6080 [inline]
 __might_fault+0x11b/0x190 mm/memory.c:6073
 _copy_from_iter+0x1c4/0x1110 lib/iov_iter.c:259
 copy_from_iter include/linux/uio.h:204 [inline]
 kernfs_fop_write_iter+0x1a3/0x500 fs/kernfs/file.c:315
 call_write_iter include/linux/fs.h:2108 [inline]
 new_sync_write fs/read_write.c:497 [inline]
 vfs_write+0x6de/0x1100 fs/read_write.c:590
 ksys_write+0x12f/0x260 fs/read_write.c:643
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xd5/0x260 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x6d/0x75
RIP: 0033:0x7f2e4ea7de69
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f2e4f7ab0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f2e4ebabf80 RCX: 00007f2e4ea7de69
RDX: 0000000000000012 RSI: 0000000020000380 RDI: 0000000000000004
RBP: 00007f2e4eaca47a R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f2e4ebabf80 R15: 00007ffd0de416f8
 </TASK>

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/04/12 00:28 upstream fe46a7dd189e 478efa7f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root BUG: using __this_cpu_add() in preemptible code in kernfs_fop_write_iter
* Struck through repros no longer work on HEAD.