================================================================== BUG: KASAN: slab-out-of-bounds in udf_find_entry+0x8a5/0x14f0 fs/udf/namei.c:253 Write of size 165 at addr ffff88807e16f85a by task syz-executor.5/16757 CPU: 0 PID: 16757 Comm: syz-executor.5 Not tainted 6.1.0-rc1-syzkaller-00249-g4da34b7d175d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1b1/0x28e lib/dump_stack.c:106 print_address_description+0x74/0x340 mm/kasan/report.c:284 print_report+0x107/0x1f0 mm/kasan/report.c:395 kasan_report+0xcd/0x100 mm/kasan/report.c:495 kasan_check_range+0x2a7/0x2e0 mm/kasan/generic.c:189 memcpy+0x3c/0x60 mm/kasan/shadow.c:66 udf_find_entry+0x8a5/0x14f0 fs/udf/namei.c:253 udf_lookup+0xef/0x340 fs/udf/namei.c:309 lookup_open fs/namei.c:3391 [inline] open_last_lookups fs/namei.c:3481 [inline] path_openat+0x10e6/0x2df0 fs/namei.c:3710 do_filp_open+0x264/0x4f0 fs/namei.c:3740 do_sys_openat2+0x124/0x4e0 fs/open.c:1310 do_sys_open fs/open.c:1326 [inline] __do_sys_openat fs/open.c:1342 [inline] __se_sys_openat fs/open.c:1337 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1337 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+0x63/0xcd RIP: 0033:0x7fdc8e88b5f9 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:00007fdc8fa83168 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007fdc8e9ac050 RCX: 00007fdc8e88b5f9 RDX: 000000000000275a RSI: 0000000020000140 RDI: ffffffffffffff9c RBP: 00007fdc8e8e67b0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffd3ea52f2f R14: 00007fdc8fa83300 R15: 0000000000022000 Allocated by task 16757: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x3d/0x60 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:371 [inline] __kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:380 kmalloc include/linux/slab.h:576 [inline] udf_find_entry+0x7b6/0x14f0 fs/udf/namei.c:243 udf_lookup+0xef/0x340 fs/udf/namei.c:309 lookup_open fs/namei.c:3391 [inline] open_last_lookups fs/namei.c:3481 [inline] path_openat+0x10e6/0x2df0 fs/namei.c:3710 do_filp_open+0x264/0x4f0 fs/namei.c:3740 do_sys_openat2+0x124/0x4e0 fs/open.c:1310 do_sys_open fs/open.c:1326 [inline] __do_sys_openat fs/open.c:1342 [inline] __se_sys_openat fs/open.c:1337 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1337 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+0x63/0xcd The buggy address belongs to the object at ffff88807e16f800 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 90 bytes inside of 256-byte region [ffff88807e16f800, ffff88807e16f900) The buggy address belongs to the physical page: page:ffffea0001f85b80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7e16e head:ffffea0001f85b80 order:1 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0001eb0180 dead000000000004 ffff888012041b40 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 2, tgid 2 (kthreadd), ts 198496238767, free_ts 198396394353 prep_new_page mm/page_alloc.c:2538 [inline] get_page_from_freelist+0x742/0x7c0 mm/page_alloc.c:4287 __alloc_pages+0x259/0x560 mm/page_alloc.c:5554 alloc_slab_page+0x70/0xf0 mm/slub.c:1794 allocate_slab+0x5e/0x4b0 mm/slub.c:1939 new_slab mm/slub.c:1992 [inline] ___slab_alloc+0x782/0xe20 mm/slub.c:3180 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x252/0x310 mm/slub.c:3437 kmalloc_trace+0x26/0x60 mm/slab_common.c:1046 kmalloc include/linux/slab.h:576 [inline] kzalloc include/linux/slab.h:712 [inline] set_kthread_struct+0xb1/0x1f0 kernel/kthread.c:117 copy_process+0x134a/0x4000 kernel/fork.c:2180 kernel_clone+0x21b/0x620 kernel/fork.c:2671 kernel_thread+0x150/0x1d0 kernel/fork.c:2731 create_kthread kernel/kthread.c:399 [inline] kthreadd+0x57c/0x750 kernel/kthread.c:746 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1458 [inline] free_pcp_prepare+0x80c/0x8f0 mm/page_alloc.c:1508 free_unref_page_prepare mm/page_alloc.c:3386 [inline] free_unref_page+0x7d/0x5f0 mm/page_alloc.c:3482 qlist_free_all+0x2b/0x70 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x169/0x180 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x1f/0x70 mm/kasan/common.c:302 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:737 [inline] slab_alloc_node mm/slub.c:3398 [inline] __kmem_cache_alloc_node+0x1d7/0x310 mm/slub.c:3437 kmalloc_node_trace+0x23/0x60 mm/slab_common.c:1059 kmalloc_node include/linux/slab.h:598 [inline] kzalloc_node include/linux/slab.h:723 [inline] __get_vm_area_node+0x13f/0x380 mm/vmalloc.c:2494 __vmalloc_node_range+0x369/0x1290 mm/vmalloc.c:3173 __vmalloc_node mm/vmalloc.c:3278 [inline] vzalloc+0x75/0x80 mm/vmalloc.c:3351 alloc_counters+0xca/0x7d0 net/ipv4/netfilter/ip_tables.c:801 copy_entries_to_user net/ipv6/netfilter/ip6_tables.c:839 [inline] get_entries net/ipv6/netfilter/ip6_tables.c:1041 [inline] do_ip6t_get_ctl+0xe86/0x17b0 net/ipv6/netfilter/ip6_tables.c:1672 nf_getsockopt+0x2ab/0x2d0 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x285/0x3d0 net/ipv6/ipv6_sockglue.c:1513 tcp_getsockopt+0x183/0x230 net/ipv4/tcp.c:4401 __sys_getsockopt+0x2db/0x5d0 net/socket.c:2296 Memory state around the buggy address: ffff88807e16f780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807e16f800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88807e16f880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 06 ^ ffff88807e16f900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807e16f980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================