================================================================== BUG: KASAN: slab-use-after-free in hci_uart_write_work+0x82d/0x960 drivers/bluetooth/hci_ldisc.c:165 Read of size 4 at addr ffff888130b56070 by task kworker/0:5/11262 CPU: 0 UID: 0 PID: 11262 Comm: kworker/0:5 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Workqueue: events hci_uart_write_work Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xcd/0x630 mm/kasan/report.c:482 kasan_report+0xe0/0x110 mm/kasan/report.c:595 hci_uart_write_work+0x82d/0x960 drivers/bluetooth/hci_ldisc.c:165 process_one_work+0x9ba/0x1b20 kernel/workqueue.c:3257 process_scheduled_works kernel/workqueue.c:3340 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3421 kthread+0x3c5/0x780 kernel/kthread.c:463 ret_from_fork+0x983/0xb10 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 Allocated by task 6012: kasan_save_stack+0x33/0x60 mm/kasan/common.c:56 kasan_save_track+0x14/0x30 mm/kasan/common.c:77 unpoison_slab_object mm/kasan/common.c:339 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:365 kasan_slab_alloc include/linux/kasan.h:252 [inline] slab_post_alloc_hook mm/slub.c:4953 [inline] slab_alloc_node mm/slub.c:5263 [inline] kmem_cache_alloc_node_noprof+0x298/0x800 mm/slub.c:5315 __alloc_skb+0x156/0x410 net/core/skbuff.c:679 alloc_skb include/linux/skbuff.h:1383 [inline] bcsp_prepare_pkt+0xe0/0xae0 drivers/bluetooth/hci_bcsp.c:218 bcsp_dequeue+0x237/0x4b0 drivers/bluetooth/hci_bcsp.c:308 hci_uart_dequeue drivers/bluetooth/hci_ldisc.c:107 [inline] hci_uart_write_work+0x4e3/0x960 drivers/bluetooth/hci_ldisc.c:161 process_one_work+0x9ba/0x1b20 kernel/workqueue.c:3257 process_scheduled_works kernel/workqueue.c:3340 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3421 kthread+0x3c5/0x780 kernel/kthread.c:463 ret_from_fork+0x983/0xb10 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 Freed by task 22192: kasan_save_stack+0x33/0x60 mm/kasan/common.c:56 kasan_save_track+0x14/0x30 mm/kasan/common.c:77 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:252 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:284 kasan_slab_free include/linux/kasan.h:234 [inline] slab_free_hook mm/slub.c:2540 [inline] slab_free mm/slub.c:6670 [inline] kmem_cache_free+0x2d8/0x770 mm/slub.c:6781 kfree_skbmem+0x1a4/0x1f0 net/core/skbuff.c:1130 __kfree_skb net/core/skbuff.c:1197 [inline] sk_skb_reason_drop+0x136/0x1a0 net/core/skbuff.c:1234 kfree_skb_reason include/linux/skbuff.h:1322 [inline] kfree_skb include/linux/skbuff.h:1331 [inline] hci_uart_flush+0xa7/0x5d0 drivers/bluetooth/hci_ldisc.c:235 hci_uart_close+0x1d/0xa0 drivers/bluetooth/hci_ldisc.c:268 hci_uart_tty_close+0xb0/0x2d0 drivers/bluetooth/hci_ldisc.c:545 tty_ldisc_close+0x114/0x1a0 drivers/tty/tty_ldisc.c:455 tty_ldisc_kill+0x8e/0x150 drivers/tty/tty_ldisc.c:613 tty_ldisc_hangup+0x365/0x730 drivers/tty/tty_ldisc.c:729 __tty_hangup.part.0+0x3fe/0x8c0 drivers/tty/tty_io.c:621 __tty_hangup drivers/tty/tty_io.c:688 [inline] tty_vhangup drivers/tty/tty_io.c:691 [inline] tty_vhangup drivers/tty/tty_io.c:688 [inline] tty_ioctl+0x1057/0x1650 drivers/tty/tty_io.c:2732 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:597 [inline] __se_sys_ioctl fs/ioctl.c:583 [inline] __x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888130b56000 which belongs to the cache skbuff_head_cache of size 240 The buggy address is located 112 bytes inside of freed 240-byte region [ffff888130b56000, ffff888130b560f0) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x130b56 head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 ksm flags: 0x57ff00000000040(head|node=1|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 057ff00000000040 ffff8881012ce8c0 ffffea00009a1700 0000000000000003 raw: 0000000000000000 0000000000190019 00000000f5000000 0000000000000000 head: 057ff00000000040 ffff8881012ce8c0 ffffea00009a1700 0000000000000003 head: 0000000000000000 0000000000190019 00000000f5000000 0000000000000000 head: 057ff00000000001 ffffea0004c2d581 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000002 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 849, tgid 849 (kworker/0:2), ts 422204219447, free_ts 400535878639 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1af/0x220 mm/page_alloc.c:1846 prep_new_page mm/page_alloc.c:1854 [inline] get_page_from_freelist+0xd0b/0x31a0 mm/page_alloc.c:3915 __alloc_frozen_pages_noprof+0x25f/0x2430 mm/page_alloc.c:5210 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2486 alloc_slab_page mm/slub.c:3075 [inline] allocate_slab mm/slub.c:3248 [inline] new_slab+0x2c3/0x430 mm/slub.c:3302 ___slab_alloc+0xe18/0x1c90 mm/slub.c:4656 __slab_alloc.constprop.0+0x63/0x110 mm/slub.c:4779 __slab_alloc_node mm/slub.c:4855 [inline] slab_alloc_node mm/slub.c:5251 [inline] kmem_cache_alloc_noprof+0x44d/0x770 mm/slub.c:5270 skb_clone+0x190/0x3f0 net/core/skbuff.c:2087 j1939_can_recv+0x15e/0xa50 net/can/j1939/main.c:50 deliver net/can/af_can.c:575 [inline] can_rcv_filter+0x2a4/0x900 net/can/af_can.c:609 can_receive+0x302/0x560 net/can/af_can.c:666 can_rcv+0x1e2/0x280 net/can/af_can.c:690 __netif_receive_skb_one_core+0x1b2/0x1e0 net/core/dev.c:6137 __netif_receive_skb+0x1d/0x160 net/core/dev.c:6250 process_backlog+0x4a2/0x1650 net/core/dev.c:6602 page last free pid 21207 tgid 21206 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] free_unref_folios+0xa22/0x1610 mm/page_alloc.c:3000 folios_put_refs+0x4be/0x750 mm/swap.c:1002 free_pages_and_swap_cache+0x245/0x4a0 mm/swap_state.c:355 __tlb_batch_free_encoded_pages+0xf9/0x290 mm/mmu_gather.c:136 tlb_batch_pages_flush mm/mmu_gather.c:149 [inline] tlb_flush_mmu_free mm/mmu_gather.c:397 [inline] tlb_flush_mmu+0xe9/0x5a0 mm/mmu_gather.c:404 zap_pte_range mm/memory.c:1893 [inline] zap_pmd_range mm/memory.c:1946 [inline] zap_pud_range mm/memory.c:1975 [inline] zap_p4d_range mm/memory.c:1996 [inline] unmap_page_range+0x1e64/0x43c0 mm/memory.c:2017 unmap_single_vma+0x153/0x240 mm/memory.c:2059 unmap_vmas+0x218/0x470 mm/memory.c:2101 exit_mmap+0x1b0/0xb60 mm/mmap.c:1277 __mmput+0x12a/0x410 kernel/fork.c:1173 mmput+0x62/0x70 kernel/fork.c:1196 exit_mm kernel/exit.c:581 [inline] do_exit+0x7d7/0x2bd0 kernel/exit.c:959 do_group_exit+0xd3/0x2a0 kernel/exit.c:1112 get_signal+0x2671/0x26d0 kernel/signal.c:3034 arch_do_signal_or_restart+0x8f/0x7e0 arch/x86/kernel/signal.c:337 __exit_to_user_mode_loop kernel/entry/common.c:41 [inline] exit_to_user_mode_loop+0x8c/0x540 kernel/entry/common.c:75 Memory state around the buggy address: ffff888130b55f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888130b55f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888130b56000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888130b56080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ffff888130b56100: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ==================================================================