Bluetooth: hci6: Received unexpected HCI Event 00000000 ================================================================== BUG: KASAN: use-after-free in __skb_unlink include/linux/skbuff.h:2090 [inline] BUG: KASAN: use-after-free in __skb_dequeue include/linux/skbuff.h:2109 [inline] BUG: KASAN: use-after-free in skb_dequeue+0x90/0x140 net/core/skbuff.c:3159 Read of size 8 at addr ffff88803423a280 by task kworker/u5:2/8454 CPU: 1 PID: 8454 Comm: kworker/u5:2 Not tainted 5.14.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: hci6 hci_rx_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1ae/0x29f lib/dump_stack.c:105 print_address_description+0x66/0x3b0 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report+0x163/0x210 mm/kasan/report.c:436 __skb_unlink include/linux/skbuff.h:2090 [inline] __skb_dequeue include/linux/skbuff.h:2109 [inline] skb_dequeue+0x90/0x140 net/core/skbuff.c:3159 hci_rx_work+0x2e0/0x410 net/bluetooth/hci_core.c:5084 process_one_work+0x833/0x10c0 kernel/workqueue.c:2276 worker_thread+0xac1/0x1320 kernel/workqueue.c:2422 kthread+0x453/0x480 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 11209: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] __kasan_slab_alloc+0x96/0xd0 mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook mm/slab.h:519 [inline] slab_alloc_node mm/slub.c:2959 [inline] kmem_cache_alloc_node+0x200/0x370 mm/slub.c:2995 __alloc_skb+0xd8/0x580 net/core/skbuff.c:414 alloc_skb include/linux/skbuff.h:1112 [inline] bt_skb_alloc include/net/bluetooth/bluetooth.h:389 [inline] h4_recv_buf+0x274/0xd50 drivers/bluetooth/hci_h4.c:181 h4_recv+0xf4/0x1b0 drivers/bluetooth/hci_h4.c:115 hci_uart_tty_receive+0x1d2/0x4a0 drivers/bluetooth/hci_ldisc.c:613 tiocsti drivers/tty/tty_io.c:2311 [inline] tty_ioctl+0xde5/0x1720 drivers/tty/tty_io.c:2719 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:1069 [inline] __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:1055 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 8454: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x3d/0x70 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0x109/0x150 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1628 [inline] slab_free_freelist_hook+0x1d8/0x290 mm/slub.c:1653 slab_free mm/slub.c:3213 [inline] kmem_cache_free+0x85/0x170 mm/slub.c:3229 hci_event_packet+0x1238/0x1bd0 net/bluetooth/hci_event.c:6400 hci_rx_work+0x229/0x410 net/bluetooth/hci_core.c:5120 process_one_work+0x833/0x10c0 kernel/workqueue.c:2276 worker_thread+0xac1/0x1320 kernel/workqueue.c:2422 kthread+0x453/0x480 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff88803423a280 which belongs to the cache skbuff_head_cache of size 232 The buggy address is located 0 bytes inside of 232-byte region [ffff88803423a280, ffff88803423a368) The buggy address belongs to the page: page:ffffea0000d08e80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x3423a flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 0000000000000000 0000000100000001 ffff8880165d6140 raw: 0000000000000000 00000000000c000c 00000001ffffffff 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 0x12a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY), pid 35, ts 18871259636, free_ts 18868274566 prep_new_page mm/page_alloc.c:2436 [inline] get_page_from_freelist+0x779/0xa30 mm/page_alloc.c:4169 __alloc_pages+0x26c/0x5f0 mm/page_alloc.c:5391 alloc_slab_page mm/slub.c:1691 [inline] allocate_slab+0xf1/0x540 mm/slub.c:1831 new_slab mm/slub.c:1894 [inline] new_slab_objects mm/slub.c:2640 [inline] ___slab_alloc+0x1cf/0x350 mm/slub.c:2803 __slab_alloc mm/slub.c:2843 [inline] slab_alloc_node mm/slub.c:2925 [inline] kmem_cache_alloc_node+0x2ca/0x370 mm/slub.c:2995 __alloc_skb+0xd8/0x580 net/core/skbuff.c:414 alloc_skb include/linux/skbuff.h:1112 [inline] nlmsg_new include/net/netlink.h:953 [inline] inet6_ifa_notify net/ipv6/addrconf.c:5436 [inline] __ipv6_ifa_notify+0x2d1/0x1310 net/ipv6/addrconf.c:6070 ipv6_ifa_notify net/ipv6/addrconf.c:6122 [inline] addrconf_dad_completed+0x16e/0xbe0 net/ipv6/addrconf.c:4157 addrconf_dad_work+0xfc8/0x1cf0 net/ipv6/addrconf.c:4105 process_one_work+0x833/0x10c0 kernel/workqueue.c:2276 worker_thread+0xac1/0x1320 kernel/workqueue.c:2422 kthread+0x453/0x480 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1346 [inline] free_pcp_prepare+0xc29/0xd20 mm/page_alloc.c:1397 free_unref_page_prepare mm/page_alloc.c:3332 [inline] free_unref_page+0x7e/0x550 mm/page_alloc.c:3411 __vunmap+0x926/0xa70 mm/vmalloc.c:2587 free_work+0x66/0x90 mm/vmalloc.c:82 process_one_work+0x833/0x10c0 kernel/workqueue.c:2276 worker_thread+0xac1/0x1320 kernel/workqueue.c:2422 kthread+0x453/0x480 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff88803423a180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88803423a200: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc >ffff88803423a280: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88803423a300: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc ffff88803423a380: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ==================================================================