================================================================== 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:723 [inline] BUG: KASAN: use-after-free in nr_release+0x5c/0x430 net/netrom/af_netrom.c:520 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:723 [inline] BUG: KASAN: use-after-free in nr_release+0x5c/0x430 net/netrom/af_netrom.c:520 Write of size 4 at addr ffff888020940080 by task syz-executor102/3706 CPU: 1 PID: 3706 Comm: syz-executor102 Not tainted 5.18.0-syzkaller-11817-g8171acb8bc9b #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+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description+0x65/0x4b0 mm/kasan/report.c:313 print_report+0xf4/0x210 mm/kasan/report.c:429 kasan_report+0xfb/0x130 mm/kasan/report.c:491 kasan_check_range+0x2a7/0x2e0 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:723 [inline] nr_release+0x5c/0x430 net/netrom/af_netrom.c:520 __sock_release net/socket.c:650 [inline] sock_close+0xd7/0x260 net/socket.c:1365 __fput+0x3b9/0x820 fs/file_table.c:317 task_work_run+0x146/0x1c0 kernel/task_work.c:177 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0x547/0x1ed0 kernel/exit.c:795 do_group_exit+0x23b/0x2f0 kernel/exit.c:925 get_signal+0x172f/0x1780 kernel/signal.c:2875 arch_do_signal_or_restart+0x8d/0x750 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop+0x74/0x160 kernel/entry/common.c:166 exit_to_user_mode_prepare+0xad/0x110 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x2e/0x60 kernel/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7fbc08ce77e9 Code: Unable to access opcode bytes at RIP 0x7fbc08ce77bf. RSP: 002b:00007ffce3955658 EFLAGS: 00000246 ORIG_RAX: 000000000000002b RAX: fffffffffffffe00 RBX: 0000000000000003 RCX: 00007fbc08ce77e9 RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000004 RBP: 0000000000000003 R08: 000000090000000d R09: 000000090000000d R10: 000000090000000d R11: 0000000000000246 R12: 00005555573fb2c0 R13: 0000000000000011 R14: 000000000000e635 R15: 00007ffce3955664 Allocated by task 3706: 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:234 [inline] __kmalloc+0x223/0x370 mm/slub.c:4417 kmalloc include/linux/slab.h:605 [inline] sk_prot_alloc+0xde/0x200 net/core/sock.c:1975 sk_alloc+0x36/0x340 net/core/sock.c:2028 nr_create+0x9d/0x500 net/netrom/af_netrom.c:433 __sock_create+0x3fd/0x850 net/socket.c:1515 sock_create net/socket.c:1566 [inline] __sys_socket_create net/socket.c:1603 [inline] __sys_socket+0x137/0x3a0 net/socket.c:1636 __do_sys_socket net/socket.c:1649 [inline] __se_sys_socket net/socket.c:1647 [inline] __x64_sys_socket+0x76/0x80 net/socket.c:1647 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+0x46/0xb0 Freed by task 3706: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0xd8/0x110 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1727 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1753 slab_free mm/slub.c:3507 [inline] kfree+0xc6/0x210 mm/slub.c:4555 sk_prot_free net/core/sock.c:2011 [inline] __sk_destruct+0x487/0x5d0 net/core/sock.c:2097 sock_put include/net/sock.h:1941 [inline] nr_release+0x227/0x430 net/netrom/af_netrom.c:554 __sock_release net/socket.c:650 [inline] sock_close+0xd7/0x260 net/socket.c:1365 __fput+0x3b9/0x820 fs/file_table.c:317 task_work_run+0x146/0x1c0 kernel/task_work.c:177 exit_task_work include/linux/task_work.h:38 [inline] do_exit+0x547/0x1ed0 kernel/exit.c:795 do_group_exit+0x23b/0x2f0 kernel/exit.c:925 get_signal+0x172f/0x1780 kernel/signal.c:2875 arch_do_signal_or_restart+0x8d/0x750 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop+0x74/0x160 kernel/entry/common.c:166 exit_to_user_mode_prepare+0xad/0x110 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x2e/0x60 kernel/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x46/0xb0 The buggy address belongs to the object at ffff888020940000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 128 bytes inside of 2048-byte region [ffff888020940000, ffff888020940800) The buggy address belongs to the physical page: page:ffffea0000825000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x20940 head:ffffea0000825000 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000001 ffff888011442000 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 0xd2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3610, tgid 3610 (syz-executor102), ts 52328001162, free_ts 52326354661 prep_new_page mm/page_alloc.c:2456 [inline] get_page_from_freelist+0x72b/0x7a0 mm/page_alloc.c:4198 __alloc_pages+0x259/0x560 mm/page_alloc.c:5426 alloc_slab_page+0x70/0xf0 mm/slub.c:1797 allocate_slab+0x5e/0x520 mm/slub.c:1942 new_slab mm/slub.c:2002 [inline] ___slab_alloc+0x41e/0xcd0 mm/slub.c:3002 __slab_alloc mm/slub.c:3089 [inline] slab_alloc_node mm/slub.c:3180 [inline] __kmalloc_node_track_caller+0x2bb/0x3f0 mm/slub.c:4950 kmalloc_reserve net/core/skbuff.c:354 [inline] pskb_expand_head+0x11f/0x1220 net/core/skbuff.c:1695 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+0xfa/0x1c0 net/netlink/af_netlink.c:2544 __dev_notify_flags+0xe8/0x5f0 net/core/dev.c:8565 dev_change_flags+0xe3/0x190 net/core/dev.c:8607 do_setlink+0xdb2/0x3f00 net/core/rtnetlink.c:2780 __rtnl_newlink net/core/rtnetlink.c:3546 [inline] rtnl_newlink+0x183e/0x2060 net/core/rtnetlink.c:3593 rtnetlink_rcv_msg+0x7c9/0xea0 net/core/rtnetlink.c:6089 netlink_rcv_skb+0x1f0/0x460 net/netlink/af_netlink.c:2501 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1371 [inline] free_pcp_prepare+0x812/0x900 mm/page_alloc.c:1421 free_unref_page_prepare mm/page_alloc.c:3343 [inline] free_unref_page+0x7d/0x390 mm/page_alloc.c:3438 page_to_skb+0x3fd/0xb10 drivers/net/virtio_net.c:519 receive_mergeable+0x34e/0x26c0 drivers/net/virtio_net.c:1084 receive_buf+0x152/0x1bd0 drivers/net/virtio_net.c:1223 virtnet_receive drivers/net/virtio_net.c:1518 [inline] virtnet_poll+0x60d/0x11e0 drivers/net/virtio_net.c:1627 __napi_poll+0xbe/0x4b0 net/core/dev.c:6486 napi_poll net/core/dev.c:6553 [inline] net_rx_action+0x76c/0x10b0 net/core/dev.c:6664 __do_softirq+0x382/0x793 kernel/softirq.c:571 Memory state around the buggy address: ffff88802093ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888020940000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888020940080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888020940100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888020940180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================