syzbot


KASAN: slab-out-of-bounds Read in __ext4_check_dir_entry

Status: fixed on 2018/05/29 12:14
Subsystems: ext4
[Documentation on labels]
Reported-by: syzbot+730517f1d3fbe54a17c7@syzkaller.appspotmail.com
Fix commit: e40ff2138985 ext4: force revalidation of directory pointer after seekdir(2)
First crash: 2302d, last: 2300d
Duplicate bugs (2)
duplicates (2):
Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
KASAN: use-after-free Read in __ext4_check_dir_entry (2) ext4 C error 1 55d 65d 0/27 closed as dup on 2024/06/26 08:39
KASAN: use-after-free Read in __ext4_check_dir_entry ext4 C 8 2298d 2301d 22/27 closed as dup on 2018/03/31 22:38
Discussions (2)
Title Replies (including bot) Last reply
KASAN: slab-out-of-bounds Read in __ext4_check_dir_entry 0 (1) 2018/03/31 20:47
KASAN: slab-out-of-bounds Read in __ext4_check_dir_entry 0 (1) 2018/03/31 20:47
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: slab-out-of-bounds Read in __ext4_check_dir_entry C 18 515d 1562d 0/1 upstream: reported C repro on 2020/04/08 18:25

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in __ext4_check_dir_entry+0x2de/0x320 fs/ext4/dir.c:69
Read of size 2 at addr ffff8801ad833002 by task syzkaller726813/4419

CPU: 1 PID: 4419 Comm: syzkaller726813 Not tainted 4.16.0-rc7+ #9
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+0x194/0x24d lib/dump_stack.c:53
 print_address_description+0x73/0x250 mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report+0x23c/0x360 mm/kasan/report.c:412
 __asan_report_load2_noabort+0x14/0x20 mm/kasan/report.c:431
 __ext4_check_dir_entry+0x2de/0x320 fs/ext4/dir.c:69
 ext4_readdir+0xd00/0x3600 fs/ext4/dir.c:237
 iterate_dir+0x1ca/0x530 fs/readdir.c:51
 SYSC_getdents64 fs/readdir.c:314 [inline]
 SyS_getdents64+0x221/0x420 fs/readdir.c:295
 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x43fd69
RSP: 002b:00007ffc4562e698 EFLAGS: 00000203 ORIG_RAX: 00000000000000d9
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 000000000043fd69
RDX: 00000000200015fc RSI: 0000000020001540 RDI: 0000000000000003
RBP: 00000000006ca018 R08: 00000000004002c8 R09: 00000000004002c8
R10: 00000000004002c8 R11: 0000000000000203 R12: 0000000000401690
R13: 0000000000401720 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 0:
(stack is not available)

Freed by task 0:
(stack is not available)

The buggy address belongs to the object at ffff8801ad833040
 which belongs to the cache vm_area_struct of size 200
The buggy address is located 62 bytes to the left of
 200-byte region [ffff8801ad833040, ffff8801ad833108)
The buggy address belongs to the page:
page:ffffea0006b60cc0 count:1 mapcount:0 mapping:ffff8801ad833040 index:0x0
flags: 0x2fffc0000000100(slab)
raw: 02fffc0000000100 ffff8801ad833040 0000000000000000 000000010000000f
raw: ffffea0006b63860 ffffea0006b51420 ffff8801da5d6840 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801ad832f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8801ad832f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8801ad833000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                   ^
 ffff8801ad833080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8801ad833100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (18):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/04/01 08:26 upstream 10b84daddbec 0174c6c8 .config console log report syz C ci-upstream-kasan-gce-root
2018/03/31 00:40 upstream 9dd2326890d8 8fbce0e4 .config console log report syz C ci-upstream-kasan-gce-root
2018/04/01 17:20 upstream 10b84daddbec dc889257 .config console log report ci-upstream-kasan-gce-root
2018/04/01 12:16 upstream 10b84daddbec 0a78e248 .config console log report ci-upstream-kasan-gce-root
2018/04/01 12:04 upstream 10b84daddbec 0a78e248 .config console log report ci-upstream-kasan-gce-root
2018/04/01 11:37 upstream 10b84daddbec 0174c6c8 .config console log report ci-upstream-kasan-gce-root
2018/04/01 11:28 upstream 10b84daddbec 0174c6c8 .config console log report ci-upstream-kasan-gce-root
2018/04/01 10:48 upstream 10b84daddbec 0174c6c8 .config console log report ci-upstream-kasan-gce-root
2018/04/01 09:07 upstream 10b84daddbec 0174c6c8 .config console log report ci-upstream-kasan-gce-root
2018/04/01 06:11 upstream 10b84daddbec 0174c6c8 .config console log report ci-upstream-kasan-gce-root
2018/04/01 06:04 upstream 10b84daddbec 0174c6c8 .config console log report ci-upstream-kasan-gce-root
2018/04/01 05:13 upstream 10b84daddbec 0174c6c8 .config console log report ci-upstream-kasan-gce-root
2018/04/01 04:57 upstream 10b84daddbec 0174c6c8 .config console log report ci-upstream-kasan-gce-root
2018/04/01 04:23 upstream 10b84daddbec 0174c6c8 .config console log report ci-upstream-kasan-gce-root
2018/04/01 04:09 upstream 10b84daddbec 0174c6c8 .config console log report ci-upstream-kasan-gce-root
2018/04/01 03:59 upstream 10b84daddbec 0174c6c8 .config console log report ci-upstream-kasan-gce-root
2018/03/31 01:27 upstream 9dd2326890d8 8fbce0e4 .config console log report ci-upstream-kasan-gce-root
2018/03/31 00:22 upstream 9dd2326890d8 8fbce0e4 .config console log report ci-upstream-kasan-gce-root
* Struck through repros no longer work on HEAD.