================================================================== BUG: KASAN: use-after-free in __list_add_valid+0x93/0xa0 lib/list_debug.c:26 Read of size 8 at addr ffff88802a39c4c8 by task kworker/u5:5/8862 CPU: 1 PID: 8862 Comm: kworker/u5:5 Not tainted 5.12.0-rc5-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: hci5 hci_rx_work Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x93/0xc2 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:232 __kasan_report mm/kasan/report.c:399 [inline] kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:416 __list_add_valid+0x93/0xa0 lib/list_debug.c:26 __list_add include/linux/list.h:67 [inline] list_add_tail include/linux/list.h:100 [inline] add_tail lib/klist.c:104 [inline] klist_add_tail+0x5c/0x120 lib/klist.c:137 device_add+0xb1a/0x1ad0 drivers/base/core.c:3250 hci_conn_add_sysfs+0x88/0x150 net/bluetooth/hci_sysfs.c:53 hci_sync_conn_complete_evt.isra.0+0x4a2/0x730 net/bluetooth/hci_event.c:4356 hci_event_packet+0xcda/0x71b0 net/bluetooth/hci_event.c:6243 hci_rx_work+0x3db/0xba0 net/bluetooth/hci_core.c:5088 process_one_work+0x84c/0x13d0 kernel/workqueue.c:2275 worker_thread+0x598/0xf80 kernel/workqueue.c:2421 kthread+0x36f/0x450 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Allocated by task 8862: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:427 [inline] ____kasan_kmalloc mm/kasan/common.c:506 [inline] __kasan_kmalloc+0x7a/0x90 mm/kasan/common.c:515 kmalloc include/linux/slab.h:554 [inline] kzalloc include/linux/slab.h:684 [inline] device_private_init drivers/base/core.c:3084 [inline] device_add+0xc80/0x1ad0 drivers/base/core.c:3134 hci_conn_add_sysfs+0x88/0x150 net/bluetooth/hci_sysfs.c:53 hci_conn_complete_evt net/bluetooth/hci_event.c:2643 [inline] hci_event_packet+0x92c/0x71b0 net/bluetooth/hci_event.c:6153 hci_rx_work+0x3db/0xba0 net/bluetooth/hci_core.c:5088 process_one_work+0x84c/0x13d0 kernel/workqueue.c:2275 worker_thread+0x598/0xf80 kernel/workqueue.c:2421 kthread+0x36f/0x450 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Freed by task 8844: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:357 ____kasan_slab_free mm/kasan/common.c:360 [inline] ____kasan_slab_free mm/kasan/common.c:325 [inline] __kasan_slab_free+0xda/0x110 mm/kasan/common.c:367 kasan_slab_free include/linux/kasan.h:199 [inline] slab_free_hook mm/slub.c:1562 [inline] slab_free_freelist_hook+0x51/0x130 mm/slub.c:1600 slab_free mm/slub.c:3161 [inline] kfree+0xdb/0x3c0 mm/slub.c:4213 device_add+0x3c0/0x1ad0 drivers/base/core.c:3288 hci_conn_add_sysfs+0x88/0x150 net/bluetooth/hci_sysfs.c:53 hci_sync_conn_complete_evt.isra.0+0x4a2/0x730 net/bluetooth/hci_event.c:4356 hci_event_packet+0xcda/0x71b0 net/bluetooth/hci_event.c:6243 hci_rx_work+0x3db/0xba0 net/bluetooth/hci_core.c:5088 process_one_work+0x84c/0x13d0 kernel/workqueue.c:2275 worker_thread+0x598/0xf80 kernel/workqueue.c:2421 kthread+0x36f/0x450 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 The buggy address belongs to the object at ffff88802a39c400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 200 bytes inside of 512-byte region [ffff88802a39c400, ffff88802a39c600) The buggy address belongs to the page: page:00000000fb3d3144 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2a39c head:00000000fb3d3144 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff88800f041c80 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88802a39c380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802a39c400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802a39c480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802a39c500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802a39c580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================