================================================================== 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+0x63/0x240 net/bluetooth/sco.c:89 Write of size 4 at addr ffff88807725b080 by task kworker/0:2/141 CPU: 0 PID: 141 Comm: kworker/0:2 Tainted: G W 5.17.0-syzkaller-09727-g34af78c4e616 #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+0x1dc/0x2d8 lib/dump_stack.c:106 print_address_description+0x64/0x400 mm/kasan/report.c:247 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x19a/0x1f0 mm/kasan/report.c:451 kasan_check_range+0x2b5/0x2f0 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+0x63/0x240 net/bluetooth/sco.c:89 process_one_work+0x83c/0x11a0 kernel/workqueue.c:2289 worker_thread+0xa6c/0x1290 kernel/workqueue.c:2436 kthread+0x2a3/0x2d0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 Allocated by task 5457: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] ____kasan_kmalloc+0xdc/0x110 mm/kasan/common.c:515 kasan_kmalloc include/linux/kasan.h:249 [inline] __kmalloc+0x253/0x380 mm/slub.c:4414 kmalloc include/linux/slab.h:586 [inline] kzalloc include/linux/slab.h:714 [inline] __register_sysctl_table+0xbf/0x12a0 fs/proc/proc_sysctl.c:1335 __devinet_sysctl_register+0x267/0x350 net/ipv4/devinet.c:2588 devinet_sysctl_register+0x139/0x1a0 net/ipv4/devinet.c:2628 inetdev_init+0x28f/0x4c0 net/ipv4/devinet.c:279 inetdev_event+0x1c5/0x1410 net/ipv4/devinet.c:1536 notifier_call_chain kernel/notifier.c:84 [inline] raw_notifier_call_chain+0xe7/0x170 kernel/notifier.c:392 call_netdevice_notifiers_info net/core/dev.c:1938 [inline] call_netdevice_notifiers_extack net/core/dev.c:1976 [inline] call_netdevice_notifiers net/core/dev.c:1990 [inline] register_netdevice+0x1620/0x1c20 net/core/dev.c:9984 __ip_tunnel_create+0x2af/0x370 net/ipv4/ip_tunnel.c:267 ip_tunnel_init_net+0x249/0x720 net/ipv4/ip_tunnel.c:1070 vti_init_net+0x2a/0xf0 net/ipv4/ip_vti.c:504 ops_init+0x313/0x430 net/core/net_namespace.c:134 setup_net+0x4bb/0xc10 net/core/net_namespace.c:325 copy_net_ns+0x359/0x5c0 net/core/net_namespace.c:471 create_new_namespaces+0x4ce/0xa00 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x11e/0x180 kernel/nsproxy.c:226 ksys_unshare+0x57d/0xb50 kernel/fork.c:3129 __do_sys_unshare kernel/fork.c:3200 [inline] __se_sys_unshare kernel/fork.c:3198 [inline] __x64_sys_unshare+0x34/0x40 kernel/fork.c:3198 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:348 kvfree_call_rcu+0x119/0x880 kernel/rcu/tree.c:3595 drop_sysctl_table+0x2cd/0x400 fs/proc/proc_sysctl.c:1705 unregister_sysctl_table+0x86/0x130 fs/proc/proc_sysctl.c:1743 __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+0x71d/0x1410 net/ipv4/devinet.c:1604 notifier_call_chain kernel/notifier.c:84 [inline] raw_notifier_call_chain+0xe7/0x170 kernel/notifier.c:392 call_netdevice_notifiers_info net/core/dev.c:1938 [inline] call_netdevice_notifiers_extack net/core/dev.c:1976 [inline] call_netdevice_notifiers net/core/dev.c:1990 [inline] unregister_netdevice_many+0xefe/0x1960 net/core/dev.c:10741 ip_tunnel_delete_nets+0x325/0x370 net/ipv4/ip_tunnel.c:1123 ops_exit_list net/core/net_namespace.c:167 [inline] setup_net+0x990/0xc10 net/core/net_namespace.c:348 copy_net_ns+0x359/0x5c0 net/core/net_namespace.c:471 create_new_namespaces+0x4ce/0xa00 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x11e/0x180 kernel/nsproxy.c:226 ksys_unshare+0x57d/0xb50 kernel/fork.c:3129 __do_sys_unshare kernel/fork.c:3200 [inline] __se_sys_unshare kernel/fork.c:3198 [inline] __x64_sys_unshare+0x34/0x40 kernel/fork.c:3198 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:348 call_rcu+0x163/0xa70 kernel/rcu/tree.c:3074 netlink_release+0x132f/0x17a0 net/netlink/af_netlink.c:815 __sock_release net/socket.c:650 [inline] sock_close+0xd8/0x260 net/socket.c:1318 __fput+0x3fc/0x870 fs/file_table.c:317 task_work_run+0x146/0x1c0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:190 [inline] exit_to_user_mode_prepare+0x1dd/0x200 kernel/entry/common.c:222 __syscall_exit_to_user_mode_work kernel/entry/common.c:304 [inline] syscall_exit_to_user_mode+0x2e/0x70 kernel/entry/common.c:315 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88807725b000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 128 bytes inside of 2048-byte region [ffff88807725b000, ffff88807725b800) The buggy address belongs to the page: page:ffffea0001dc9600 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88807725c000 pfn:0x77258 head:ffffea0001dc9600 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0000b63c08 ffffea0001f67e08 ffff888011442000 raw: ffff88807725c000 0000000000080004 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 3622, ts 123693665403, free_ts 108382671193 prep_new_page mm/page_alloc.c:2382 [inline] get_page_from_freelist+0x708/0xa80 mm/page_alloc.c:4123 __alloc_pages+0x255/0x580 mm/page_alloc.c:5349 alloc_slab_page+0x70/0xf0 mm/slub.c:1799 allocate_slab+0x5d/0x380 mm/slub.c:1944 new_slab mm/slub.c:2004 [inline] ___slab_alloc+0x40e/0xcc0 mm/slub.c:3005 __slab_alloc mm/slub.c:3092 [inline] slab_alloc_node mm/slub.c:3183 [inline] __kmalloc_node_track_caller+0x2df/0x400 mm/slub.c:4947 kmalloc_reserve net/core/skbuff.c:354 [inline] pskb_expand_head+0x111/0x1240 net/core/skbuff.c:1700 netlink_trim+0x17f/0x210 net/netlink/af_netlink.c:1301 netlink_broadcast+0x64/0x1170 net/netlink/af_netlink.c:1497 nlmsg_multicast include/net/netlink.h:1033 [inline] nlmsg_notify+0xf5/0x1b0 net/netlink/af_netlink.c:2539 rtnl_notify net/core/rtnetlink.c:730 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:3868 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:3883 [inline] rtnetlink_event+0x154/0x1b0 net/core/rtnetlink.c:6041 notifier_call_chain kernel/notifier.c:84 [inline] raw_notifier_call_chain+0xe7/0x170 kernel/notifier.c:392 call_netdevice_notifiers_info net/core/dev.c:1938 [inline] call_netdevice_notifiers_extack net/core/dev.c:1976 [inline] call_netdevice_notifiers net/core/dev.c:1990 [inline] dev_set_mac_address+0x31d/0x470 net/core/dev.c:8684 dev_set_mac_address_user+0x2d/0x50 net/core/dev.c:8698 do_setlink+0x7c2/0x4170 net/core/rtnetlink.c:2686 __rtnl_newlink net/core/rtnetlink.c:3416 [inline] rtnl_newlink+0x17b2/0x1d80 net/core/rtnetlink.c:3531 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1348 [inline] free_pcp_prepare+0xcbd/0xec0 mm/page_alloc.c:1400 free_unref_page_prepare mm/page_alloc.c:3269 [inline] free_unref_page+0x7d/0x580 mm/page_alloc.c:3364 skb_free_frag include/linux/skbuff.h:3135 [inline] skb_free_head net/core/skbuff.c:653 [inline] skb_release_data+0x4e5/0x610 net/core/skbuff.c:677 skb_release_all net/core/skbuff.c:742 [inline] __kfree_skb+0x56/0x1d0 net/core/skbuff.c:756 tcp_eat_recv_skb net/ipv4/tcp.c:1619 [inline] tcp_recvmsg_locked+0x177d/0x2d50 net/ipv4/tcp.c:2528 tcp_recvmsg+0x254/0x890 net/ipv4/tcp.c:2574 inet_recvmsg+0x156/0x270 net/ipv4/af_inet.c:850 sock_recvmsg_nosec net/socket.c:948 [inline] sock_recvmsg net/socket.c:966 [inline] sock_read_iter+0x3a7/0x4d0 net/socket.c:1039 call_read_iter include/linux/fs.h:2075 [inline] new_sync_read fs/read_write.c:401 [inline] vfs_read+0xacb/0xe20 fs/read_write.c:482 ksys_read+0x18f/0x2c0 fs/read_write.c:620 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x2b/0x70 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff88807725af80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807725b000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807725b080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807725b100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807725b180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================