================================================================== BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:101 [inline] BUG: KASAN: use-after-free in atomic_fetch_add_relaxed include/linux/atomic/atomic-instrumented.h:111 [inline] BUG: KASAN: use-after-free in __refcount_add include/linux/refcount.h:193 [inline] BUG: KASAN: use-after-free in __refcount_inc include/linux/refcount.h:250 [inline] BUG: KASAN: use-after-free in refcount_inc include/linux/refcount.h:267 [inline] BUG: KASAN: use-after-free in sock_hold include/net/sock.h:704 [inline] BUG: KASAN: use-after-free in sco_conn_del+0xc5/0x2b0 net/bluetooth/sco.c:193 Write of size 4 at addr ffff888082742080 by task syz-executor.5/9751 CPU: 1 PID: 9751 Comm: syz-executor.5 Not tainted 5.15.0-rc4-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x6c/0x309 mm/kasan/report.c:256 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 instrument_atomic_read_write include/linux/instrumented.h:101 [inline] atomic_fetch_add_relaxed include/linux/atomic/atomic-instrumented.h:111 [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:704 [inline] sco_conn_del+0xc5/0x2b0 net/bluetooth/sco.c:193 sco_disconn_cfm+0x71/0xb0 net/bluetooth/sco.c:1205 hci_disconn_cfm include/net/bluetooth/hci_core.h:1518 [inline] hci_conn_hash_flush+0x127/0x260 net/bluetooth/hci_conn.c:1608 hci_dev_do_close+0x57d/0x1130 net/bluetooth/hci_core.c:1793 hci_unregister_dev+0x1c0/0x5a0 net/bluetooth/hci_core.c:4029 vhci_release+0x70/0xe0 drivers/bluetooth/hci_vhci.c:340 __fput+0x288/0x9f0 fs/file_table.c:280 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0xbae/0x2a30 kernel/exit.c:825 do_group_exit+0x125/0x310 kernel/exit.c:922 get_signal+0x47f/0x2160 kernel/signal.c:2868 arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:865 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fae71d1f8d9 Code: Unable to access opcode bytes at RIP 0x7fae71d1f8af. RSP: 002b:00007fae6f296188 EFLAGS: 00000246 ORIG_RAX: 000000000000002a RAX: fffffffffffffffc RBX: 00007fae71e23f60 RCX: 00007fae71d1f8d9 RDX: 0000000000000008 RSI: 0000000020000000 RDI: 0000000000000004 RBP: 00007fae71d79cb4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffde245cc0f R14: 00007fae6f296300 R15: 0000000000022000 Allocated by task 9747: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] ____kasan_kmalloc mm/kasan/common.c:472 [inline] __kasan_kmalloc+0xa4/0xd0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:596 [inline] sk_prot_alloc+0x110/0x290 net/core/sock.c:1839 sk_alloc+0x30/0xa60 net/core/sock.c:1892 sco_sock_alloc.constprop.0+0x31/0x220 net/bluetooth/sco.c:491 sco_sock_create+0xd5/0x1b0 net/bluetooth/sco.c:526 bt_sock_create+0x17c/0x340 net/bluetooth/af_bluetooth.c:130 __sock_create+0x353/0x790 net/socket.c:1464 sock_create net/socket.c:1515 [inline] __sys_socket+0xef/0x200 net/socket.c:1557 __do_sys_socket net/socket.c:1566 [inline] __se_sys_socket net/socket.c:1564 [inline] __x64_sys_socket+0x6f/0xb0 net/socket.c:1564 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 9751: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:360 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xff/0x130 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1700 [inline] slab_free_freelist_hook+0x81/0x190 mm/slub.c:1725 slab_free mm/slub.c:3483 [inline] kfree+0xe4/0x530 mm/slub.c:4543 sk_prot_free net/core/sock.c:1875 [inline] __sk_destruct+0x6a8/0x900 net/core/sock.c:1961 sk_destruct+0xbd/0xe0 net/core/sock.c:1976 __sk_free+0xef/0x3d0 net/core/sock.c:1987 sk_free+0x78/0xa0 net/core/sock.c:1998 sock_put include/net/sock.h:1847 [inline] sco_sock_kill+0x18d/0x1b0 net/bluetooth/sco.c:412 sco_sock_release+0x155/0x2c0 net/bluetooth/sco.c:1090 __sock_release+0xcd/0x280 net/socket.c:649 sock_close+0x18/0x20 net/socket.c:1314 __fput+0x288/0x9f0 fs/file_table.c:280 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 get_signal+0x1b35/0x2160 kernel/signal.c:2641 arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:865 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae Last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0xe9/0x110 mm/kasan/generic.c:348 kvfree_call_rcu+0x74/0x990 kernel/rcu/tree.c:3552 drop_sysctl_table+0x3c0/0x4e0 fs/proc/proc_sysctl.c:1647 unregister_sysctl_table fs/proc/proc_sysctl.c:1685 [inline] unregister_sysctl_table+0xc2/0x190 fs/proc/proc_sysctl.c:1660 __addrconf_sysctl_unregister net/ipv6/addrconf.c:7045 [inline] addrconf_sysctl_unregister+0xee/0x1c0 net/ipv6/addrconf.c:7073 addrconf_notify+0x7fd/0x1bb0 net/ipv6/addrconf.c:3652 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1996 call_netdevice_notifiers_extack net/core/dev.c:2008 [inline] call_netdevice_notifiers net/core/dev.c:2022 [inline] dev_change_name+0x447/0x690 net/core/dev.c:1279 do_setlink+0x2bba/0x3970 net/core/rtnetlink.c:2699 __rtnl_newlink+0xde6/0x1750 net/core/rtnetlink.c:3391 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3506 rtnetlink_rcv_msg+0x413/0xb80 net/core/rtnetlink.c:5572 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2504 netlink_unicast_kernel net/netlink/af_netlink.c:1314 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1340 netlink_sendmsg+0x86d/0xdb0 net/netlink/af_netlink.c:1929 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:724 __sys_sendto+0x21c/0x320 net/socket.c:2036 __do_sys_sendto net/socket.c:2048 [inline] __se_sys_sendto net/socket.c:2044 [inline] __x64_sys_sendto+0xdd/0x1b0 net/socket.c:2044 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff888082742000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 128 bytes inside of 2048-byte region [ffff888082742000, ffff888082742800) The buggy address belongs to the page: page:ffffea000209d000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x82740 head:ffffea000209d000 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888010c42000 raw: 0000000000000000 0000000000080008 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 6540, ts 285841183977, free_ts 0 prep_new_page mm/page_alloc.c:2424 [inline] get_page_from_freelist+0xa72/0x2f80 mm/page_alloc.c:4153 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5375 alloc_pages+0x1a7/0x300 mm/mempolicy.c:2197 alloc_slab_page mm/slub.c:1763 [inline] allocate_slab mm/slub.c:1900 [inline] new_slab+0x319/0x490 mm/slub.c:1963 ___slab_alloc+0x921/0xfe0 mm/slub.c:2994 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3081 slab_alloc_node mm/slub.c:3172 [inline] slab_alloc mm/slub.c:3214 [inline] kmem_cache_alloc_trace+0x293/0x2b0 mm/slub.c:3231 kmalloc include/linux/slab.h:591 [inline] kzalloc include/linux/slab.h:721 [inline] ipv6_add_dev+0xd1/0x1170 net/ipv6/addrconf.c:383 addrconf_notify+0x60e/0x1bb0 net/ipv6/addrconf.c:3505 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1996 call_netdevice_notifiers_extack net/core/dev.c:2008 [inline] call_netdevice_notifiers net/core/dev.c:2022 [inline] register_netdevice+0x1075/0x1500 net/core/dev.c:10330 nsim_init_netdevsim drivers/net/netdevsim/netdev.c:317 [inline] nsim_create+0x3ce/0x530 drivers/net/netdevsim/netdev.c:365 __nsim_dev_port_add+0x32e/0x830 drivers/net/netdevsim/dev.c:1312 nsim_dev_port_add_all+0x53/0x150 drivers/net/netdevsim/dev.c:1372 nsim_dev_probe+0xcac/0x1180 drivers/net/netdevsim/dev.c:1513 page_owner free stack trace missing Memory state around the buggy address: ffff888082741f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888082742000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888082742080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888082742100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888082742180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================