syzbot


KCSAN: data-race in __list_add_valid / nfc_llcp_unregister_device

Status: auto-obsoleted due to no activity on 2023/08/14 01:42
Subsystems: net nfc
[Documentation on labels]
First crash: 672d, last: 672d

Sample crash report:
==================================================================
BUG: KCSAN: data-race in __list_add_valid / nfc_llcp_unregister_device

write to 0xffff8881369b6008 of 8 bytes by task 32524 on cpu 1:
 list_del include/linux/list.h:150 [inline]
 nfc_llcp_remove_local net/nfc/llcp_core.c:306 [inline]
 nfc_llcp_unregister_device+0xba/0x170 net/nfc/llcp_core.c:1646
 nfc_unregister_device+0xe6/0x130 net/nfc/core.c:1179
 nci_unregister_device+0x14c/0x160 net/nfc/nci/core.c:1303
 virtual_ncidev_close+0x30/0x50 drivers/nfc/virtual_ncidev.c:163
 __fput+0x303/0x600 fs/file_table.c:384
 ____fput+0x15/0x20 fs/file_table.c:412
 task_work_run+0x135/0x1a0 kernel/task_work.c:179
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 exit_to_user_mode_loop+0xd1/0xe0 kernel/entry/common.c:171
 exit_to_user_mode_prepare+0x6c/0xb0 kernel/entry/common.c:204
 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline]
 syscall_exit_to_user_mode+0x26/0x140 kernel/entry/common.c:297
 do_syscall_64+0x4d/0xc0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

read to 0xffff8881369b6008 of 8 bytes by task 32529 on cpu 0:
 __list_add_valid+0x25/0xb0 lib/list_debug.c:27
 __list_add include/linux/list.h:69 [inline]
 list_add include/linux/list.h:88 [inline]
 nfc_llcp_register_device+0x3d1/0x440 net/nfc/llcp_core.c:1639
 nfc_register_device+0x67/0x190 net/nfc/core.c:1124
 nci_register_device+0x4e6/0x570 net/nfc/nci/core.c:1257
 virtual_ncidev_open+0xdc/0x140 drivers/nfc/virtual_ncidev.c:148
 misc_open+0x203/0x240 drivers/char/misc.c:165
 chrdev_open+0x34f/0x3c0 fs/char_dev.c:414
 do_dentry_open+0x5cd/0xaf0 fs/open.c:914
 vfs_open+0x4a/0x50 fs/open.c:1048
 do_open fs/namei.c:3636 [inline]
 path_openat+0x17f2/0x1d10 fs/namei.c:3793
 do_filp_open+0xf6/0x200 fs/namei.c:3820
 do_sys_openat2+0xab/0x110 fs/open.c:1407
 do_sys_open fs/open.c:1422 [inline]
 __do_sys_openat fs/open.c:1438 [inline]
 __se_sys_openat fs/open.c:1433 [inline]
 __x64_sys_openat+0xf3/0x120 fs/open.c:1433
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

