================================================================== BUG: KASAN: slab-use-after-free in hci_uart_write_work+0x2ca/0x550 drivers/bluetooth/hci_ldisc.c:165 Read of size 8 at addr ffff88805101d358 by task kworker/0:0/9 CPU: 0 UID: 0 PID: 9 Comm: kworker/0:0 Not tainted syzkaller #0 PREEMPT(full) 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_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 hci_uart_write_work+0x2ca/0x550 drivers/bluetooth/hci_ldisc.c:165 process_one_work kernel/workqueue.c:3263 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3346 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3427 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x4bc/0x870 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 5954: kasan_save_stack mm/kasan/common.c:56 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:77 unpoison_slab_object mm/kasan/common.c:342 [inline] __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:368 kasan_slab_alloc include/linux/kasan.h:252 [inline] slab_post_alloc_hook mm/slub.c:4955 [inline] slab_alloc_node mm/slub.c:5265 [inline] kmem_cache_alloc_node_noprof+0x433/0x710 mm/slub.c:5317 __alloc_skb+0x112/0x2d0 net/core/skbuff.c:660 alloc_skb include/linux/skbuff.h:1383 [inline] h5_prepare_pkt+0x184/0x530 drivers/bluetooth/hci_h5.c:702 h5_dequeue+0x197/0x790 drivers/bluetooth/hci_h5.c:761 hci_uart_dequeue drivers/bluetooth/hci_ldisc.c:107 [inline] hci_uart_write_work+0x24a/0x550 drivers/bluetooth/hci_ldisc.c:161 process_one_work kernel/workqueue.c:3263 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3346 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3427 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x4bc/0x870 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff88805101d280 which belongs to the cache skbuff_head_cache of size 240 The buggy address is located 216 bytes inside of freed 240-byte region [ffff88805101d280, ffff88805101d370) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5101d anon flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000000 ffff88801bee0c80 0000000000000000 dead000000000001 raw: 0000000000000000 00000000000c000c 00000000f5000000 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 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 1041, tgid 1041 (kworker/u4:6), ts 169169994502, free_ts 169163103384 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1850 prep_new_page mm/page_alloc.c:1858 [inline] get_page_from_freelist+0x2365/0x2440 mm/page_alloc.c:3884 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5183 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:3039 [inline] allocate_slab+0x96/0x3a0 mm/slub.c:3212 new_slab mm/slub.c:3266 [inline] ___slab_alloc+0xe94/0x18a0 mm/slub.c:4636 __slab_alloc+0x65/0x100 mm/slub.c:4755 __slab_alloc_node mm/slub.c:4831 [inline] slab_alloc_node mm/slub.c:5253 [inline] kmem_cache_alloc_node_noprof+0x4c5/0x710 mm/slub.c:5317 __alloc_skb+0x112/0x2d0 net/core/skbuff.c:660 alloc_skb include/linux/skbuff.h:1383 [inline] nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:763 [inline] nsim_dev_trap_report drivers/net/netdevsim/dev.c:820 [inline] nsim_dev_trap_report_work+0x29a/0xb80 drivers/net/netdevsim/dev.c:866 process_one_work kernel/workqueue.c:3263 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3346 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3427 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x4bc/0x870 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 page last free pid 6091 tgid 6091 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1394 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2906 mm_free_pgd kernel/fork.c:541 [inline] __mmdrop+0xb5/0x570 kernel/fork.c:683 exit_mm+0x1da/0x2c0 kernel/exit.c:582 do_exit+0x648/0x2300 kernel/exit.c:954 do_group_exit+0x21c/0x2d0 kernel/exit.c:1107 __do_sys_exit_group kernel/exit.c:1118 [inline] __se_sys_exit_group kernel/exit.c:1116 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1116 x64_sys_call+0x21f7/0x2200 arch/x86/include/generated/asm/syscalls_64.h:232 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88805101d200: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc ffff88805101d280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88805101d300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ^ ffff88805101d380: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff88805101d400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================