[v5.15] KASAN: use-after-free Read in reiserfs_find_entry

1 view
Skip to first unread message

syzbot

unread,
Apr 26, 2023, 2:52:51 AM4/26/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3299fb36854f Linux 5.15.108
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=11c7eed7c80000
kernel config: https://syzkaller.appspot.com/x/.config?x=7da5cf0bf5f17e50
dashboard link: https://syzkaller.appspot.com/bug?extid=f3117ba42f5190608948
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/e9dec7cd5a48/disk-3299fb36.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/e054af719cf1/vmlinux-3299fb36.xz
kernel image: https://storage.googleapis.com/syzbot-assets/5ae902fb312f/Image-3299fb36.gz.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+f3117b...@syzkaller.appspotmail.com

REISERFS (device loop5): journal params: device loop5, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30
REISERFS (device loop5): checking transaction log (loop5)
REISERFS (device loop5): Using r5 hash to sort names
==================================================================
BUG: KASAN: use-after-free in strlen+0x54/0x70 lib/string.c:566
Read of size 1 at addr ffff00012658706c by task syz-executor.5/25287

CPU: 0 PID: 25287 Comm: syz-executor.5 Not tainted 5.15.108-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/2023
Call trace:
dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
print_address_description+0x7c/0x3f0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0x174/0x1e4 mm/kasan/report.c:451
__asan_report_load1_noabort+0x44/0x50 mm/kasan/report_generic.c:306
strlen+0x54/0x70 lib/string.c:566
set_de_name_and_namelen fs/reiserfs/namei.c:82 [inline]
linear_search_in_dir_item fs/reiserfs/namei.c:262 [inline]
reiserfs_find_entry+0x86c/0x1624 fs/reiserfs/namei.c:331
reiserfs_lookup+0x184/0x3c4 fs/reiserfs/namei.c:368
__lookup_slow+0x250/0x388 fs/namei.c:1659
lookup_one_len+0x178/0x28c fs/namei.c:2688
reiserfs_lookup_privroot+0x8c/0x204 fs/reiserfs/xattr.c:980
reiserfs_fill_super+0x1494/0x1e8c fs/reiserfs/super.c:2196
mount_bdev+0x26c/0x368 fs/super.c:1378
get_super_block+0x44/0x58 fs/reiserfs/super.c:2608
legacy_get_tree+0xd4/0x16c fs/fs_context.c:610
vfs_get_tree+0x90/0x274 fs/super.c:1508
do_new_mount+0x25c/0x8c8 fs/namespace.c:2994
path_mount+0x590/0x104c fs/namespace.c:3324
do_mount fs/namespace.c:3337 [inline]
__do_sys_mount fs/namespace.c:3545 [inline]
__se_sys_mount fs/namespace.c:3522 [inline]
__arm64_sys_mount+0x510/0x5e0 fs/namespace.c:3522
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