value changed: 0xffffffff85eb4f30 -> 0xdead000000000122

Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 32529 Comm: syz-executor.0 Not tainted 6.5.0-rc1-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023
==================================================================
list_add corruption. next->prev should be prev (ffffffff85eb4f30), but was dead000000000122. (next=ffff8881369b6000).
------------[ cut here ]------------
kernel BUG at lib/list_debug.c:29!
invalid opcode: 0000 [#1] PREEMPT SMP
CPU: 0 PID: 32529 Comm: syz-executor.0 Not tainted 6.5.0-rc1-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/03/2023
RIP: 0010:__list_add_valid+0x95/0xb0 lib/list_debug.c:27
Code: 4d 5c 85 e8 5d 1b 08 03 0f 0b 48 c7 c7 2d 4e 5c 85 e8 4f 1b 08 03 0f 0b 48 c7 c7 53 4e 5c 85 48 89 de 4c 89 f1 e8 3b 1b 08 03 <0f> 0b 48 c7 c7 a5 4e 5c 85 4c 89 f6 48 89 d9 e8 27 1b 08 03 0f 0b
RSP: 0018:ffffc9000d0ffa08 EFLAGS: 00010246
RAX: 0000000000000075 RBX: ffffffff85eb4f30 RCX: 9a84aabeb01afd00
RDX: ffffc9000630f000 RSI: 0000000000024533 RDI: 0000000000024534
RBP: 0000000000000000 R08: ffffffff811862fd R09: 0000000000000000
R10: 0001ffffffffffff R11: 0000000000000000 R12: ffff8881369b6000
R13: 0000000fffffffe0 R14: ffff8881369b6000 R15: ffff88817d493c00
FS:  00007efd5c3b9700(0000) GS:ffff888237c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f1a4b8163e7 CR3: 0000000137fa6000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000600
Call Trace:
 <TASK>
 __list_add include/linux/list.h:69 [inline]
 list_add include/linux/list.h:88 [inline]
 nfc_llcp_register_device+0x3d1/0x440 net/nfc/llcp_core.c:1639
 nfc_register_device+0x67/0x190 net/nfc/core.c:1124
 nci_register_device+0x4e6/0x570 net/nfc/nci/core.c:1257
 virtual_ncidev_open+0xdc/0x140 drivers/nfc/virtual_ncidev.c:148
 misc_open+0x203/0x240 drivers/char/misc.c:165
 chrdev_open+0x34f/0x3c0 fs/char_dev.c:414
 do_dentry_open+0x5cd/0xaf0 fs/open.c:914
 vfs_open+0x4a/0x50 fs/open.c:1048
 do_open fs/namei.c:3636 [inline]
 path_openat+0x17f2/0x1d10 fs/namei.c:3793
 do_filp_open+0xf6/0x200 fs/namei.c:3820
 do_sys_openat2+0xab/0x110 fs/open.c:1407
 do_sys_open fs/open.c:1422 [inline]
 __do_sys_openat fs/open.c:1438 [inline]
 __se_sys_openat fs/open.c:1433 [inline]
 __x64_sys_openat+0xf3/0x120 fs/open.c:1433
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7efd5d046389
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007efd5c3b9168 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007efd5d165f80 RCX: 00007efd5d046389
RDX: 0000000000000002 RSI: 0000000020000040 RDI: ffffffffffffff9c
RBP: 00007efd5d091493 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fffa0342c3f R14: 00007efd5c3b9300 R15: 0000000000022000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__list_add_valid+0x95/0xb0 lib/list_debug.c:27
Code: 4d 5c 85 e8 5d 1b 08 03 0f 0b 48 c7 c7 2d 4e 5c 85 e8 4f 1b 08 03 0f 0b 48 c7 c7 53 4e 5c 85 48 89 de 4c 89 f1 e8 3b 1b 08 03 <0f> 0b 48 c7 c7 a5 4e 5c 85 4c 89 f6 48 89 d9 e8 27 1b 08 03 0f 0b
RSP: 0018:ffffc9000d0ffa08 EFLAGS: 00010246
RAX: 0000000000000075 RBX: ffffffff85eb4f30 RCX: 9a84aabeb01afd00
RDX: ffffc9000630f000 RSI: 0000000000024533 RDI: 0000000000024534
RBP: 0000000000000000 R08: ffffffff811862fd R09: 0000000000000000
R10: 0001ffffffffffff R11: 0000000000000000 R12: ffff8881369b6000
R13: 0000000fffffffe0 R14: ffff8881369b6000 R15: ffff88817d493c00
FS:  00007efd5c3b9700(0000) GS:ffff888237c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f1a4b8163e7 CR3: 0000000137fa6000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000600

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/07/10 01:32 upstream 06c2afb862f9 668cb1fa .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-kcsan-gce KCSAN: data-race in __list_add_valid / nfc_llcp_unregister_device
* Struck through repros no longer work on HEAD.