================================================================== BUG: KASAN: slab-out-of-bounds in unlink_file_vma+0x67/0x1b0 mm/mmap.c:162 Read of size 8 at addr ffff8881e26e3558 by task syz.5.535/2369 CPU: 1 PID: 2369 Comm: syz.5.535 Not tainted 5.4.290-syzkaller-00002-g41adfeb3d639 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 print_address_description+0x8c/0x600 mm/kasan/report.c:384 __kasan_report+0xf3/0x120 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 unlink_file_vma+0x67/0x1b0 mm/mmap.c:162 free_pgtables+0x135/0x280 mm/memory.c:428 exit_mmap+0x2cb/0x520 mm/mmap.c:3192 __mmput+0x8e/0x2c0 kernel/fork.c:1101 exit_mm kernel/exit.c:538 [inline] do_exit+0xc08/0x2bc0 kernel/exit.c:848 do_group_exit+0x138/0x300 kernel/exit.c:984 __do_sys_exit_group kernel/exit.c:995 [inline] __se_sys_exit_group kernel/exit.c:993 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:993 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 RIP: 0033:0x7f30d3e95169 Code: Bad RIP value. RSP: 002b:00007ffe39f28e78 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f30d3e95169 RDX: 0000000000000064 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007ffe39f28edc R08: 0000001239f28f6f R09: 00000000000927c0 R10: 000000000000015c R11: 0000000000000246 R12: 000000000000001a R13: 00000000000927c0 R14: 000000000001633c R15: 00007ffe39f28f30 Allocated by task 2375: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x171/0x210 mm/kasan/common.c:529 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc_node mm/slub.c:2829 [inline] slab_alloc mm/slub.c:2837 [inline] kmem_cache_alloc+0xd9/0x250 mm/slub.c:2842 kmem_cache_zalloc include/linux/slab.h:680 [inline] net_alloc net/core/net_namespace.c:424 [inline] copy_net_ns+0x135/0x510 net/core/net_namespace.c:476 create_new_namespaces+0x47a/0x570 kernel/nsproxy.c:103 copy_namespaces+0x169/0x1b0 kernel/nsproxy.c:161 copy_process+0x12da/0x3230 kernel/fork.c:2055 _do_fork+0x197/0x900 kernel/fork.c:2399 __do_sys_clone kernel/fork.c:2557 [inline] __se_sys_clone kernel/fork.c:2538 [inline] __x64_sys_clone+0x26b/0x2c0 kernel/fork.c:2538 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Freed by task 0: (stack is not available) The buggy address belongs to the object at ffff8881e26e2400 which belongs to the cache net_namespace of size 4352 The buggy address is located 88 bytes to the right of 4352-byte region [ffff8881e26e2400, ffff8881e26e3500) The buggy address belongs to the page: page:ffffea000789b800 refcount:1 mapcount:0 mapping:ffff8881f5cfea00 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881f5cfea00 raw: 0000000000000000 0000000080070007 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) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x18f/0x370 mm/page_alloc.c:2171 get_page_from_freelist+0x2d13/0x2d90 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x393/0x840 mm/page_alloc.c:4893 alloc_slab_page+0x39/0x3c0 mm/slub.c:343 allocate_slab mm/slub.c:1683 [inline] new_slab+0x97/0x440 mm/slub.c:1749 new_slab_objects mm/slub.c:2505 [inline] ___slab_alloc+0x2fe/0x490 mm/slub.c:2667 __slab_alloc+0x62/0xa0 mm/slub.c:2707 slab_alloc_node mm/slub.c:2792 [inline] slab_alloc mm/slub.c:2837 [inline] kmem_cache_alloc+0x109/0x250 mm/slub.c:2842 kmem_cache_zalloc include/linux/slab.h:680 [inline] net_alloc net/core/net_namespace.c:424 [inline] copy_net_ns+0x135/0x510 net/core/net_namespace.c:476 create_new_namespaces+0x47a/0x570 kernel/nsproxy.c:103 copy_namespaces+0x169/0x1b0 kernel/nsproxy.c:161 copy_process+0x12da/0x3230 kernel/fork.c:2055 _do_fork+0x197/0x900 kernel/fork.c:2399 __do_sys_clone kernel/fork.c:2557 [inline] __se_sys_clone kernel/fork.c:2538 [inline] __x64_sys_clone+0x26b/0x2c0 kernel/fork.c:2538 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1176 [inline] __free_pages_ok+0x847/0x950 mm/page_alloc.c:1438 free_the_page mm/page_alloc.c:4955 [inline] __free_pages+0x91/0x140 mm/page_alloc.c:4961 __free_slab+0x221/0x2e0 mm/slub.c:1774 __slab_free+0x34b/0x360 mm/slub.c:3012 qlist_free_all+0x43/0xb0 mm/kasan/quarantine.c:167 quarantine_reduce+0x1d9/0x210 mm/kasan/quarantine.c:260 __kasan_kmalloc+0x41/0x210 mm/kasan/common.c:507 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc_node mm/slub.c:2829 [inline] slab_alloc mm/slub.c:2837 [inline] kmem_cache_alloc_trace+0xdc/0x260 mm/slub.c:2854 kmalloc include/linux/slab.h:556 [inline] kzalloc include/linux/slab.h:690 [inline] kset_create lib/kobject.c:985 [inline] kset_create_and_add+0x55/0x2a0 lib/kobject.c:1028 register_queue_kobjects net/core/net-sysfs.c:1624 [inline] netdev_register_kobject+0x1a0/0x310 net/core/net-sysfs.c:1858 register_netdevice+0xbc5/0x12a0 net/core/dev.c:9209 veth_newlink+0x835/0xb50 drivers/net/veth.c:1329 __rtnl_newlink net/core/rtnetlink.c:3255 [inline] rtnl_newlink+0x1567/0x2060 net/core/rtnetlink.c:3314 rtnetlink_rcv_msg+0x983/0xc70 net/core/rtnetlink.c:5290 netlink_rcv_skb+0x1d5/0x420 net/netlink/af_netlink.c:2467 netlink_unicast_kernel net/netlink/af_netlink.c:1306 [inline] netlink_unicast+0x936/0xb20 net/netlink/af_netlink.c:1332 Memory state around the buggy address: ffff8881e26e3400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881e26e3480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881e26e3500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8881e26e3580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881e26e3600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== BUG: kernel NULL pointer dereference, address: 0000000000000030 #PF: supervisor write access in kernel mode #PF: error_code(0x0002) - not-present page PGD 0 P4D 0 Oops: 0002 [#1] PREEMPT SMP KASAN CPU: 0 PID: 2369 Comm: syz.5.535 Tainted: G B 5.4.290-syzkaller-00002-g41adfeb3d639 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 RIP: 0010:arch_atomic64_try_cmpxchg arch/x86/include/asm/atomic64_64.h:186 [inline] RIP: 0010:atomic64_try_cmpxchg include/asm-generic/atomic-instrumented.h:1505 [inline] RIP: 0010:atomic_long_try_cmpxchg_acquire include/asm-generic/atomic-long.h:442 [inline] RIP: 0010:__down_write kernel/locking/rwsem.c:1424 [inline] RIP: 0010:down_write+0xb7/0x150 kernel/locking/rwsem.c:1583 Code: 0f 23 3d fd 4c 89 ff be 08 00 00 00 e8 02 23 3d fd 43 80 3c 26 00 74 08 4c 89 ff e8 83 4f 3d fd 48 8b 44 24 20 b9 01 00 00 00 48 0f b1 0b 75 61 48 83 c3 08 65 4c 8b 35 b6 a7 ab 7b 48 89 df RSP: 0018:ffff8881e402fa60 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000030 RCX: 0000000000000001 RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffff8881e402fa80 RBP: ffff8881e402fae8 R08: dffffc0000000000 R09: ffffed103c805f51 R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000 R13: 1ffff1103c805f4c R14: 1ffff1103c805f50 R15: ffff8881e402fa80 FS: 000055556969e500(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000030 CR3: 00000001f53e7000 CR4: 00000000003406b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600 Call Trace: i_mmap_lock_write include/linux/fs.h:551 [inline] unlink_file_vma+0x7c/0x1b0 mm/mmap.c:163 free_pgtables+0x135/0x280 mm/memory.c:428 exit_mmap+0x2cb/0x520 mm/mmap.c:3192 __mmput+0x8e/0x2c0 kernel/fork.c:1101 exit_mm kernel/exit.c:538 [inline] do_exit+0xc08/0x2bc0 kernel/exit.c:848 do_group_exit+0x138/0x300 kernel/exit.c:984 __do_sys_exit_group kernel/exit.c:995 [inline] __se_sys_exit_group kernel/exit.c:993 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:993 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 RIP: 0033:0x7f30d3e95169 Code: Bad RIP value. RSP: 002b:00007ffe39f28e78 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f30d3e95169 RDX: 0000000000000064 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 00007ffe39f28edc R08: 0000001239f28f6f R09: 00000000000927c0 R10: 000000000000015c R11: 0000000000000246 R12: 000000000000001a R13: 00000000000927c0 R14: 000000000001633c R15: 00007ffe39f28f30 Modules linked in: CR2: 0000000000000030 ---[ end trace f7872a4fbfaa3757 ]--- RIP: 0010:arch_atomic64_try_cmpxchg arch/x86/include/asm/atomic64_64.h:186 [inline] RIP: 0010:atomic64_try_cmpxchg include/asm-generic/atomic-instrumented.h:1505 [inline] RIP: 0010:atomic_long_try_cmpxchg_acquire include/asm-generic/atomic-long.h:442 [inline] RIP: 0010:__down_write kernel/locking/rwsem.c:1424 [inline] RIP: 0010:down_write+0xb7/0x150 kernel/locking/rwsem.c:1583 Code: 0f 23 3d fd 4c 89 ff be 08 00 00 00 e8 02 23 3d fd 43 80 3c 26 00 74 08 4c 89 ff e8 83 4f 3d fd 48 8b 44 24 20 b9 01 00 00 00 48 0f b1 0b 75 61 48 83 c3 08 65 4c 8b 35 b6 a7 ab 7b 48 89 df RSP: 0018:ffff8881e402fa60 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000030 RCX: 0000000000000001 RDX: 0000000000000001 RSI: 0000000000000008 RDI: ffff8881e402fa80 RBP: ffff8881e402fae8 R08: dffffc0000000000 R09: ffffed103c805f51 R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000 R13: 1ffff1103c805f4c R14: 1ffff1103c805f50 R15: ffff8881e402fa80 FS: 000055556969e500(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f30d3e9513f CR3: 00000001f53e7000 CR4: 00000000003406b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600 ---------------- Code disassembly (best guess): 0: 0f 23 3d mov %rbp,%db7 3: fd std 4: 4c 89 ff mov %r15,%rdi 7: be 08 00 00 00 mov $0x8,%esi c: e8 02 23 3d fd call 0xfd3d2313 11: 43 80 3c 26 00 cmpb $0x0,(%r14,%r12,1) 16: 74 08 je 0x20 18: 4c 89 ff mov %r15,%rdi 1b: e8 83 4f 3d fd call 0xfd3d4fa3 20: 48 8b 44 24 20 mov 0x20(%rsp),%rax 25: b9 01 00 00 00 mov $0x1,%ecx * 2a: f0 48 0f b1 0b lock cmpxchg %rcx,(%rbx) <-- trapping instruction 2f: 75 61 jne 0x92 31: 48 83 c3 08 add $0x8,%rbx 35: 65 4c 8b 35 b6 a7 ab mov %gs:0x7baba7b6(%rip),%r14 # 0x7baba7f3 3c: 7b 3d: 48 89 df mov %rbx,%rdi