================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_read_write include/linux/instrumented.h:96 [inline] BUG: KASAN: slab-use-after-free in atomic_dec_and_test include/linux/atomic/atomic-instrumented.h:1383 [inline] BUG: KASAN: slab-use-after-free in hci_conn_drop include/net/bluetooth/hci_core.h:1688 [inline] BUG: KASAN: slab-use-after-free in le_read_features_complete+0x5b/0x390 net/bluetooth/hci_sync.c:7344 Write of size 4 at addr ffff88802f6d8010 by task kworker/u33:0/1767 CPU: 2 UID: 0 PID: 1767 Comm: kworker/u33: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~bpo12+1 04/01/2014 Workqueue: hci1 hci_cmd_sync_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 check_region_inline mm/kasan/generic.c:194 [inline] kasan_check_range+0x100/0x1b0 mm/kasan/generic.c:200 instrument_atomic_read_write include/linux/instrumented.h:96 [inline] atomic_dec_and_test include/linux/atomic/atomic-instrumented.h:1383 [inline] hci_conn_drop include/net/bluetooth/hci_core.h:1688 [inline] le_read_features_complete+0x5b/0x390 net/bluetooth/hci_sync.c:7344 hci_cmd_sync_work+0x1ff/0x470 net/bluetooth/hci_sync.c:334 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 5951: kasan_save_stack+0x33/0x60 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 poison_kmalloc_redzone mm/kasan/common.c:398 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:415 kmalloc_noprof include/linux/slab.h:957 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] __hci_conn_add+0xf8/0x1cc0 net/bluetooth/hci_conn.c:963 hci_conn_add_unset+0x76/0x130 net/bluetooth/hci_conn.c:1084 le_conn_complete_evt+0x639/0x1fa0 net/bluetooth/hci_event.c:5714 hci_le_enh_conn_complete_evt+0x23d/0x3b0 net/bluetooth/hci_event.c:5861 hci_le_meta_evt+0x357/0x610 net/bluetooth/hci_event.c:7408 hci_event_func net/bluetooth/hci_event.c:7716 [inline] hci_event_packet+0x685/0x1210 net/bluetooth/hci_event.c:7773 hci_rx_work+0x2c9/0x1020 net/bluetooth/hci_core.c:4076 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 5951: kasan_save_stack+0x33/0x60 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2540 [inline] slab_free mm/slub.c:6670 [inline] kfree+0x2f8/0x6e0 mm/slub.c:6878 device_release+0xa4/0x240 drivers/base/core.c:2565 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1ef/0x6f0 lib/kobject.c:737 put_device drivers/base/core.c:3797 [inline] device_unregister+0x2f/0xe0 drivers/base/core.c:3920 hci_conn_del_sysfs+0xdd/0x1a0 net/bluetooth/hci_sysfs.c:79 hci_conn_cleanup net/bluetooth/hci_conn.c:173 [inline] hci_conn_del+0x680/0x11d0 net/bluetooth/hci_conn.c:1234 hci_disconn_complete_evt+0x410/0xa30 net/bluetooth/hci_event.c:3451 hci_event_func net/bluetooth/hci_event.c:7719 [inline] hci_event_packet+0xa39/0x1210 net/bluetooth/hci_event.c:7773 hci_rx_work+0x2c9/0x1020 net/bluetooth/hci_core.c:4076 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 The buggy address belongs to the object at ffff88802f6d8000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 16 bytes inside of freed 8192-byte region [ffff88802f6d8000, ffff88802f6da000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2f6d8 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801b443180 0000000000000000 dead000000000001 raw: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff88801b443180 0000000000000000 dead000000000001 head: 0000000000000000 0000000080020002 00000000f5000000 0000000000000000 head: 00fff00000000003 ffffea0000bdb601 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x528c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NORETRY|__GFP_COMP), pid 5945, tgid 5945 (syz-executor), ts 63575173133, free_ts 63485828870 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1af/0x220 mm/page_alloc.c:1857 prep_new_page mm/page_alloc.c:1865 [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] __do_kmalloc_node mm/slub.c:5656 [inline] __kvmalloc_node_noprof+0x592/0xa40 mm/slub.c:7136 kvmalloc_array_node_noprof include/linux/slab.h:1122 [inline] __ptr_ring_init_queue_alloc_noprof include/linux/ptr_ring.h:481 [inline] ptr_ring_init_noprof include/linux/ptr_ring.h:499 [inline] skb_array_init_noprof include/linux/skb_array.h:182 [inline] pfifo_fast_init+0x12a/0x3b0 net/sched/sch_generic.c:870 qdisc_create_dflt+0x125/0x460 net/sched/sch_generic.c:1015 attach_one_default_qdisc net/sched/sch_generic.c:1174 [inline] netdev_for_each_tx_queue include/linux/netdevice.h:2680 [inline] attach_default_qdiscs net/sched/sch_generic.c:1192 [inline] dev_activate+0x63f/0x12d0 net/sched/sch_generic.c:1251 __dev_open+0x4f1/0x960 net/core/dev.c:1692 __dev_change_flags+0x55d/0x6f0 net/core/dev.c:9736 netif_change_flags+0x8d/0x160 net/core/dev.c:9799 do_setlink.constprop.0+0xb53/0x4380 net/core/rtnetlink.c:3158 rtnl_changelink net/core/rtnetlink.c:3776 [inline] __rtnl_newlink net/core/rtnetlink.c:3935 [inline] rtnl_newlink+0x1376/0x1f50 net/core/rtnetlink.c:4072 page last free pid 5944 tgid 5944 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1406 [inline] __free_frozen_pages+0x7df/0x1170 mm/page_alloc.c:2943 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x4c/0xf0 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x195/0x1e0 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] __do_kmalloc_node mm/slub.c:5656 [inline] __kmalloc_noprof+0x2f6/0x910 mm/slub.c:5669 kmalloc_noprof include/linux/slab.h:961 [inline] kzalloc_noprof include/linux/slab.h:1094 [inline] new_dir fs/proc/proc_sysctl.c:966 [inline] get_subdir fs/proc/proc_sysctl.c:1010 [inline] sysctl_mkdir_p fs/proc/proc_sysctl.c:1320 [inline] __register_sysctl_table+0xea2/0x1900 fs/proc/proc_sysctl.c:1395 neigh_sysctl_register+0x31f/0x670 net/core/neighbour.c:3886 devinet_sysctl_register+0xb6/0x200 net/ipv4/devinet.c:2714 inetdev_init+0x2b8/0x580 net/ipv4/devinet.c:291 inetdev_event+0xc32/0x1870 net/ipv4/devinet.c:1590 notifier_call_chain+0xbc/0x3e0 kernel/notifier.c:85 call_netdevice_notifiers_info+0xbe/0x110 net/core/dev.c:2230 call_netdevice_notifiers_extack net/core/dev.c:2268 [inline] call_netdevice_notifiers net/core/dev.c:2282 [inline] register_netdevice+0x1792/0x21d0 net/core/dev.c:11431 macvlan_common_newlink+0x10e7/0x1a20 drivers/net/macvlan.c:1540 macvtap_newlink drivers/net/macvtap.c:108 [inline] macvtap_newlink+0x17a/0x240 drivers/net/macvtap.c:80 rtnl_newlink_create net/core/rtnetlink.c:3840 [inline] __rtnl_newlink net/core/rtnetlink.c:3957 [inline] rtnl_newlink+0xc19/0x1f50 net/core/rtnetlink.c:4072 Memory state around the buggy address: ffff88802f6d7f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88802f6d7f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88802f6d8000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802f6d8080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802f6d8100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================