Bluetooth: hci0: ACL packet for unknown connection handle 0 Bluetooth: hci0: ACL packet for unknown connection handle 0 ================================================================== BUG: KASAN: use-after-free in __list_del_entry_valid+0xf2/0x110 lib/list_debug.c:59 Read of size 8 at addr ffff8880153c1068 by task kworker/u19:6/3728 CPU: 1 PID: 3728 Comm: kworker/u19:6 Not tainted 6.0.0-rc4-syzkaller-00302-gb96fbd602d35 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 Workqueue: hci0 hci_rx_work 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/0x6e9 mm/kasan/report.c:433 kasan_report+0xb1/0x1e0 mm/kasan/report.c:495 __list_del_entry_valid+0xf2/0x110 lib/list_debug.c:59 __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+0x243/0xc80 drivers/base/core.c:3683 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_disconn_complete_evt+0x833/0xeb0 net/bluetooth/hci_event.c:3417 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 Allocated by task 5178: 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+0xa6/0xd0 mm/kasan/common.c:525 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] bt_skb_alloc include/net/bluetooth/bluetooth.h:469 [inline] vhci_get_user drivers/bluetooth/hci_vhci.c:391 [inline] vhci_write+0xbd/0x460 drivers/bluetooth/hci_vhci.c:511 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:578 ksys_write+0x127/0x250 fs/read_write.c:631 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 The buggy address belongs to the object at ffff8880153c1000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 104 bytes inside of 512-byte region [ffff8880153c1000, ffff8880153c1200) The buggy address belongs to the physical page: page:ffffea000054f040 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x153c1 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea000079d388 ffffea00006e1048 ffff888011840600 raw: 0000000000000000 ffff8880153c1000 0000000100000004 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x2c20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_THISNODE), pid 3133, tgid 3133 (udevadm), ts 29468100484, free_ts 29467984114 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:5515 __alloc_pages_node include/linux/gfp.h:243 [inline] kmem_getpages mm/slab.c:1363 [inline] cache_grow_begin+0x75/0x360 mm/slab.c:2569 cache_alloc_refill+0x27f/0x380 mm/slab.c:2942 ____cache_alloc mm/slab.c:3018 [inline] ____cache_alloc mm/slab.c:3001 [inline] slab_alloc_node mm/slab.c:3220 [inline] kmem_cache_alloc_node_trace+0x50a/0x570 mm/slab.c:3601 __do_kmalloc_node mm/slab.c:3623 [inline] __kmalloc_node_track_caller+0x38/0x60 mm/slab.c:3638 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 bus_uevent_store+0x46/0x90 drivers/base/bus.c:763 bus_attr_store+0x72/0xa0 drivers/base/bus.c:122 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:578 ksys_write+0x127/0x250 fs/read_write.c:631 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 selinux_genfs_get_sid security/selinux/hooks.c:1303 [inline] inode_doinit_with_dentry+0x868/0x12e0 security/selinux/hooks.c:1498 selinux_d_instantiate+0x23/0x30 security/selinux/hooks.c:6327 security_d_instantiate+0x50/0xe0 security/security.c:2056 d_splice_alias+0x8c/0xc80 fs/dcache.c:3155 kernfs_iop_lookup+0x27f/0x320 fs/kernfs/dir.c:1168 lookup_open.isra.0+0x76a/0x12a0 fs/namei.c:3391 open_last_lookups fs/namei.c:3481 [inline] path_openat+0x996/0x28f0 fs/namei.c:3688 do_filp_open+0x1b6/0x400 fs/namei.c:3718 do_sys_openat2+0x16d/0x4c0 fs/open.c:1311 do_sys_open fs/open.c:1327 [inline] __do_sys_openat fs/open.c:1343 [inline] __se_sys_openat fs/open.c:1338 [inline] __x64_sys_openat+0x13f/0x1f0 fs/open.c:1338 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: ffff8880153c0f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880153c0f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880153c1000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff8880153c1080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880153c1100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================