================================================================== BUG: KASAN: use-after-free in __list_add_valid+0x66/0x100 lib/list_debug.c:30 Read of size 8 at addr ffff88807390d5c8 by task syz-executor.2/3822 CPU: 1 PID: 3822 Comm: syz-executor.2 Not tainted 6.0.0-syzkaller-07994-ge8bc52cb8df8 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 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:317 print_report+0x108/0x220 mm/kasan/report.c:433 kasan_report+0xfb/0x130 mm/kasan/report.c:495 __list_add_valid+0x66/0x100 lib/list_debug.c:30 __list_add include/linux/list.h:69 [inline] list_add_tail include/linux/list.h:102 [inline] register_shrinker_prepared mm/vmscan.c:684 [inline] __register_shrinker mm/vmscan.c:696 [inline] register_shrinker+0x147/0x290 mm/vmscan.c:722 nfsd4_init_leases_net+0x33c/0x4c0 fs/nfsd/nfs4state.c:4393 nfsd_init_net+0x76/0x190 fs/nfsd/nfsctl.c:1456 ops_init+0x313/0x430 net/core/net_namespace.c:134 setup_net+0x4bb/0xc10 net/core/net_namespace.c:325 copy_net_ns+0x359/0x5b0 net/core/net_namespace.c:471 create_new_namespaces+0x4db/0x8e0 kernel/nsproxy.c:110 copy_namespaces+0x333/0x390 kernel/nsproxy.c:178 copy_process+0x1a58/0x3f60 kernel/fork.c:2257 kernel_clone+0x22f/0x7a0 kernel/fork.c:2671 __do_sys_clone3 kernel/fork.c:2963 [inline] __se_sys_clone3+0x372/0x410 kernel/fork.c:2947 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+0x63/0xcd RIP: 0033:0x7faf2cc8a5a9 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007faf2de87038 EFLAGS: 00000246 ORIG_RAX: 00000000000001b3 RAX: ffffffffffffffda RBX: 00007faf2cdac120 RCX: 00007faf2cc8a5a9 RDX: 0000000000000000 RSI: 0000000000000058 RDI: 00007faf2de87050 RBP: 00007faf2cce5580 R08: 0000000000000000 R09: 0000000000000058 R10: 00007faf2de87050 R11: 0000000000000246 R12: 0000000000000058 R13: 00007ffcb7f6a0af R14: 00007faf2de87300 R15: 0000000000022000 Allocated by task 3816: 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:437 [inline] ____kasan_kmalloc+0xdc/0x110 mm/kasan/common.c:516 kasan_kmalloc include/linux/kasan.h:234 [inline] __kmalloc+0x226/0x370 mm/slub.c:4429 kmalloc include/linux/slab.h:605 [inline] kzalloc include/linux/slab.h:733 [inline] ops_init+0x85/0x430 net/core/net_namespace.c:124 setup_net+0x4bb/0xc10 net/core/net_namespace.c:325 copy_net_ns+0x359/0x5b0 net/core/net_namespace.c:471 create_new_namespaces+0x4db/0x8e0 kernel/nsproxy.c:110 copy_namespaces+0x333/0x390 kernel/nsproxy.c:178 copy_process+0x1a58/0x3f60 kernel/fork.c:2257 kernel_clone+0x22f/0x7a0 kernel/fork.c:2671 __do_sys_clone3 kernel/fork.c:2963 [inline] __se_sys_clone3+0x372/0x410 kernel/fork.c:2947 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+0x63/0xcd Freed by task 3816: 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/0x120 mm/kasan/common.c:367 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1759 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1785 slab_free mm/slub.c:3539 [inline] kfree+0xda/0x210 mm/slub.c:4567 ops_init+0x333/0x430 net/core/net_namespace.c:139 setup_net+0x4bb/0xc10 net/core/net_namespace.c:325 copy_net_ns+0x359/0x5b0 net/core/net_namespace.c:471 create_new_namespaces+0x4db/0x8e0 kernel/nsproxy.c:110 copy_namespaces+0x333/0x390 kernel/nsproxy.c:178 copy_process+0x1a58/0x3f60 kernel/fork.c:2257 kernel_clone+0x22f/0x7a0 kernel/fork.c:2671 __do_sys_clone3 kernel/fork.c:2963 [inline] __se_sys_clone3+0x372/0x410 kernel/fork.c:2947 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+0x63/0xcd The buggy address belongs to the object at ffff88807390d000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1480 bytes inside of 2048-byte region [ffff88807390d000, ffff88807390d800) The buggy address belongs to the physical page: page:ffffea0001ce4200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x73908 head:ffffea0001ce4200 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000001 ffff888012042000 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 3627, tgid 3627 (syz-executor.0), ts 69546044270, free_ts 27225577376 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x72b/0x7a0 mm/page_alloc.c:4283 __alloc_pages+0x259/0x560 mm/page_alloc.c:5549 alloc_slab_page+0x70/0xf0 mm/slub.c:1829 allocate_slab+0x5e/0x520 mm/slub.c:1974 new_slab mm/slub.c:2034 [inline] ___slab_alloc+0x42e/0xce0 mm/slub.c:3036 __slab_alloc mm/slub.c:3123 [inline] slab_alloc_node mm/slub.c:3214 [inline] slab_alloc mm/slub.c:3256 [inline] kmem_cache_alloc_trace+0x25f/0x310 mm/slub.c:3287 kmalloc include/linux/slab.h:600 [inline] rtnl_newlink+0xe6/0x2060 net/core/rtnetlink.c:3590 rtnetlink_rcv_msg+0x7b8/0xe90 net/core/rtnetlink.c:6091 netlink_rcv_skb+0x1f0/0x460 net/netlink/af_netlink.c:2540 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline] netlink_unicast+0x7e7/0x9c0 net/netlink/af_netlink.c:1345 netlink_sendmsg+0x9b3/0xcd0 net/netlink/af_netlink.c:1921 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg net/socket.c:734 [inline] __sys_sendto+0x46d/0x5f0 net/socket.c:2117 __do_sys_sendto net/socket.c:2129 [inline] __se_sys_sendto net/socket.c:2125 [inline] __x64_sys_sendto+0xda/0xf0 net/socket.c:2125 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+0x63/0xcd page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1449 [inline] free_pcp_prepare+0x812/0x900 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page+0x7d/0x630 mm/page_alloc.c:3476 __skb_frag_unref include/linux/skbuff.h:3383 [inline] skb_release_data+0x37a/0x6d0 net/core/skbuff.c:783 skb_release_all net/core/skbuff.c:854 [inline] napi_consume_skb+0x11c/0x1c0 net/core/skbuff.c:1111 skb_defer_free_flush net/core/dev.c:6642 [inline] net_rx_action+0x4fe/0x10b0 net/core/dev.c:6663 __do_softirq+0x277/0x75b kernel/softirq.c:571 Memory state around the buggy address: ffff88807390d480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807390d500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807390d580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807390d600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807390d680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================