================================================================== 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:116 [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:710 [inline] BUG: KASAN: use-after-free in sco_conn_del+0xbe/0x2c0 net/bluetooth/sco.c:193 Write of size 4 at addr ffff88802ba24080 by task syz-executor.5/4946 CPU: 1 PID: 4946 Comm: syz-executor.5 Not tainted 5.16.0-rc4-next-20211210-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+0xa5/0x3ed mm/kasan/report.c:255 __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:116 [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:710 [inline] sco_conn_del+0xbe/0x2c0 net/bluetooth/sco.c:193 sco_disconn_cfm+0x71/0xb0 net/bluetooth/sco.c:1374 hci_disconn_cfm include/net/bluetooth/hci_core.h:1550 [inline] hci_conn_hash_flush+0x127/0x260 net/bluetooth/hci_conn.c:1732 hci_dev_close_sync+0x567/0x1120 net/bluetooth/hci_sync.c:4083 hci_dev_do_close+0x32/0x70 net/bluetooth/hci_core.c:553 hci_unregister_dev+0x1d0/0x550 net/bluetooth/hci_core.c:2686 vhci_release+0x7c/0xf0 drivers/bluetooth/hci_vhci.c:566 __fput+0x286/0x9f0 fs/file_table.c:311 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0xc14/0x2c20 kernel/exit.c:832 do_group_exit+0x125/0x310 kernel/exit.c:929 get_signal+0x34c/0x28b0 kernel/signal.c:2859 arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:868 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:0x7f88b20cee99 Code: Unable to access opcode bytes at RIP 0x7f88b20cee6f. RSP: 002b:00007f88b0a44218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 00007f88b21e1f68 RCX: 00007f88b20cee99 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007f88b21e1f68 RBP: 00007f88b21e1f60 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f88b21e1f6c R13: 00007ffc2a6ac94f R14: 00007f88b0a44300 R15: 0000000000022000 Allocated by task 7099: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] ____kasan_kmalloc mm/kasan/common.c:474 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:524 kmalloc include/linux/slab.h:586 [inline] sk_prot_alloc+0x110/0x290 net/core/sock.c:1921 sk_alloc+0x30/0xa60 net/core/sock.c:1974 sco_sock_alloc.constprop.0+0x31/0x330 net/bluetooth/sco.c:483 sco_sock_create+0xd5/0x1b0 net/bluetooth/sco.c:522 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 7102: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free+0x166/0x1a0 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:236 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1754 slab_free mm/slub.c:3510 [inline] kfree+0xd0/0x4b0 mm/slub.c:4561 sk_prot_free net/core/sock.c:1957 [inline] __sk_destruct+0x5cd/0x6f0 net/core/sock.c:2043 sk_destruct+0xbd/0xe0 net/core/sock.c:2058 __sk_free+0xef/0x3d0 net/core/sock.c:2069 sk_free+0x78/0xa0 net/core/sock.c:2080 sock_put include/net/sock.h:1908 [inline] sco_sock_kill+0x18d/0x1b0 net/bluetooth/sco.c:403 sco_sock_release+0x155/0x2c0 net/bluetooth/sco.c:1259 __sock_release+0xcd/0x280 net/socket.c:649 sock_close+0x18/0x20 net/socket.c:1314 __fput+0x286/0x9f0 fs/file_table.c:311 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 get_signal+0x1b01/0x28b0 kernel/signal.c:2628 arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:868 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+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348 kvfree_call_rcu+0x74/0x990 kernel/rcu/tree.c:3594 drop_sysctl_table+0x3c0/0x4e0 fs/proc/proc_sysctl.c:1706 unregister_sysctl_table fs/proc/proc_sysctl.c:1744 [inline] unregister_sysctl_table+0xc0/0x190 fs/proc/proc_sysctl.c:1719 __devinet_sysctl_unregister net/ipv4/devinet.c:2604 [inline] devinet_sysctl_unregister net/ipv4/devinet.c:2632 [inline] inetdev_destroy net/ipv4/devinet.c:326 [inline] inetdev_event+0xcaf/0x15d0 net/ipv4/devinet.c:1600 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1919 call_netdevice_notifiers_extack net/core/dev.c:1931 [inline] call_netdevice_notifiers net/core/dev.c:1945 [inline] unregister_netdevice_many+0x964/0x1850 net/core/dev.c:10403 vti6_exit_batch_net+0x3a0/0x670 net/ipv6/ip6_vti.c:1188 ops_exit_list+0x10d/0x160 net/core/net_namespace.c:171 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:593 process_one_work+0x9ac/0x1680 kernel/workqueue.c:2307 worker_thread+0x652/0x11c0 kernel/workqueue.c:2454 kthread+0x405/0x4f0 kernel/kthread.c:345 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Second to last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:3029 [inline] call_rcu+0xb1/0x740 kernel/rcu/tree.c:3109 in6_dev_finish_destroy+0x16e/0x1f0 net/ipv6/addrconf_core.c:271 in6_dev_put include/net/addrconf.h:378 [inline] addrconf_ifdown.isra.0+0x1334/0x1630 net/ipv6/addrconf.c:3873 addrconf_notify+0xeb/0x1ba0 net/ipv6/addrconf.c:3651 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1919 call_netdevice_notifiers_extack net/core/dev.c:1931 [inline] call_netdevice_notifiers net/core/dev.c:1945 [inline] unregister_netdevice_many+0x964/0x1850 net/core/dev.c:10403 vti6_exit_batch_net+0x3a0/0x670 net/ipv6/ip6_vti.c:1188 ops_exit_list+0x10d/0x160 net/core/net_namespace.c:171 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:593 process_one_work+0x9ac/0x1680 kernel/workqueue.c:2307 worker_thread+0x652/0x11c0 kernel/workqueue.c:2454 kthread+0x405/0x4f0 kernel/kthread.c:345 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff88802ba24000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 128 bytes inside of 2048-byte region [ffff88802ba24000, ffff88802ba24800) The buggy address belongs to the page: page:ffffea0000ae8800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2ba20 head:ffffea0000ae8800 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0000b7d800 dead000000000002 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 3634, ts 194280108096, free_ts 0 prep_new_page mm/page_alloc.c:2433 [inline] get_page_from_freelist+0xa72/0x2f40 mm/page_alloc.c:4164 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5376 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2271 alloc_slab_page mm/slub.c:1799 [inline] allocate_slab mm/slub.c:1944 [inline] new_slab+0x28d/0x3a0 mm/slub.c:2004 ___slab_alloc+0x6be/0xd60 mm/slub.c:3019 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3106 slab_alloc_node mm/slub.c:3197 [inline] slab_alloc mm/slub.c:3239 [inline] __kmalloc+0x2fb/0x340 mm/slub.c:4419 kmalloc include/linux/slab.h:586 [inline] kzalloc include/linux/slab.h:715 [inline] __register_sysctl_table+0x112/0x1090 fs/proc/proc_sysctl.c:1336 __devinet_sysctl_register+0x156/0x280 net/ipv4/devinet.c:2581 devinet_sysctl_register net/ipv4/devinet.c:2621 [inline] devinet_sysctl_register+0x160/0x230 net/ipv4/devinet.c:2611 inetdev_init+0x286/0x580 net/ipv4/devinet.c:278 inetdev_event+0xa8a/0x15d0 net/ipv4/devinet.c:1532 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1919 call_netdevice_notifiers_extack net/core/dev.c:1931 [inline] call_netdevice_notifiers net/core/dev.c:1945 [inline] register_netdevice+0x1073/0x1500 net/core/dev.c:9687 veth_newlink+0x405/0xa80 drivers/net/veth.c:1688 page_owner free stack trace missing Memory state around the buggy address: ffff88802ba23f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802ba24000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802ba24080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802ba24100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802ba24180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================