KASAN: use-after-free Read in ntfs_test_inode

7 views
Skip to first unread message

syzbot

unread,
Nov 28, 2022, 1:25:40 PM11/28/22
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3f8a27f9e27b Linux 4.19.211
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1227b04b880000
kernel config: https://syzkaller.appspot.com/x/.config?x=9b9277b418617afe
dashboard link: https://syzkaller.appspot.com/bug?extid=fae66716d840f5ea75d0
compiler: gcc version 10.2.1 20210110 (Debian 10.2.1-6)

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

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/98c0bdb4abb3/disk-3f8a27f9.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/ea228ff02669/vmlinux-3f8a27f9.xz

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

ntfs: volume version 3.1.
==================================================================
BUG: KASAN: use-after-free in constant_test_bit arch/x86/include/asm/bitops.h:317 [inline]
BUG: KASAN: use-after-free in NInoAttr fs/ntfs/inode.h:214 [inline]
BUG: KASAN: use-after-free in ntfs_test_inode+0x26e/0x2d0 fs/ntfs/inode.c:68
Read of size 8 at addr ffff8880b1a6e540 by task syz-executor.3/17730

CPU: 1 PID: 17730 Comm: syz-executor.3 Not tainted 4.19.211-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
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_load8_noabort+0x88/0x90 mm/kasan/report.c:433
constant_test_bit arch/x86/include/asm/bitops.h:317 [inline]
NInoAttr fs/ntfs/inode.h:214 [inline]
ntfs_test_inode+0x26e/0x2d0 fs/ntfs/inode.c:68
find_inode+0xe4/0x220 fs/inode.c:808
ilookup5_nowait+0x6f/0xb0 fs/inode.c:1321
ilookup5+0x3c/0x140 fs/inode.c:1350
iget5_locked+0x2f/0xd0 fs/inode.c:1128
ntfs_iget+0x9d/0x180 fs/ntfs/inode.c:181
load_and_check_logfile fs/ntfs/super.c:1222 [inline]
load_system_files fs/ntfs/super.c:1955 [inline]
ntfs_fill_super+0x5765/0x7e10 fs/ntfs/super.c:2908
mount_bdev+0x2fc/0x3b0 fs/super.c:1158
mount_fs+0xa3/0x310 fs/super.c:1261
vfs_kern_mount.part.0+0x68/0x470 fs/namespace.c:961
vfs_kern_mount fs/namespace.c:951 [inline]
do_new_mount fs/namespace.c:2492 [inline]
do_mount+0x115c/0x2f50 fs/namespace.c:2822
ksys_mount+0xcf/0x130 fs/namespace.c:3038
__do_sys_mount fs/namespace.c:3052 [inline]
__se_sys_mount fs/namespace.c:3049 [inline]
__x64_sys_mount+0xba/0x150 fs/namespace.c:3049
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f5f8352a60a
Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 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:00007f5f81a9af88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 000000000001ec51 RCX: 00007f5f8352a60a
RDX: 000000002001ec80 RSI: 000000002001ecc0 RDI: 00007f5f81a9afe0
RBP: 00007f5f81a9b020 R08: 00007f5f81a9b020 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 000000002001ec80
R13: 000000002001ecc0 R14: 00007f5f81a9afe0 R15: 000000002001ed00

Allocated by task 17280:
kmem_cache_alloc+0x122/0x370 mm/slab.c:3559
reiserfs_alloc_inode+0x19/0xb0 fs/reiserfs/super.c:642
alloc_inode+0x5d/0x180 fs/inode.c:211
new_inode_pseudo fs/inode.c:911 [inline]
new_inode+0x1d/0xf0 fs/inode.c:940
reiserfs_create+0x1b6/0x720 fs/reiserfs/namei.c:642
xattr_create fs/reiserfs/xattr.c:69 [inline]
xattr_lookup+0x318/0x3c0 fs/reiserfs/xattr.c:412
reiserfs_xattr_set_handle+0xfd/0xb40 fs/reiserfs/xattr.c:531
reiserfs_xattr_set+0x411/0x570 fs/reiserfs/xattr.c:631
trusted_set+0xa6/0xd0 fs/reiserfs/xattr_trusted.c:30
__vfs_setxattr+0x10e/0x170 fs/xattr.c:149
__vfs_setxattr_noperm+0x11a/0x420 fs/xattr.c:180
__vfs_setxattr_locked+0x176/0x250 fs/xattr.c:238
vfs_setxattr+0xe5/0x270 fs/xattr.c:255
setxattr+0x23d/0x330 fs/xattr.c:520
path_setxattr+0x170/0x190 fs/xattr.c:539
__do_sys_lsetxattr fs/xattr.c:561 [inline]
__se_sys_lsetxattr fs/xattr.c:557 [inline]
__x64_sys_lsetxattr+0xbd/0x150 fs/xattr.c:557
do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 29121:
__cache_free mm/slab.c:3503 [inline]
kmem_cache_free+0x7f/0x260 mm/slab.c:3765
__rcu_reclaim kernel/rcu/rcu.h:236 [inline]
rcu_do_batch kernel/rcu/tree.c:2584 [inline]
invoke_rcu_callbacks kernel/rcu/tree.c:2897 [inline]
__rcu_process_callbacks kernel/rcu/tree.c:2864 [inline]
rcu_process_callbacks+0x8ff/0x18b0 kernel/rcu/tree.c:2881
__do_softirq+0x265/0x980 kernel/softirq.c:292

The buggy address belongs to the object at ffff8880b1a6e0c0
which belongs to the cache reiser_inode_cache of size 1304
The buggy address is located 1152 bytes inside of
1304-byte region [ffff8880b1a6e0c0, ffff8880b1a6e5d8)
The buggy address belongs to the page:
page:ffffea0002c69b80 count:1 mapcount:0 mapping:ffff88823a4bde00 index:0xffff8880b1a6effe
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffffea00022af448 ffffea0001334708 ffff88823a4bde00
raw: ffff8880b1a6effe ffff8880b1a6e0c0 0000000100000002 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8880b1a6e400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8880b1a6e480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880b1a6e500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8880b1a6e580: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc
ffff8880b1a6e600: fc fc fc fc fc fc fc fc fc fc fc 00 00 00 00 00
==================================================================


---
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,
Mar 28, 2023, 2:25:45 PM3/28/23
to syzkaller...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages