================================================================== BUG: KASAN: slab-use-after-free in hci_uart_write_work+0x81c/0x950 drivers/bluetooth/hci_ldisc.c:165 Read of size 4 at addr ffff8880262e4570 by task kworker/0:0/9 CPU: 0 UID: 0 PID: 9 Comm: kworker/0:0 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 04/01/2014 Workqueue: events hci_uart_write_work Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x156/0x4c9 mm/kasan/report.c:482 kasan_report+0xdf/0x1a0 mm/kasan/report.c:595 hci_uart_write_work+0x81c/0x950 drivers/bluetooth/hci_ldisc.c:165 process_one_work+0x9c2/0x1840 kernel/workqueue.c:3257 process_scheduled_works kernel/workqueue.c:3340 [inline] worker_thread+0x5da/0xe40 kernel/workqueue.c:3421 kthread+0x3b3/0x730 kernel/kthread.c:463 ret_from_fork+0x754/0xaf0 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 Allocated by task 5897: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 unpoison_slab_object mm/kasan/common.c:340 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:366 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4953 [inline] slab_alloc_node mm/slub.c:5263 [inline] kmem_cache_alloc_node_noprof+0x303/0x880 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/0xa90 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+0x4d9/0x950 drivers/bluetooth/hci_ldisc.c:161 process_one_work+0x9c2/0x1840 kernel/workqueue.c:3257 process_scheduled_works kernel/workqueue.c:3340 [inline] worker_thread+0x5da/0xe40 kernel/workqueue.c:3421 kthread+0x3b3/0x730 kernel/kthread.c:463 ret_from_fork+0x754/0xaf0 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 The buggy address belongs to the object at ffff8880262e4500 which belongs to the cache skbuff_head_cache of size 240 The buggy address is located 112 bytes inside of freed 240-byte region [ffff8880262e4500, ffff8880262e45f0) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x262e4 head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888020450801 ksm flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801c3fe8c0 ffffea0000a23200 dead000000000003 raw: 0000000000000000 0000000000190019 00000000f5000000 ffff888020450801 head: 00fff00000000040 ffff88801c3fe8c0 ffffea0000a23200 dead000000000003 head: 0000000000000000 0000000000190019 00000000f5000000 ffff888020450801 head: 00fff00000000001 ffffea000098b901 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 0x152820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 1235, tgid 1235 (kworker/u32:10), ts 2674822788724, free_ts 2646225065814 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1e1/0x250 mm/page_alloc.c:1884 prep_new_page mm/page_alloc.c:1892 [inline] get_page_from_freelist+0xe3d/0x2e10 mm/page_alloc.c:3945 __alloc_frozen_pages_noprof+0x26c/0x2410 mm/page_alloc.c:5240 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+0x2c4/0x440 mm/slub.c:3302 ___slab_alloc+0xda3/0x1ca0 mm/slub.c:4656 __slab_alloc.isra.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_node_noprof+0x51e/0x880 mm/slub.c:5315 __alloc_skb+0x156/0x410 net/core/skbuff.c:679 alloc_skb include/linux/skbuff.h:1383 [inline] nsim_dev_trap_skb_build drivers/net/netdevsim/dev.c:818 [inline] nsim_dev_trap_report drivers/net/netdevsim/dev.c:875 [inline] nsim_dev_trap_report_work+0x2af/0xd10 drivers/net/netdevsim/dev.c:921 process_one_work+0x9c2/0x1840 kernel/workqueue.c:3257 process_scheduled_works kernel/workqueue.c:3340 [inline] worker_thread+0x5da/0xe40 kernel/workqueue.c:3421 kthread+0x3b3/0x730 kernel/kthread.c:463 ret_from_fork+0x754/0xaf0 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:246 page last free pid 15725 tgid 15725 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1433 [inline] __free_frozen_pages+0x822/0x1130 mm/page_alloc.c:2973 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x47/0xe0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x1a0/0x1f0 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:350 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4953 [inline] slab_alloc_node mm/slub.c:5263 [inline] kmem_cache_alloc_noprof+0x2ad/0x780 mm/slub.c:5270 mt_alloc_one lib/maple_tree.c:174 [inline] mas_alloc_nodes+0x280/0x390 lib/maple_tree.c:1110 mas_preallocate+0x39c/0xf10 lib/maple_tree.c:5194 vma_iter_prealloc mm/vma.h:505 [inline] commit_merge+0x3e3/0xbd0 mm/vma.c:751 vma_expand+0x7c3/0xd50 mm/vma.c:1200 vma_merge_new_range+0x2ce/0xa30 mm/vma.c:1099 __mmap_region+0x85d/0x2820 mm/vma.c:2747 mmap_region+0x180/0x3e0 mm/vma.c:2830 do_mmap+0xc63/0x12f0 mm/mmap.c:558 vm_mmap_pgoff+0x29e/0x470 mm/util.c:581 ksys_mmap_pgoff+0x328/0x5b0 mm/mmap.c:604 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:89 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:82 [inline] __x64_sys_mmap+0x125/0x190 arch/x86/kernel/sys_x86_64.c:82 Memory state around the buggy address: ffff8880262e4400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880262e4480: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc >ffff8880262e4500: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880262e4580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ffff8880262e4600: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ==================================================================