================================================================== BUG: KASAN: use-after-free in h4_recv_buf+0x946/0xd50 drivers/bluetooth/hci_h4.c:199 Read of size 2 at addr ffff8880354fc8ea by task kworker/u4:1/10 CPU: 1 PID: 10 Comm: kworker/u4:1 Not tainted 5.14.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events_unbound flush_to_ldisc 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 h4_recv_buf+0x946/0xd50 drivers/bluetooth/hci_h4.c:199 h4_recv+0xf4/0x1b0 drivers/bluetooth/hci_h4.c:115 hci_uart_tty_receive+0x1d2/0x4a0 drivers/bluetooth/hci_ldisc.c:613 tty_ldisc_receive_buf+0x128/0x170 drivers/tty/tty_buffer.c:475 tty_port_default_receive_buf+0x6a/0x90 drivers/tty/tty_port.c:39 receive_buf drivers/tty/tty_buffer.c:491 [inline] flush_to_ldisc+0x2f2/0x510 drivers/tty/tty_buffer.c:543 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 10161: 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 2026: 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 ffff8880354fc8c0 which belongs to the cache skbuff_head_cache of size 232 The buggy address is located 42 bytes inside of 232-byte region [ffff8880354fc8c0, ffff8880354fc9a8) The buggy address belongs to the page: page:ffffea0000d53f00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x354fc flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001a83fc0 0000000600000006 ffff8881400d1b40 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 0x32a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_MEMALLOC), pid 0, ts 998698853909, free_ts 989992944525 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 __netdev_alloc_skb+0xf6/0x4b0 net/core/skbuff.c:493 netdev_alloc_skb include/linux/skbuff.h:2872 [inline] dev_alloc_skb include/linux/skbuff.h:2885 [inline] hsr_init_skb+0xd2/0x4e0 net/hsr/hsr_device.c:247 send_hsr_supervision_frame+0x11e/0x9f0 net/hsr/hsr_device.c:291 hsr_announce+0x134/0x2e0 net/hsr/hsr_device.c:382 call_timer_fn+0xf6/0x210 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1466 [inline] __run_timers+0x703/0x8f0 kernel/time/timer.c:1734 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1747 __do_softirq+0x372/0x783 kernel/softirq.c:558 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x21b/0x260 kernel/softirq.c:636 irq_exit_rcu+0x5/0x20 kernel/softirq.c:648 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_list+0x118/0xad0 mm/page_alloc.c:3448 release_pages+0x18bb/0x1af0 mm/swap.c:972 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:242 [inline] tlb_flush_mmu+0x780/0x910 mm/mmu_gather.c:249 tlb_finish_mmu+0xcb/0x200 mm/mmu_gather.c:340 exit_mmap+0x404/0x7a0 mm/mmap.c:3203 __mmput+0x111/0x370 kernel/fork.c:1101 exit_mm+0x60a/0x770 kernel/exit.c:501 do_exit+0x6ae/0x2510 kernel/exit.c:812 do_group_exit+0x168/0x2d0 kernel/exit.c:922 __do_sys_exit_group+0x13/0x20 kernel/exit.c:933 __ia32_sys_exit_group+0x0/0x40 kernel/exit.c:931 __x64_sys_exit_group+0x37/0x40 kernel/exit.c:931 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 Memory state around the buggy address: ffff8880354fc780: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880354fc800: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc >ffff8880354fc880: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ^ ffff8880354fc900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880354fc980: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc ==================================================================