================================================================== 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 ffff88805d51f5b0 by task kworker/2:4/9588 CPU: 2 UID: 0 PID: 9588 Comm: kworker/2:4 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 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+0x9cf/0x1b70 kernel/workqueue.c:3263 process_scheduled_works kernel/workqueue.c:3346 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3427 kthread+0x3c5/0x780 kernel/kthread.c:463 ret_from_fork+0x56a/0x730 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 5955: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:330 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:356 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4191 [inline] slab_alloc_node mm/slub.c:4240 [inline] kmem_cache_alloc_node_noprof+0x1d5/0x3b0 mm/slub.c:4292 __alloc_skb+0x2b2/0x380 net/core/skbuff.c:659 alloc_skb include/linux/skbuff.h:1336 [inline] bt_skb_alloc include/net/bluetooth/bluetooth.h:509 [inline] hci_cmd_sync_alloc+0x39/0x3a0 net/bluetooth/hci_sync.c:58 hci_cmd_sync_add net/bluetooth/hci_sync.c:99 [inline] __hci_cmd_sync_sk+0x157/0xc90 net/bluetooth/hci_sync.c:168 __hci_cmd_sync_status_sk net/bluetooth/hci_sync.c:263 [inline] __hci_cmd_sync_status net/bluetooth/hci_sync.c:287 [inline] hci_read_local_features_sync+0x2c/0x160 net/bluetooth/hci_sync.c:3701 hci_init_stage_sync net/bluetooth/hci_sync.c:3616 [inline] hci_init1_sync net/bluetooth/hci_sync.c:3748 [inline] hci_init_sync net/bluetooth/hci_sync.c:4860 [inline] hci_dev_init_sync net/bluetooth/hci_sync.c:5052 [inline] hci_dev_open_sync+0x16f6/0x2430 net/bluetooth/hci_sync.c:5130 hci_dev_do_open+0x2a/0x90 net/bluetooth/hci_core.c:430 hci_power_on+0x131/0x610 net/bluetooth/hci_core.c:959 process_one_work+0x9cf/0x1b70 kernel/workqueue.c:3263 process_scheduled_works kernel/workqueue.c:3346 [inline] worker_thread+0x6c8/0xf10 kernel/workqueue.c:3427 kthread+0x3c5/0x780 kernel/kthread.c:463 ret_from_fork+0x56a/0x730 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Freed by task 14494: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:243 [inline] __kasan_slab_free+0x60/0x70 mm/kasan/common.c:275 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2422 [inline] slab_free mm/slub.c:4695 [inline] kmem_cache_free+0x2d1/0x4d0 mm/slub.c:4797 kfree_skbmem+0x1a4/0x1f0 net/core/skbuff.c:1109 __kfree_skb net/core/skbuff.c:1166 [inline] sk_skb_reason_drop+0x136/0x1a0 net/core/skbuff.c:1203 kfree_skb_reason include/linux/skbuff.h:1275 [inline] kfree_skb include/linux/skbuff.h:1284 [inline] hci_uart_flush+0xa7/0x5b0 drivers/bluetooth/hci_ldisc.c:235 hci_uart_close+0x1c/0x80 drivers/bluetooth/hci_ldisc.c:268 hci_uart_tty_close+0xb0/0x2a0 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/0x1680 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+0x18b/0x210 fs/ioctl.c:583 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xcd/0x4e0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff88805d51f540 which belongs to the cache skbuff_head_cache of size 240 The buggy address is located 112 bytes inside of freed 240-byte region [ffff88805d51f540, ffff88805d51f630) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5d51e head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801eac68c0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000190019 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801eac68c0 dead000000000100 dead000000000122 head: 0000000000000000 0000000000190019 00000000f5000000 0000000000000000 head: 00fff00000000001 ffffea0001754781 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 12450, tgid 12448 (syz.8.1975), ts 200146139240, free_ts 198341884309 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1c0/0x230 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x132b/0x38e0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x261/0x23f0 mm/page_alloc.c:5148 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:2492 [inline] allocate_slab mm/slub.c:2660 [inline] new_slab+0x247/0x330 mm/slub.c:2714 ___slab_alloc+0xcf2/0x1750 mm/slub.c:3901 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3992 __slab_alloc_node mm/slub.c:4067 [inline] slab_alloc_node mm/slub.c:4228 [inline] kmem_cache_alloc_node_noprof+0xf5/0x3b0 mm/slub.c:4292 __alloc_skb+0x2b2/0x380 net/core/skbuff.c:659 alloc_skb include/linux/skbuff.h:1336 [inline] alloc_skb_with_frags+0xe0/0x860 net/core/skbuff.c:6665 sock_alloc_send_pskb+0x7f9/0x980 net/core/sock.c:2958 sock_alloc_send_skb include/net/sock.h:1849 [inline] __ip6_append_data+0x2a98/0x4750 net/ipv6/ip6_output.c:1665 ip6_append_data+0x1bd/0x4c0 net/ipv6/ip6_output.c:1860 icmp6_send+0x10da/0x2be0 net/ipv6/icmp.c:626 __icmpv6_send include/linux/icmpv6.h:28 [inline] icmpv6_send include/linux/icmpv6.h:49 [inline] ip6_link_failure+0x31/0x5a0 net/ipv6/route.c:2843 dst_link_failure include/net/dst.h:429 [inline] ip6_tnl_xmit+0x4f5/0x3b20 net/ipv6/ip6_tunnel.c:1285 page last free pid 28 tgid 28 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0x7d5/0x10f0 mm/page_alloc.c:2895 rcu_do_batch kernel/rcu/tree.c:2605 [inline] rcu_core+0x79c/0x1530 kernel/rcu/tree.c:2861 handle_softirqs+0x216/0x8e0 kernel/softirq.c:622 run_ksoftirqd kernel/softirq.c:1063 [inline] run_ksoftirqd+0x3a/0x60 kernel/softirq.c:1055 smpboot_thread_fn+0x3f4/0xae0 kernel/smpboot.c:160 kthread+0x3c5/0x780 kernel/kthread.c:463 ret_from_fork+0x56a/0x730 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff88805d51f480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ffff88805d51f500: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb >ffff88805d51f580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805d51f600: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc ffff88805d51f680: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================