================================================================== BUG: KASAN: use-after-free in __lock_acquire+0x78/0x1f80 kernel/locking/lockdep.c:4923 Read of size 8 at addr ffff888028c33130 by task syz-executor.3/17596 CPU: 0 PID: 17596 Comm: syz-executor.3 Not tainted 5.19.0-rc4-syzkaller-00044-g1a0e93df1e10 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/18/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:313 print_report+0xf4/0x210 mm/kasan/report.c:429 kasan_report+0xfb/0x130 mm/kasan/report.c:491 __lock_acquire+0x78/0x1f80 kernel/locking/lockdep.c:4923 lock_acquire+0x1a7/0x400 kernel/locking/lockdep.c:5665 lock_sock_nested+0x44/0xf0 net/core/sock.c:3389 lock_sock include/net/sock.h:1677 [inline] nr_accept+0x510/0x660 net/netrom/af_netrom.c:805 do_accept+0x4d0/0x6d0 net/socket.c:1856 __sys_accept4_file net/socket.c:1899 [inline] __sys_accept4+0x104/0x170 net/socket.c:1929 __do_sys_accept net/socket.c:1947 [inline] __se_sys_accept net/socket.c:1944 [inline] __x64_sys_accept+0x79/0x90 net/socket.c:1944 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 RIP: 0033:0x7fcdf0689109 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:00007fcdf170c168 EFLAGS: 00000246 ORIG_RAX: 000000000000002b RAX: ffffffffffffffda RBX: 00007fcdf079c100 RCX: 00007fcdf0689109 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 00007fcdf06e305d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffc7827bf8f R14: 00007fcdf170c300 R15: 0000000000022000 Allocated by task 17586: 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:4446 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 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:348 call_rcu+0x163/0x9c0 kernel/rcu/tree.c:3126 netlink_release+0x1310/0x1730 net/netlink/af_netlink.c:815 __sock_release net/socket.c:650 [inline] sock_release+0x7a/0x140 net/socket.c:678 crypto_netlink_exit+0x3c/0x60 crypto/crypto_user_base.c:492 ops_exit_list net/core/net_namespace.c:162 [inline] cleanup_net+0x758/0xc50 net/core/net_namespace.c:594 process_one_work+0x81c/0xd10 kernel/workqueue.c:2289 worker_thread+0xb14/0x1330 kernel/workqueue.c:2436 kthread+0x266/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xaf/0xc0 mm/kasan/generic.c:348 insert_work+0x54/0x3e0 kernel/workqueue.c:1358 __queue_work+0x969/0xc20 kernel/workqueue.c:1517 queue_work_on+0x137/0x240 kernel/workqueue.c:1545 queue_work include/linux/workqueue.h:502 [inline] afs_queue_server_manager fs/afs/server.c:603 [inline] afs_purge_servers+0x130/0x350 fs/afs/server.c:617 afs_net_exit+0x4f/0xa0 fs/afs/main.c:157 ops_exit_list net/core/net_namespace.c:162 [inline] cleanup_net+0x758/0xc50 net/core/net_namespace.c:594 process_one_work+0x81c/0xd10 kernel/workqueue.c:2289 worker_thread+0xb14/0x1330 kernel/workqueue.c:2436 kthread+0x266/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 The buggy address belongs to the object at ffff888028c33000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 304 bytes inside of 2048-byte region [ffff888028c33000, ffff888028c33800) The buggy address belongs to the physical page: page:ffffea0000a30c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888028c33000 pfn:0x28c30 head:ffffea0000a30c00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffff888011c40948 ffffea000077dc08 ffff888011c42000 raw: ffff888028c33000 0000000000080002 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 16522, tgid 16520 (syz-executor.4), ts 810669877338, free_ts 810656763114 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:1824 allocate_slab+0x5e/0x520 mm/slub.c:1969 new_slab mm/slub.c:2029 [inline] ___slab_alloc+0x42e/0xce0 mm/slub.c:3031 __slab_alloc mm/slub.c:3118 [inline] slab_alloc_node mm/slub.c:3209 [inline] slab_alloc mm/slub.c:3251 [inline] __kmalloc+0x2ba/0x370 mm/slub.c:4442 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 __netlink_create+0x68/0x220 net/netlink/af_netlink.c:647 __netlink_kernel_create+0x1cf/0x7b0 net/netlink/af_netlink.c:2045 netlink_kernel_create include/linux/netlink.h:62 [inline] nfnetlink_net_init+0xb4/0x130 net/netfilter/nfnetlink.c:708 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 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 do_slab_free mm/slub.c:3524 [inline] ___cache_free+0x118/0x1a0 mm/slub.c:3543 qlist_free_all+0x2b/0x70 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x169/0x180 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:446 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:750 [inline] slab_alloc_node mm/slub.c:3243 [inline] slab_alloc mm/slub.c:3251 [inline] __kmem_cache_alloc_lru mm/slub.c:3258 [inline] kmem_cache_alloc+0x199/0x2f0 mm/slub.c:3268 getname_flags+0xb8/0x4e0 fs/namei.c:139 do_sys_openat2+0xd2/0x500 fs/open.c:1272 do_sys_open fs/open.c:1294 [inline] __do_sys_openat fs/open.c:1310 [inline] __se_sys_openat fs/open.c:1305 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1305 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 Memory state around the buggy address: ffff888028c33000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888028c33080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888028c33100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888028c33180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888028c33200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================