================================================================== BUG: KASAN: use-after-free in __list_del_entry_valid+0xe8/0x110 lib/list_debug.c:62 Read of size 8 at addr ffff88801bc704d0 by task kworker/u5:8/3655 CPU: 1 PID: 3655 Comm: kworker/u5:8 Not tainted 6.0.0-rc7-syzkaller-00162-g5a77386984b5 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 Workqueue: hci5 hci_error_reset Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x2ba/0x719 mm/kasan/report.c:433 kasan_report+0xb1/0x1e0 mm/kasan/report.c:495 __list_del_entry_valid+0xe8/0x110 lib/list_debug.c:62 __list_del_entry include/linux/list.h:134 [inline] list_del include/linux/list.h:148 [inline] klist_release+0x66/0x480 lib/klist.c:189 kref_put include/linux/kref.h:65 [inline] klist_dec_and_del lib/klist.c:206 [inline] klist_put+0x151/0x1d0 lib/klist.c:217 device_del+0x46d/0xc80 drivers/base/core.c:3699 hci_conn_del_sysfs+0xdc/0x180 net/bluetooth/hci_sysfs.c:78 hci_conn_cleanup+0x315/0x7b0 net/bluetooth/hci_conn.c:147 hci_conn_del+0x29b/0x790 net/bluetooth/hci_conn.c:1022 hci_conn_hash_flush+0x197/0x260 net/bluetooth/hci_conn.c:2367 hci_dev_close_sync+0x55d/0x1130 net/bluetooth/hci_sync.c:4476 hci_dev_do_close+0x2d/0x70 net/bluetooth/hci_core.c:554 hci_error_reset+0x96/0x130 net/bluetooth/hci_core.c:1050 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Allocated by task 3650: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:437 [inline] ____kasan_kmalloc mm/kasan/common.c:516 [inline] ____kasan_kmalloc mm/kasan/common.c:475 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:525 kmalloc include/linux/slab.h:600 [inline] kzalloc include/linux/slab.h:733 [inline] device_private_init drivers/base/core.c:3361 [inline] device_add+0x1168/0x1e90 drivers/base/core.c:3411 hci_conn_add_sysfs+0x9b/0x1b0 net/bluetooth/hci_sysfs.c:53 hci_conn_complete_evt+0x323/0xe50 net/bluetooth/hci_event.c:3164 hci_event_func net/bluetooth/hci_event.c:7443 [inline] hci_event_packet+0x952/0xfd0 net/bluetooth/hci_event.c:7495 hci_rx_work+0xae7/0x1230 net/bluetooth/hci_core.c:4007 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Freed by task 3655: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:367 [inline] ____kasan_slab_free+0x166/0x1c0 mm/kasan/common.c:329 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1759 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1785 slab_free mm/slub.c:3539 [inline] kfree+0xe2/0x580 mm/slub.c:4567 device_add+0x453/0x1e90 drivers/base/core.c:3571 hci_conn_add_sysfs+0x9b/0x1b0 net/bluetooth/hci_sysfs.c:53 hci_le_cis_estabilished_evt+0x57c/0xae0 net/bluetooth/hci_event.c:6799 hci_le_meta_evt+0x2b8/0x510 net/bluetooth/hci_event.c:7110 hci_event_func net/bluetooth/hci_event.c:7440 [inline] hci_event_packet+0x63d/0xfd0 net/bluetooth/hci_event.c:7495 hci_rx_work+0xae7/0x1230 net/bluetooth/hci_core.c:4007 process_one_work+0x991/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 The buggy address belongs to the object at ffff88801bc70400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 208 bytes inside of 512-byte region [ffff88801bc70400, ffff88801bc70600) The buggy address belongs to the physical page: page:ffffea00006f1c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88801bc70000 pfn:0x1bc70 head:ffffea00006f1c00 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0001eb8408 ffffea0001e3d808 ffff888011841c80 raw: ffff88801bc70000 000000000010000a 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 2974, tgid 2974 (udevadm), ts 14970883192, free_ts 14951337529 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x109b/0x2ce0 mm/page_alloc.c:4283 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5549 alloc_pages+0x1a6/0x270 mm/mempolicy.c:2270 alloc_slab_page mm/slub.c:1829 [inline] allocate_slab+0x27e/0x3d0 mm/slub.c:1974 new_slab mm/slub.c:2034 [inline] ___slab_alloc+0x7f1/0xe10 mm/slub.c:3036 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3123 slab_alloc_node mm/slub.c:3214 [inline] __kmalloc_node_track_caller+0x2f1/0x390 mm/slub.c:4964 kmalloc_reserve net/core/skbuff.c:362 [inline] __alloc_skb+0xd9/0x2f0 net/core/skbuff.c:434 alloc_skb include/linux/skbuff.h:1257 [inline] alloc_uevent_skb+0x7b/0x210 lib/kobject_uevent.c:290 uevent_net_broadcast_untagged lib/kobject_uevent.c:326 [inline] kobject_uevent_net_broadcast lib/kobject_uevent.c:409 [inline] kobject_uevent_env+0xc2e/0x1640 lib/kobject_uevent.c:593 kobject_synth_uevent+0x701/0x850 lib/kobject_uevent.c:208 store_uevent+0x20/0x60 kernel/module/main.c:920 module_attr_store+0x50/0x80 kernel/params.c:919 sysfs_kf_write+0x110/0x160 fs/sysfs/file.c:136 kernfs_fop_write_iter+0x3f8/0x610 fs/kernfs/file.c:354 call_write_iter include/linux/fs.h:2187 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x9e9/0xdd0 fs/read_write.c:584 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1449 [inline] free_pcp_prepare+0x5e4/0xd20 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page+0x19/0x4d0 mm/page_alloc.c:3476 __unfreeze_partials+0x17c/0x1a0 mm/slub.c:2553 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0xa2/0xc0 mm/kasan/common.c:447 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:727 [inline] slab_alloc_node mm/slub.c:3248 [inline] slab_alloc mm/slub.c:3256 [inline] kmem_cache_alloc_trace+0x2c0/0x3e0 mm/slub.c:3287 kmalloc include/linux/slab.h:600 [inline] kernfs_get_open_node fs/kernfs/file.c:595 [inline] kernfs_fop_open+0xa5e/0xfd0 fs/kernfs/file.c:750 do_dentry_open+0x4a4/0x13a0 fs/open.c:880 do_open fs/namei.c:3557 [inline] path_openat+0x1c92/0x28f0 fs/namei.c:3691 do_filp_open+0x1b6/0x400 fs/namei.c:3718 do_sys_openat2+0x16d/0x4c0 fs/open.c:1313 do_sys_open fs/open.c:1329 [inline] __do_sys_openat fs/open.c:1345 [inline] __se_sys_openat fs/open.c:1340 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1340 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff88801bc70380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801bc70400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88801bc70480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801bc70500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801bc70580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================