================================================================== BUG: KASAN: use-after-free in udf_get_fileident+0x233/0x250 fs/udf/directory.c:176 Read of size 2 at addr ffff88809e933134 by task syz-executor.4/17785 CPU: 0 PID: 17785 Comm: syz-executor.4 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/12/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354 kasan_report mm/kasan/report.c:412 [inline] __asan_report_load_n_noabort+0x8b/0xa0 mm/kasan/report.c:443 udf_get_fileident+0x233/0x250 fs/udf/directory.c:176 udf_fileident_read+0x550/0x1930 fs/udf/directory.c:37 udf_readdir+0x559/0x1350 fs/udf/dir.c:129 iterate_dir+0x473/0x5c0 fs/readdir.c:51 __do_sys_getdents fs/readdir.c:271 [inline] __se_sys_getdents+0x175/0x2d0 fs/readdir.c:252 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f66f9d730c9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f66f82e5168 EFLAGS: 00000246 ORIG_RAX: 000000000000004e RAX: ffffffffffffffda RBX: 00007f66f9e92f80 RCX: 00007f66f9d730c9 RDX: 0000000000000018 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 00007f66f9dceae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffd92e2ddaf R14: 00007f66f82e5300 R15: 0000000000022000 Allocated by task 8150: __do_kmalloc_node mm/slab.c:3689 [inline] __kmalloc_node+0x4c/0x70 mm/slab.c:3696 kmalloc_node include/linux/slab.h:557 [inline] kvmalloc_node+0x61/0xf0 mm/util.c:423 kvmalloc include/linux/mm.h:577 [inline] xt_alloc_table_info+0x3c/0xa0 net/netfilter/x_tables.c:1177 do_replace net/ipv6/netfilter/ip6_tables.c:1145 [inline] do_ip6t_set_ctl+0x214/0x430 net/ipv6/netfilter/ip6_tables.c:1686 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x6f/0xc0 net/netfilter/nf_sockopt.c:115 ipv6_setsockopt+0x103/0x160 net/ipv6/ipv6_sockglue.c:945 tcp_setsockopt+0x86/0xd0 net/ipv4/tcp.c:3108 __sys_setsockopt+0x14d/0x240 net/socket.c:2013 __do_sys_setsockopt net/socket.c:2024 [inline] __se_sys_setsockopt net/socket.c:2021 [inline] __x64_sys_setsockopt+0xba/0x150 net/socket.c:2021 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 8150: __cache_free mm/slab.c:3503 [inline] kfree+0xcc/0x210 mm/slab.c:3822 kvfree+0x59/0x60 mm/util.c:452 __do_replace+0x6ab/0x870 net/ipv4/netfilter/arp_tables.c:932 do_replace net/ipv6/netfilter/ip6_tables.c:1160 [inline] do_ip6t_set_ctl+0x2d2/0x430 net/ipv6/netfilter/ip6_tables.c:1686 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x6f/0xc0 net/netfilter/nf_sockopt.c:115 ipv6_setsockopt+0x103/0x160 net/ipv6/ipv6_sockglue.c:945 tcp_setsockopt+0x86/0xd0 net/ipv4/tcp.c:3108 __sys_setsockopt+0x14d/0x240 net/socket.c:2013 __do_sys_setsockopt net/socket.c:2024 [inline] __se_sys_setsockopt net/socket.c:2021 [inline] __x64_sys_setsockopt+0xba/0x150 net/socket.c:2021 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88809e932d80 which belongs to the cache kmalloc-1024 of size 1024 The buggy address is located 948 bytes inside of 1024-byte region [ffff88809e932d80, ffff88809e933180) The buggy address belongs to the page: page:ffffea00027a4c80 count:1 mapcount:0 mapping:ffff88813bff0ac0 index:0xffff88809e932000 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffffea00026d2b88 ffffea0002cee908 ffff88813bff0ac0 raw: ffff88809e932000 ffff88809e932000 0000000100000004 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809e933000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809e933080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88809e933100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809e933180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88809e933200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================