syzbot


KASAN: use-after-free Read in search_by_entry_key (2)

Status: upstream: reported C repro on 2021/04/16 06:17
Reported-by: syzbot+42d685ccd71d27232b90@syzkaller.appspotmail.com
First crash: 596d, last: 11h29m

Fix bisection: failed (bisect log)
similar bugs (6):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in search_by_entry_key (2) C inconclusive inconclusive 14 11d 173d 0/24 upstream: reported C repro on 2022/06/12 10:38
linux-4.14 KASAN: use-after-free Read in search_by_entry_key C done 3 696d 802d 1/1 fixed on 2021/02/21 17:18
linux-4.19 KASAN: use-after-free Read in search_by_entry_key (3) C error 6 7d05h 169d 0/1 upstream: reported C repro on 2022/06/17 02:59
linux-4.19 KASAN: use-after-free Read in search_by_entry_key C done 1 697d 787d 1/1 fixed on 2021/02/20 09:47
upstream KASAN: use-after-free Read in search_by_entry_key C done 3 782d 785d 21/24 fixed on 2021/03/10 01:49
linux-4.19 KASAN: use-after-free Read in search_by_entry_key (2) C done 2 478d 628d 1/1 fixed on 2021/09/10 21:17

Sample crash report:
REISERFS (device loop0): journal params: device loop0, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30
REISERFS (device loop0): checking transaction log (loop0)
REISERFS (device loop0): Using r5 hash to sort names
REISERFS (device loop0): Created .reiserfs_priv - reserved for xattr storage.
==================================================================
BUG: KASAN: use-after-free in strlen+0x79/0x90 lib/string.c:539
Read of size 1 at addr ffff88808b4be9cc by task syz-executor261/7951

CPU: 1 PID: 7951 Comm: syz-executor261 Not tainted 4.14.300-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351
 kasan_report mm/kasan/report.c:409 [inline]
 __asan_report_load1_noabort+0x68/0x70 mm/kasan/report.c:427
 strlen+0x79/0x90 lib/string.c:539
 strlen include/linux/string.h:298 [inline]
 set_de_name_and_namelen fs/reiserfs/namei.c:82 [inline]
 search_by_entry_key+0x8b8/0xf50 fs/reiserfs/namei.c:171
 reiserfs_readdir_inode+0x232/0x12a0 fs/reiserfs/dir.c:98
 iterate_dir+0x1a0/0x5e0 fs/readdir.c:52
 SYSC_getdents64 fs/readdir.c:358 [inline]
 SyS_getdents64+0x125/0x230 fs/readdir.c:339
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x5e/0xd3

The buggy address belongs to the page:
page:ffffea00022d2f80 count:0 mapcount:0 mapping:          (null) index:0x1
flags: 0xfff00000000000()
raw: 00fff00000000000 0000000000000000 0000000000000001 00000000ffffffff
raw: ffffea00022d2f60 ffffea00022d2fe0 0000000000000000 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff88808b4be880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88808b4be900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff88808b4be980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                              ^
 ffff88808b4bea00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff88808b4bea80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (5):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-linux-4-14 2022/12/02 21:45 linux-4.14.y 179ef7fe8677 e080de16 .config log report syz C KASAN: use-after-free Read in search_by_entry_key
ci2-linux-4-14 2022/10/31 03:43 linux-4.14.y 41f36d7859a7 2a71366b .config log report syz C KASAN: use-after-free Read in search_by_entry_key
ci2-linux-4-14 2022/10/16 03:16 linux-4.14.y 9d5c0b3a8e1a 67cb024c .config log report syz C KASAN: use-after-free Read in search_by_entry_key
ci2-linux-4-14 2022/06/12 08:02 linux-4.14.y b8f3be299d51 0d5abf15 .config log report syz C KASAN: use-after-free Read in search_by_entry_key
ci2-linux-4-14 2021/04/16 06:16 linux-4.14.y 958e517f4e16 c59079a6 .config log report syz C KASAN: use-after-free Read in search_by_entry_key
* Struck through repros no longer work on HEAD.