================================================================== BUG: KASAN: slab-out-of-bounds in should_fault_in_pages fs/gfs2/file.c:784 [inline] BUG: KASAN: slab-out-of-bounds in gfs2_file_direct_write fs/gfs2/file.c:923 [inline] BUG: KASAN: slab-out-of-bounds in gfs2_file_write_iter+0x872/0xf10 fs/gfs2/file.c:1139 Read of size 8 at addr ffff888077c0bd00 by task syz-executor.1/6406 CPU: 1 PID: 6406 Comm: syz-executor.1 Not tainted 5.15.130-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 should_fault_in_pages fs/gfs2/file.c:784 [inline] gfs2_file_direct_write fs/gfs2/file.c:923 [inline] gfs2_file_write_iter+0x872/0xf10 fs/gfs2/file.c:1139 do_iter_readv_writev+0x594/0x7a0 do_iter_write+0x1ea/0x760 fs/read_write.c:855 iter_file_splice_write+0x806/0xfa0 fs/splice.c:689 do_splice_from fs/splice.c:767 [inline] direct_splice_actor+0xe3/0x1c0 fs/splice.c:936 splice_direct_to_actor+0x500/0xc10 fs/splice.c:891 do_splice_direct+0x285/0x3d0 fs/splice.c:979 do_sendfile+0x625/0xff0 fs/read_write.c:1249 __do_sys_sendfile64 fs/read_write.c:1317 [inline] __se_sys_sendfile64+0x178/0x1e0 fs/read_write.c:1303 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7fd44b53bae9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fd449abd0c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007fd44b65af80 RCX: 00007fd44b53bae9 RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000004 RBP: 00007fd44b58747a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000008800000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fd44b65af80 R15: 00007ffc98e3dec8 Allocated by task 6406: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc+0xba/0xf0 mm/kasan/common.c:513 kasan_kmalloc include/linux/kasan.h:264 [inline] __kmalloc+0x168/0x300 mm/slub.c:4407 kmalloc_array include/linux/slab.h:631 [inline] kcalloc include/linux/slab.h:660 [inline] iter_file_splice_write+0x27b/0xfa0 fs/splice.c:628 do_splice_from fs/splice.c:767 [inline] direct_splice_actor+0xe3/0x1c0 fs/splice.c:936 splice_direct_to_actor+0x500/0xc10 fs/splice.c:891 do_splice_direct+0x285/0x3d0 fs/splice.c:979 do_sendfile+0x625/0xff0 fs/read_write.c:1249 __do_sys_sendfile64 fs/read_write.c:1317 [inline] __se_sys_sendfile64+0x178/0x1e0 fs/read_write.c:1303 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb Last potentially related work creation: kasan_save_stack+0x36/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348 kvfree_call_rcu+0x118/0x8a0 kernel/rcu/tree.c:3583 drop_sysctl_table+0x317/0x460 fs/proc/proc_sysctl.c:1680 drop_sysctl_table+0x329/0x460 fs/proc/proc_sysctl.c:1683 unregister_sysctl_table+0x88/0x130 fs/proc/proc_sysctl.c:1718 sctp_sysctl_net_unregister+0x58/0x70 net/sctp/sysctl.c:617 ops_exit_list net/core/net_namespace.c:169 [inline] cleanup_net+0x6ce/0xb60 net/core/net_namespace.c:596 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457 kthread+0x3f6/0x4f0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 The buggy address belongs to the object at ffff888077c0bc00 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 0 bytes to the right of 256-byte region [ffff888077c0bc00, ffff888077c0bd00) The buggy address belongs to the page: page:ffffea0001df0280 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x77c0a head:ffffea0001df0280 order:1 compound_mapcount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea000224c100 0000000e0000000e ffff888011c41b40 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 6012, ts 420828531764, free_ts 407529600676 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159 __alloc_pages+0x272/0x700 mm/page_alloc.c:5421 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xbb/0x4b0 mm/slub.c:1975 ___slab_alloc+0x6f6/0xe10 mm/slub.c:3008 __slab_alloc mm/slub.c:3095 [inline] slab_alloc_node mm/slub.c:3186 [inline] slab_alloc mm/slub.c:3228 [inline] __kmalloc_track_caller+0x1c7/0x300 mm/slub.c:4925 kmemdup+0x21/0x50 mm/util.c:128 ip6_route_net_init+0x20d/0x7d0 net/ipv6/route.c:6506 ops_init+0x356/0x600 net/core/net_namespace.c:135 setup_net+0x358/0x9e0 net/core/net_namespace.c:329 copy_net_ns+0x395/0x5d0 net/core/net_namespace.c:473 create_new_namespaces+0x425/0x7a0 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x11e/0x170 kernel/nsproxy.c:226 ksys_unshare+0x580/0xb20 kernel/fork.c:3093 __do_sys_unshare kernel/fork.c:3167 [inline] __se_sys_unshare kernel/fork.c:3165 [inline] __x64_sys_unshare+0x34/0x40 kernel/fork.c:3165 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317 free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396 kasan_depopulate_vmalloc_pte+0x66/0x80 mm/kasan/shadow.c:375 apply_to_pte_range mm/memory.c:2545 [inline] apply_to_pmd_range mm/memory.c:2589 [inline] apply_to_pud_range mm/memory.c:2625 [inline] apply_to_p4d_range mm/memory.c:2661 [inline] __apply_to_page_range+0x9bf/0xcc0 mm/memory.c:2695 kasan_release_vmalloc+0x96/0xb0 mm/kasan/shadow.c:485 __purge_vmap_area_lazy+0x15ae/0x1740 mm/vmalloc.c:1704 _vm_unmap_aliases+0x453/0x4e0 mm/vmalloc.c:2107 change_page_attr_set_clr+0x308/0x1050 arch/x86/mm/pat/set_memory.c:1740 change_page_attr_clear arch/x86/mm/pat/set_memory.c:1797 [inline] set_memory_ro+0xa1/0xe0 arch/x86/mm/pat/set_memory.c:1943 bpf_jit_binary_lock_ro include/linux/filter.h:888 [inline] bpf_int_jit_compile+0xbf57/0xc6e0 arch/x86/net/bpf_jit_comp.c:2372 bpf_prog_select_runtime+0x6e2/0x9b0 kernel/bpf/core.c:1926 bpf_migrate_filter net/core/filter.c:1296 [inline] bpf_prepare_filter+0x10d0/0x13d0 net/core/filter.c:1344 bpf_prog_create_from_user+0x2a7/0x3d0 net/core/filter.c:1438 seccomp_prepare_filter kernel/seccomp.c:669 [inline] seccomp_prepare_user_filter kernel/seccomp.c:706 [inline] seccomp_set_mode_filter kernel/seccomp.c:1834 [inline] do_seccomp+0x8cf/0x1790 kernel/seccomp.c:1954 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb Memory state around the buggy address: ffff888077c0bc00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888077c0bc80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888077c0bd00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888077c0bd80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888077c0be00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================