syzbot


BUG: corrupted list in kobject_add_internal (3)
Status: fixed on 2021/11/10 00:50
Reported-by: syzbot+66264bf2fd0476be7e6c@syzkaller.appspotmail.com
Fix commit: 92fe24a7db75 Bluetooth: skip invalid hci_sync_conn_complete_evt
First crash: 341d, last: 233d

Cause bisection: the issue happens on the oldest tested release (bisect log)
Crash: general protection fault in klist_next (log)
Repro: C syz .config
similar bugs (5):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream BUG: corrupted list in kobject_add_internal (2) 1 500d 496d 0/22 auto-closed as invalid on 2021/05/10 16:34
linux-4.19 BUG: corrupted list in kobject_add_internal C done 2 269d 516d 1/1 fixed on 2021/09/29 23:05
linux-4.19 BUG: corrupted list in kobject_add_internal (2) 1 232d 232d 0/1 auto-closed as invalid on 2022/02/03 08:56
linux-4.14 BUG: corrupted list in kobject_add_internal 1 569d 569d 0/1 auto-closed as invalid on 2021/03/02 15:06
upstream BUG: corrupted list in kobject_add_internal C done done 9 593d 656d 17/22 fixed on 2020/11/16 12:12
Patch testing requests:
Created Duration User Patch Repo Result
2021/08/04 04:45 18m desmondcheongzx@gmail.com patch git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master OK
2021/07/19 13:14 19m desmondcheongzx@gmail.com patch upstream OK
2021/07/19 11:14 0m desmondcheongzx@gmail.com patch upstream error
2021/06/24 12:58 10m desmondcheongzx@gmail.com patch upstream report log

Sample crash report:
list_add double add: new=ffff88802037a420, prev=ffff88802037a420, next=ffff8881400e1000.
------------[ cut here ]------------
kernel BUG at lib/list_debug.c:29!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 8479 Comm: kworker/u5:4 Not tainted 5.13.0-rc2-next-20210518-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: hci5 hci_rx_work
RIP: 0010:__list_add_valid.cold+0x26/0x3c lib/list_debug.c:29
Code: 68 f3 eb fa 4c 89 e1 48 c7 c7 e0 1c e3 89 e8 aa 88 f2 ff 0f 0b 48 89 f2 4c 89 e1 48 89 ee 48 c7 c7 20 1e e3 89 e8 93 88 f2 ff <0f> 0b 48 89 f1 48 c7 c7 a0 1d e3 89 4c 89 e6 e8 7f 88 f2 ff 0f 0b
RSP: 0018:ffffc9000181f7d8 EFLAGS: 00010286
RAX: 0000000000000058 RBX: ffff8881400e1000 RCX: 0000000000000000
RDX: ffff88801f295580 RSI: ffffffff815dbea5 RDI: fffff52000303eed
RBP: ffff88802037a420 R08: 0000000000000058 R09: 0000000000000000
R10: ffffffff815d5cee R11: 0000000000000000 R12: ffff8881400e1000
R13: ffff8880198b1340 R14: ffff88802037a438 R15: ffff88802037a420
FS:  0000000000000000(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000001f16748 CR3: 0000000027b36000 CR4: 00000000001506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 __list_add include/linux/list.h:67 [inline]
 list_add_tail include/linux/list.h:100 [inline]
 kobj_kset_join lib/kobject.c:196 [inline]
 kobject_add_internal+0x18d/0xa60 lib/kobject.c:246
 kobject_add_varg lib/kobject.c:390 [inline]
 kobject_add+0x150/0x1c0 lib/kobject.c:442
 device_add+0x36a/0x2100 drivers/base/core.c:3253
 hci_conn_add_sysfs+0x97/0x190 net/bluetooth/hci_sysfs.c:53
 hci_sync_conn_complete_evt.isra.0+0x54a/0x810 net/bluetooth/hci_event.c:4390
 hci_event_packet+0xf32/0x7c50 net/bluetooth/hci_event.c:6278
 hci_rx_work+0x4f8/0xd30 net/bluetooth/hci_core.c:5115
 process_one_work+0x98d/0x1600 kernel/workqueue.c:2275
 worker_thread+0x64c/0x1120 kernel/workqueue.c:2421
 kthread+0x3b1/0x4a0 kernel/kthread.c:313
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294
Modules linked in:
---[ end trace 47d0cc8ab1bc8524 ]---
RIP: 0010:__list_add_valid.cold+0x26/0x3c lib/list_debug.c:29
Code: 68 f3 eb fa 4c 89 e1 48 c7 c7 e0 1c e3 89 e8 aa 88 f2 ff 0f 0b 48 89 f2 4c 89 e1 48 89 ee 48 c7 c7 20 1e e3 89 e8 93 88 f2 ff <0f> 0b 48 89 f1 48 c7 c7 a0 1d e3 89 4c 89 e6 e8 7f 88 f2 ff 0f 0b
RSP: 0018:ffffc9000181f7d8 EFLAGS: 00010286
RAX: 0000000000000058 RBX: ffff8881400e1000 RCX: 0000000000000000
RDX: ffff88801f295580 RSI: ffffffff815dbea5 RDI: fffff52000303eed
RBP: ffff88802037a420 R08: 0000000000000058 R09: 0000000000000000
R10: ffffffff815d5cee R11: 0000000000000000 R12: ffff8881400e1000
R13: ffff8880198b1340 R14: ffff88802037a438 R15: ffff88802037a420
FS:  0000000000000000(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000001f16748 CR3: 000000000be8e000 CR4: 00000000001506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (3):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-linux-next-kasan-gce-root 2021/06/18 18:37 linux-next a1f92694393a aba2b2fb .config log report syz C BUG: corrupted list in kobject_add_internal
ci-upstream-kasan-gce-smack-root 2021/10/05 05:56 upstream 84b3e42564ac ce697b49 .config log report info BUG: corrupted list in kobject_add_internal
ci-upstream-linux-next-kasan-gce-root 2021/07/31 18:51 linux-next 8d4b477da1a8 6c236867 .config log report info BUG: corrupted list in kobject_add_internal