The buggy address belongs to the page:
page:000000003ede7d46 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x166587
flags: 0x5ffc00000000000(node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000000000 fffffc0004832908 ffff0001b4816860 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff000126586f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff000126586f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff000126587000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff000126587080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff000126587100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================
reiserfs: enabling write barrier flush mode
REISERFS warning: green-16003 errcatch_is_left_mergeable: Invalid item type observed, run fsck ASAP
REISERFS warning: green-16003 errcatch_is_left_mergeable: Invalid item type observed, run fsck ASAP
REISERFS warning: reiserfs-5093 is_leaf: item entry count seems wrong *3.5*[2 1 0(1) DIR], item_len 35, item_location 3937, free_space(entry_count) 2
REISERFS error (device loop5): vs-5150 search_by_key: invalid format found in block 531. Fsck?
REISERFS (device loop5): Remounting filesystem read-only
REISERFS error (device loop5): vs-13050 reiserfs_update_sd_size: i/o failure occurred trying to update [2 1 0x0 SD] stat data
REISERFS warning: reiserfs-5093 is_leaf: item entry count seems wrong *3.5*[2 1 0(1) DIR], item_len 35, item_location 3937, free_space(entry_count) 2
REISERFS error (device loop5): vs-5150 search_by_key: invalid format found in block 531. Fsck?
REISERFS error (device loop5): zam-7001 reiserfs_find_entry: io error
REISERFS warning: reiserfs-5093 is_leaf: item entry count seems wrong *3.5*[2 1 0(1) DIR], item_len 35, item_location 3937, free_space(entry_count) 2
REISERFS error (device loop5): vs-5150 search_by_key: invalid format found in block 531. Fsck?
REISERFS error (device loop5): vs-13050 reiserfs_update_sd_size: i/o failure occurred trying to update [2 1 0x0 SD] stat data
REISERFS warning (device loop5): jdm-20006 create_privroot: xattrs/ACLs enabled and couldn't find/create .reiserfs_priv. Failing mount.
REISERFS warning: reiserfs-5093 is_leaf: item entry count seems wrong *3.5*[2 1 0(1) DIR], item_len 35, item_location 3937, free_space(entry_count) 2
REISERFS error (device loop5): vs-5150 search_by_key: invalid format found in block 531. Fsck?
REISERFS error (device loop5): zam-7001 reiserfs_find_entry: io error


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Jun 3, 2023, 3:15:55 PM6/3/23
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 0ab06468cbd1 Linux 5.15.114
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15831f49280000
kernel config: https://syzkaller.appspot.com/x/.config?x=9a2696a271d0eba
dashboard link: https://syzkaller.appspot.com/bug?extid=f3117ba42f5190608948
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14af6e93280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17f29369280000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/8ff3613d3f6b/disk-0ab06468.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/eebe2d8c6813/vmlinux-0ab06468.xz
kernel image: https://storage.googleapis.com/syzbot-assets/f30284c26197/Image-0ab06468.gz.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/efd4d3b6ce89/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+f3117b...@syzkaller.appspotmail.com

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
==================================================================
BUG: KASAN: use-after-free in strlen+0x54/0x70 lib/string.c:566
Read of size 1 at addr ffff0000df7e77a3 by task syz-executor582/3963

CPU: 1 PID: 3963 Comm: syz-executor582 Not tainted 5.15.114-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023
Call trace:
dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
print_address_description+0x7c/0x3f0 mm/kasan/report.c:248
__kasan_report mm/kasan/report.c:434 [inline]
kasan_report+0x174/0x1e4 mm/kasan/report.c:451
__asan_report_load1_noabort+0x44/0x50 mm/kasan/report_generic.c:306
strlen+0x54/0x70 lib/string.c:566
set_de_name_and_namelen fs/reiserfs/namei.c:82 [inline]
linear_search_in_dir_item fs/reiserfs/namei.c:262 [inline]
reiserfs_find_entry+0x86c/0x1624 fs/reiserfs/namei.c:331
reiserfs_lookup+0x184/0x3c4 fs/reiserfs/namei.c:368
__lookup_slow+0x250/0x388 fs/namei.c:1659
lookup_one_len+0x178/0x28c fs/namei.c:2688
reiserfs_lookup_privroot+0x8c/0x204 fs/reiserfs/xattr.c:980
reiserfs_fill_super+0x1494/0x1e8c fs/reiserfs/super.c:2196
mount_bdev+0x274/0x370 fs/super.c:1378
get_super_block+0x44/0x58 fs/reiserfs/super.c:2608
legacy_get_tree+0xd4/0x16c fs/fs_context.c:610
vfs_get_tree+0x90/0x274 fs/super.c:1508
do_new_mount+0x25c/0x8c4 fs/namespace.c:2994
path_mount+0x590/0x104c fs/namespace.c:3324
do_mount fs/namespace.c:3337 [inline]
__do_sys_mount fs/namespace.c:3545 [inline]
__se_sys_mount fs/namespace.c:3522 [inline]
__arm64_sys_mount+0x510/0x5e0 fs/namespace.c:3522
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596
el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614
el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

The buggy address belongs to the page:
page:00000000f6a84383 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x11f7e7
flags: 0x5ffc00000000000(node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000000000 fffffc00037dfa08 ffff0001b4836860 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff0000df7e7680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff0000df7e7700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff0000df7e7780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff0000df7e7800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff0000df7e7880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

syzbot

unread,
Jun 3, 2023, 6:30:00 PM6/3/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: d2869ace6eeb Linux 6.1.31
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=146f6e93280000
kernel config: https://syzkaller.appspot.com/x/.config?x=11263f470b7a4c92
dashboard link: https://syzkaller.appspot.com/bug?extid=c78666ac17322c2ddc5c
compiler: Debian clang version 15.0.7, GNU ld (GNU Binutils for Debian) 2.35.2
userspace arch: arm64
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=148a9369280000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16446c45280000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/b17a7cd87498/disk-d2869ace.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/cc8291ae723a/vmlinux-d2869ace.xz
kernel image: https://storage.googleapis.com/syzbot-assets/04943541fc25/Image-d2869ace.gz.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/5935dad419e9/mount_0.gz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+c78666...@syzkaller.appspotmail.com

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
==================================================================
BUG: KASAN: use-after-free in strlen+0x54/0x70 lib/string.c:495
Read of size 1 at addr ffff0000e21bc7a3 by task syz-executor234/4217

CPU: 1 PID: 4217 Comm: syz-executor234 Not tainted 6.1.31-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023
Call trace:
dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158
show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:284 [inline]
print_report+0x174/0x4c0 mm/kasan/report.c:395
kasan_report+0xd4/0x130 mm/kasan/report.c:495
__asan_report_load1_noabort+0x2c/0x38 mm/kasan/report_generic.c:348
strlen+0x54/0x70 lib/string.c:495
set_de_name_and_namelen fs/reiserfs/namei.c:82 [inline]
linear_search_in_dir_item fs/reiserfs/namei.c:262 [inline]
reiserfs_find_entry+0x898/0x149c fs/reiserfs/namei.c:331
reiserfs_lookup+0x184/0x3c4 fs/reiserfs/namei.c:368
__lookup_slow+0x250/0x374 fs/namei.c:1685
lookup_one_len+0x178/0x28c fs/namei.c:2711
reiserfs_lookup_privroot+0x8c/0x204 fs/reiserfs/xattr.c:973
reiserfs_fill_super+0x15b4/0x2028 fs/reiserfs/super.c:2192
mount_bdev+0x274/0x370 fs/super.c:1423
get_super_block+0x44/0x58 fs/reiserfs/super.c:2601
legacy_get_tree+0xd4/0x16c fs/fs_context.c:610
vfs_get_tree+0x90/0x274 fs/super.c:1553
do_new_mount+0x25c/0x8c4 fs/namespace.c:3040
path_mount+0x590/0xe58 fs/namespace.c:3370
do_mount fs/namespace.c:3383 [inline]
__do_sys_mount fs/namespace.c:3591 [inline]
__se_sys_mount fs/namespace.c:3568 [inline]
__arm64_sys_mount+0x45c/0x594 fs/namespace.c:3568
__invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52
el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206
el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637
el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655
el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581

The buggy address belongs to the physical page:
page:00000000cb8d89e1 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x1221bc
flags: 0x5ffc00000000000(node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000000000 fffffc0003886f48 ffff0001b45e8220 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff0000e21bc680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff0000e21bc700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff0000e21bc780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff0000e21bc800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff0000e21bc880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the bug is already fixed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to change bug's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the bug is a duplicate of another bug, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages