================================================================== 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:726 [inline] BUG: KASAN: use-after-free in sco_sock_timeout+0x64/0x290 net/bluetooth/sco.c:89 Write of size 4 at addr ffff88804181f080 by task kworker/1:0/22 CPU: 1 PID: 22 Comm: kworker/1:0 Not tainted 5.17.0-rc6-next-20220301-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events sco_sock_timeout 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+0xb5/0x448 mm/kasan/report.c:247 __kasan_report mm/kasan/report.c:448 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:465 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:726 [inline] sco_sock_timeout+0x64/0x290 net/bluetooth/sco.c:89 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 4254: 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:589 [inline] sk_prot_alloc+0x110/0x290 net/core/sock.c:1936 sk_alloc+0x32/0xa80 net/core/sock.c:1989 __netlink_create+0x63/0x2f0 net/netlink/af_netlink.c:645 netlink_create+0x3ad/0x5e0 net/netlink/af_netlink.c:708 __sock_create+0x353/0x790 net/socket.c:1468 sock_create net/socket.c:1519 [inline] __sys_socket+0xef/0x200 net/socket.c:1561 __do_sys_socket net/socket.c:1570 [inline] __se_sys_socket net/socket.c:1568 [inline] __x64_sys_socket+0x6f/0xb0 net/socket.c:1568 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 4228: 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:200 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1754 slab_free mm/slub.c:3523 [inline] kfree+0xd6/0x4d0 mm/slub.c:4576 sk_prot_free net/core/sock.c:1972 [inline] __sk_destruct+0x5e5/0x710 net/core/sock.c:2058 sk_destruct+0x131/0x180 net/core/sock.c:2076 __sk_free+0xef/0x3d0 net/core/sock.c:2087 sk_free+0x78/0xa0 net/core/sock.c:2098 deferred_put_nlk_sk+0x151/0x2f0 net/netlink/af_netlink.c:743 rcu_do_batch kernel/rcu/tree.c:2563 [inline] rcu_core+0x7b1/0x1880 kernel/rcu/tree.c:2821 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 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+0x99/0x790 kernel/rcu/tree.c:3109 netlink_release+0xf08/0x1db0 net/netlink/af_netlink.c:813 __sock_release+0xcd/0x280 net/socket.c:650 sock_close+0x18/0x20 net/socket.c:1318 __fput+0x286/0x9f0 fs/file_table.c:317 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:176 [inline] exit_to_user_mode_prepare+0x27e/0x290 kernel/entry/common.c:208 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:301 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae 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 kvfree_call_rcu+0x74/0x990 kernel/rcu/tree.c:3630 drop_sysctl_table+0x3c0/0x4e0 fs/proc/proc_sysctl.c:1705 unregister_sysctl_table fs/proc/proc_sysctl.c:1743 [inline] unregister_sysctl_table+0xc0/0x190 fs/proc/proc_sysctl.c:1718 __devinet_sysctl_unregister net/ipv4/devinet.c:2611 [inline] devinet_sysctl_unregister net/ipv4/devinet.c:2639 [inline] inetdev_destroy net/ipv4/devinet.c:327 [inline] inetdev_event+0xcaf/0x15d0 net/ipv4/devinet.c:1604 notifier_call_chain+0xb5/0x200 kernel/notifier.c:84 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1939 call_netdevice_notifiers_extack net/core/dev.c:1951 [inline] call_netdevice_notifiers net/core/dev.c:1965 [inline] unregister_netdevice_many+0x921/0x1880 net/core/dev.c:10423 ip_tunnel_delete_nets+0x39f/0x5b0 net/ipv4/ip_tunnel.c:1123 ops_exit_list+0x125/0x170 net/core/net_namespace.c:167 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:594 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff88804181f000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 128 bytes inside of 2048-byte region [ffff88804181f000, ffff88804181f800) The buggy address belongs to the physical page: page:ffffea0001060600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x41818 head:ffffea0001060600 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000001 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 0xd28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3621, tgid 3621 (syz-executor.2), ts 162128566663, free_ts 161699661013 prep_new_page mm/page_alloc.c:2438 [inline] get_page_from_freelist+0xa7f/0x3ec0 mm/page_alloc.c:4179 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5397 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2268 alloc_slab_page mm/slub.c:1799 [inline] allocate_slab+0x26c/0x3c0 mm/slub.c:1944 new_slab mm/slub.c:2004 [inline] ___slab_alloc+0x8d0/0xf30 mm/slub.c:3018 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3105 slab_alloc_node mm/slub.c:3196 [inline] __kmalloc_node_track_caller+0x2cb/0x360 mm/slub.c:4971 kmalloc_reserve net/core/skbuff.c:354 [inline] pskb_expand_head+0x15e/0x1110 net/core/skbuff.c:1699 netlink_trim+0x1ea/0x240 net/netlink/af_netlink.c:1299 netlink_broadcast+0x5b/0xd50 net/netlink/af_netlink.c:1495 nlmsg_multicast include/net/netlink.h:1033 [inline] nlmsg_notify+0x8f/0x280 net/netlink/af_netlink.c:2537 rtnl_notify net/core/rtnetlink.c:730 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:3857 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:3872 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:3860 [inline] rtnetlink_event+0x193/0x1d0 net/core/rtnetlink.c:5649 notifier_call_chain+0xb5/0x200 kernel/notifier.c:84 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1939 __netdev_upper_dev_link+0x3fd/0x7f0 net/core/dev.c:7488 netdev_upper_dev_link+0x8a/0xc0 net/core/dev.c:7529 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1353 [inline] free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1403 free_unref_page_prepare mm/page_alloc.c:3325 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3420 __vunmap+0x8e8/0xe10 mm/vmalloc.c:2677 __vfree+0x3c/0xd0 mm/vmalloc.c:2725 vfree+0x5a/0x90 mm/vmalloc.c:2756 kcov_put kernel/kcov.c:411 [inline] kcov_put+0x26/0x40 kernel/kcov.c:407 kcov_close+0xc/0x10 kernel/kcov.c:504 __fput+0x286/0x9f0 fs/file_table.c:317 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0xafa/0x2a30 kernel/exit.c:792 do_group_exit+0xd2/0x2f0 kernel/exit.c:922 __do_sys_exit_group kernel/exit.c:933 [inline] __se_sys_exit_group kernel/exit.c:931 [inline] __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:931 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 Memory state around the buggy address: ffff88804181ef80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88804181f000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88804181f080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88804181f100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804181f180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================