================================================================== 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_fetch_add_relaxed include/linux/atomic/atomic-instrumented.h:252 [inline] BUG: KASAN: slab-use-after-free in __refcount_add include/linux/refcount.h:193 [inline] BUG: KASAN: slab-use-after-free in __refcount_inc include/linux/refcount.h:250 [inline] BUG: KASAN: slab-use-after-free in refcount_inc include/linux/refcount.h:267 [inline] BUG: KASAN: slab-use-after-free in sock_hold include/net/sock.h:777 [inline] BUG: KASAN: slab-use-after-free in sco_conn_del+0xb9/0x2d0 net/bluetooth/sco.c:195 Write of size 4 at addr ffff88801c2d2080 by task kworker/u5:5/5079 CPU: 1 PID: 5079 Comm: kworker/u5:5 Not tainted 6.6.0-rc4-syzkaller-00284-gb9ddbb0cde2a #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/2023 Workqueue: hci5 hci_cmd_sync_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 check_region_inline mm/kasan/generic.c:181 [inline] kasan_check_range+0xef/0x190 mm/kasan/generic.c:187 instrument_atomic_read_write include/linux/instrumented.h:96 [inline] atomic_fetch_add_relaxed include/linux/atomic/atomic-instrumented.h:252 [inline] __refcount_add include/linux/refcount.h:193 [inline] __refcount_inc include/linux/refcount.h:250 [inline] refcount_inc include/linux/refcount.h:267 [inline] sock_hold include/net/sock.h:777 [inline] sco_conn_del+0xb9/0x2d0 net/bluetooth/sco.c:195 sco_connect_cfm+0x205/0xb70 net/bluetooth/sco.c:1361 hci_connect_cfm include/net/bluetooth/hci_core.h:1935 [inline] hci_conn_failed+0x196/0x340 net/bluetooth/hci_conn.c:1251 hci_conn_cleanup_child net/bluetooth/hci_conn.c:1065 [inline] hci_conn_unlink+0x71b/0x9e0 net/bluetooth/hci_conn.c:1092 hci_conn_del+0x59/0xd80 net/bluetooth/hci_conn.c:1118 hci_abort_conn_sync+0xabf/0xe10 net/bluetooth/hci_sync.c:5431 abort_conn_sync+0x187/0x390 net/bluetooth/hci_conn.c:2901 hci_cmd_sync_work+0x1a4/0x410 net/bluetooth/hci_sync.c:306 process_one_work+0x884/0x15c0 kernel/workqueue.c:2630 process_scheduled_works kernel/workqueue.c:2703 [inline] worker_thread+0x8b9/0x1290 kernel/workqueue.c:2784 kthread+0x33c/0x440 kernel/kthread.c:388 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Allocated by task 9291: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:198 [inline] __do_kmalloc_node mm/slab_common.c:1023 [inline] __kmalloc+0x60/0x100 mm/slab_common.c:1036 kmalloc include/linux/slab.h:603 [inline] sk_prot_alloc+0x1a4/0x2a0 net/core/sock.c:2090 sk_alloc+0x3a/0x7f0 net/core/sock.c:2143 bt_sock_alloc+0x3b/0x3e0 net/bluetooth/af_bluetooth.c:148 sco_sock_alloc net/bluetooth/sco.c:495 [inline] sco_sock_create+0xe3/0x3b0 net/bluetooth/sco.c:526 bt_sock_create+0x180/0x340 net/bluetooth/af_bluetooth.c:132 __sock_create+0x328/0x800 net/socket.c:1569 sock_create net/socket.c:1620 [inline] __sys_socket_create net/socket.c:1657 [inline] __sys_socket+0x14c/0x260 net/socket.c:1708 __do_sys_socket net/socket.c:1722 [inline] __se_sys_socket net/socket.c:1720 [inline] __x64_sys_socket+0x72/0xb0 net/socket.c:1720 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 9293: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x15b/0x1b0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook+0x114/0x1e0 mm/slub.c:1826 slab_free mm/slub.c:3809 [inline] __kmem_cache_free+0xb8/0x2f0 mm/slub.c:3822 sk_prot_free net/core/sock.c:2126 [inline] __sk_destruct+0x5fc/0x770 net/core/sock.c:2218 sk_destruct+0xc2/0xf0 net/core/sock.c:2233 __sk_free+0xc4/0x3a0 net/core/sock.c:2244 sk_free+0x7c/0xa0 net/core/sock.c:2255 sock_put include/net/sock.h:1991 [inline] sco_sock_kill net/bluetooth/sco.c:426 [inline] sco_sock_kill+0x19d/0x1c0 net/bluetooth/sco.c:416 sco_sock_release+0x154/0x2c0 net/bluetooth/sco.c:1256 __sock_release+0xae/0x260 net/socket.c:659 sock_close+0x1c/0x20 net/socket.c:1419 __fput+0x3f7/0xa70 fs/file_table.c:384 task_work_run+0x14d/0x240 kernel/task_work.c:180 get_signal+0x106f/0x2790 kernel/signal.c:2668 arch_do_signal_or_restart+0x90/0x7f0 arch/x86/kernel/signal.c:309 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x1d/0x60 kernel/entry/common.c:296 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2653 netlink_release+0xe44/0x1f90 net/netlink/af_netlink.c:831 __sock_release+0xae/0x260 net/socket.c:659 sock_close+0x1c/0x20 net/socket.c:1419 __fput+0x3f7/0xa70 fs/file_table.c:384 __fput_sync+0x47/0x50 fs/file_table.c:465 __do_sys_close fs/open.c:1572 [inline] __se_sys_close fs/open.c:1557 [inline] __x64_sys_close+0x87/0xf0 fs/open.c:1557 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2653 netlink_release+0xe44/0x1f90 net/netlink/af_netlink.c:831 __sock_release+0xae/0x260 net/socket.c:659 sock_close+0x1c/0x20 net/socket.c:1419 __fput+0x3f7/0xa70 fs/file_table.c:384 __fput_sync+0x47/0x50 fs/file_table.c:465 __do_sys_close fs/open.c:1572 [inline] __se_sys_close fs/open.c:1557 [inline] __x64_sys_close+0x87/0xf0 fs/open.c:1557 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff88801c2d2000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 128 bytes inside of freed 2048-byte region [ffff88801c2d2000, ffff88801c2d2800) The buggy address belongs to the physical page: page:ffffea000070b400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1c2d0 head:ffffea000070b400 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff888012c42000 ffffea0000d89e00 dead000000000002 raw: 0000000000000000 0000000080080008 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5136, tgid 5136 (kworker/0:8), ts 282012305912, free_ts 281416686634 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0xee0/0x2f20 mm/page_alloc.c:3170 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4426 alloc_pages+0x1a9/0x270 mm/mempolicy.c:2297 alloc_slab_page mm/slub.c:1870 [inline] allocate_slab+0x251/0x380 mm/slub.c:2017 new_slab mm/slub.c:2070 [inline] ___slab_alloc+0x8c7/0x1580 mm/slub.c:3223 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3322 __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] __kmem_cache_alloc_node+0x131/0x340 mm/slub.c:3517 __do_kmalloc_node mm/slab_common.c:1022 [inline] __kmalloc_node_track_caller+0x50/0x100 mm/slab_common.c:1043 kmalloc_reserve+0xef/0x260 net/core/skbuff.c:581 __alloc_skb+0x12b/0x330 net/core/skbuff.c:650 alloc_skb include/linux/skbuff.h:1286 [inline] nlmsg_new include/net/netlink.h:999 [inline] inet6_ifinfo_notify+0x72/0x140 net/ipv6/addrconf.c:6095 addrconf_notify+0x84d/0x1920 net/ipv6/addrconf.c:3699 notifier_call_chain+0xb6/0x3b0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xb9/0x130 net/core/dev.c:1970 netdev_state_change net/core/dev.c:1352 [inline] netdev_state_change+0x111/0x140 net/core/dev.c:1345 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1136 [inline] free_unref_page_prepare+0x476/0xa40 mm/page_alloc.c:2312 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2405 __unfreeze_partials+0x21d/0x240 mm/slub.c:2655 qlink_free mm/kasan/quarantine.c:166 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x18e/0x1d0 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slub.c:3478 [inline] slab_alloc mm/slub.c:3486 [inline] __kmem_cache_alloc_lru mm/slub.c:3493 [inline] kmem_cache_alloc_lru+0x221/0x680 mm/slub.c:3509 __d_alloc+0x32/0xac0 fs/dcache.c:1768 d_alloc+0x4e/0x220 fs/dcache.c:1848 d_alloc_parallel+0xe9/0x12d0 fs/dcache.c:2637 __lookup_slow+0x194/0x450 fs/namei.c:1678 lookup_one_len+0x17d/0x1b0 fs/namei.c:2745 start_creating.part.0+0x12f/0x3a0 fs/debugfs/inode.c:374 start_creating fs/debugfs/inode.c:347 [inline] __debugfs_create_file+0xa9/0x6a0 fs/debugfs/inode.c:419 debugfs_hw_add+0x13a/0x360 net/mac80211/debugfs.c:655 ieee80211_register_hw+0x24f1/0x4250 net/mac80211/main.c:1396 Memory state around the buggy address: ffff88801c2d1f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801c2d2000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88801c2d2080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801c2d2100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801c2d2180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================