[syzbot] BUG: corrupted list in kobj_kset_join

From: syzbot
Date: Thu Sep 15 2022 - 13:23:40 EST


Hello,

syzbot found the following issue on:

HEAD commit: a6b443748715 Merge branch 'for-next/core', remote-tracking..
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci
console output: https://syzkaller.appspot.com/x/log.txt?x=13644830880000
kernel config: https://syzkaller.appspot.com/x/.config?x=e79d82586727c5df
dashboard link: https://syzkaller.appspot.com/bug?extid=5a2d2b4a8ca80ad216a9
compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=179f4c37080000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13a180d5080000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/1436897f0dc0/disk-a6b44374.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/68c4de151fbb/vmlinux-a6b44374.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+5a2d2b4a8ca80ad216a9@xxxxxxxxxxxxxxxxxxxxxxxxx

list_add double add: new=ffff0000caf13540, prev=ffff0000caf13540, next=ffff0000c0368000.
------------[ cut here ]------------
kernel BUG at lib/list_debug.c:35!
Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
Modules linked in:
CPU: 1 PID: 44 Comm: kworker/u5:0 Not tainted 6.0.0-rc4-syzkaller-17255-ga6b443748715 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022
Workqueue: hci0 hci_rx_work
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : __list_add_valid+0x68/0xb8 lib/list_debug.c:33
lr : __list_add_valid+0x68/0xb8 lib/list_debug.c:33
sp : ffff80000f683a70
x29: ffff80000f683a70 x28: ffff80000c537f58 x27: ffff0000c91b9300
x26: ffff80000b95b3bc x25: 000000000000001c x24: 000000000000001c
x23: ffff0000caf13558 x22: ffff0000c0368000 x21: ffff0000caf13540
x20: ffff0000caf13540 x19: ffff0000caf13538 x18: 00000000000000c0
x17: 3034353331666163 x16: ffff80000db78658 x15: ffff0000c0d93500
x14: 0000000000000000 x13: 00000000ffffffff x12: ffff0000c0d93500
x11: ff808000081c1fa0 x10: 0000000000000000 x9 : 67eb532626346d00
x8 : 67eb532626346d00 x7 : ffff8000081965e0 x6 : 0000000000000000
x5 : 0000000000000080 x4 : 0000000000000001 x3 : 0000000000000000
x2 : ffff0001fefddcd0 x1 : 0000000000000001 x0 : 0000000000000058
Call trace:
__list_add_valid+0x68/0xb8 lib/list_debug.c:33
__list_add include/linux/list.h:69 [inline]
list_add_tail include/linux/list.h:102 [inline]
kobj_kset_join+0xd0/0x14c lib/kobject.c:164
kobject_add_internal+0x1b8/0x530 lib/kobject.c:214
kobject_add_varg lib/kobject.c:358 [inline]
kobject_add+0xb8/0x130 lib/kobject.c:410
device_add+0x248/0x958 drivers/base/core.c:3452
hci_conn_add_sysfs+0x4c/0xf4 net/bluetooth/hci_sysfs.c:53
hci_le_cis_estabilished_evt+0x180/0x21c net/bluetooth/hci_event.c:6799
hci_le_meta_evt+0x1e4/0x230 net/bluetooth/hci_event.c:7110
hci_event_func net/bluetooth/hci_event.c:7440 [inline]
hci_event_packet+0x4e0/0x60c net/bluetooth/hci_event.c:7495
hci_rx_work+0x1a4/0x2f4 net/bluetooth/hci_core.c:4007
process_one_work+0x2d8/0x504 kernel/workqueue.c:2289
worker_thread+0x340/0x610 kernel/workqueue.c:2436
kthread+0x12c/0x158 kernel/kthread.c:376
ret_from_fork+0x10/0x20
Code: 9001b4c0 911b6c00 aa0803e2 94a795bf (d4210000)
---[ end trace 0000000000000000 ]---


---
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@xxxxxxxxxxxxxxxx.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this issue, for details see:
https://goo.gl/tpsmEJ#testing-patches