================================================================== BUG: KASAN: slab-out-of-bounds in __ext4_check_dir_entry+0x2ef/0x340 fs/ext4/dir.c:86 Read of size 1 at addr ffff8880562c8001 by task syz-executor.3/21816 CPU: 0 PID: 21816 Comm: syz-executor.3 Not tainted 4.14.184-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1b2/0x283 lib/dump_stack.c:58 print_address_description.cold+0x54/0x1dc mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report mm/kasan/report.c:409 [inline] kasan_report.cold+0xa9/0x2b9 mm/kasan/report.c:393 __ext4_check_dir_entry+0x2ef/0x340 fs/ext4/dir.c:86 ext4_readdir+0x819/0x27e0 fs/ext4/dir.c:240 iterate_dir+0x1a0/0x5e0 fs/readdir.c:52 SYSC_getdents fs/readdir.c:269 [inline] SyS_getdents+0x132/0x260 fs/readdir.c:250 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x45ca59 RSP: 002b:00007f62f6c6fc78 EFLAGS: 00000246 ORIG_RAX: 000000000000004e RAX: ffffffffffffffda RBX: 00000000004dcf60 RCX: 000000000045ca59 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 000000000078bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000000f6 R14: 00000000004c3a00 R15: 00007f62f6c706d4 Allocated by task 6353: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc.part.0+0x4f/0xd0 mm/kasan/kasan.c:551 __do_kmalloc_node mm/slab.c:3682 [inline] __kmalloc_node+0x4c/0x70 mm/slab.c:3689 kmalloc_node include/linux/slab.h:530 [inline] kvmalloc_node+0x46/0xd0 mm/util.c:397 kvmalloc include/linux/mm.h:531 [inline] xt_alloc_table_info+0x6a/0xe0 net/netfilter/x_tables.c:1062 do_replace net/ipv4/netfilter/ip_tables.c:1127 [inline] do_ipt_set_ctl+0x1b1/0x39d net/ipv4/netfilter/ip_tables.c:1674 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x5f/0xb0 net/netfilter/nf_sockopt.c:115 ip_setsockopt net/ipv4/ip_sockglue.c:1255 [inline] ip_setsockopt+0x94/0xb0 net/ipv4/ip_sockglue.c:1240 tcp_setsockopt net/ipv4/tcp.c:2828 [inline] tcp_setsockopt+0x7b/0xc0 net/ipv4/tcp.c:2822 SYSC_setsockopt net/socket.c:1865 [inline] SyS_setsockopt+0x110/0x1e0 net/socket.c:1844 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb Freed by task 6353: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xaf/0x190 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xcb/0x260 mm/slab.c:3815 kvfree+0x45/0x50 mm/util.c:416 __do_replace+0x3f0/0x570 net/ipv4/netfilter/ip_tables.c:1088 do_replace net/ipv4/netfilter/ip_tables.c:1142 [inline] do_ipt_set_ctl+0x255/0x39d net/ipv4/netfilter/ip_tables.c:1674 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x5f/0xb0 net/netfilter/nf_sockopt.c:115 ip_setsockopt net/ipv4/ip_sockglue.c:1255 [inline] ip_setsockopt+0x94/0xb0 net/ipv4/ip_sockglue.c:1240 tcp_setsockopt net/ipv4/tcp.c:2828 [inline] tcp_setsockopt+0x7b/0xc0 net/ipv4/tcp.c:2822 SYSC_setsockopt net/socket.c:1865 [inline] SyS_setsockopt+0x110/0x1e0 net/socket.c:1844 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb The buggy address belongs to the object at ffff8880562c8040 which belongs to the cache kmalloc-1024 of size 1024 The buggy address is located 63 bytes to the left of 1024-byte region [ffff8880562c8040, ffff8880562c8440) The buggy address belongs to the page: page:ffffea000158b200 count:1 mapcount:0 mapping:ffff8880562c8040 index:0x0 compound_mapcount: 0 flags: 0xfffe0000008100(slab|head) raw: 00fffe0000008100 ffff8880562c8040 0000000000000000 0000000100000007 raw: ffffea00016237a0 ffffea000158b2a0 ffff8880aa800ac0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880562c7f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880562c7f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880562c8000: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff8880562c8080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880562c8100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================