KASAN: use-after-free Read in ntfs_are_names_equal

Status: auto-obsoleted due to no activity on 2022/09/21 05:34
First crash: 848d, last: 848d

Cause bisection: failed (bisect log)

Fix bisection: failed (bisect log)
similar bugs (2):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: use-after-free Read in ntfs_are_names_equal C error 1 505d 849d 0/1 upstream: reported C repro on 2020/10/11 09:28
linux-4.14 KASAN: use-after-free Read in ntfs_are_names_equal C error 1 347d 862d 0/1 upstream: reported C repro on 2020/09/29 06:04
Last patch testing requests:
Created Duration User Patch Repo Result
2022/09/21 03:29 17m retest repro upstream OK log
2021/04/19 22:04 18m upstream report log
2020/11/02 08:04 19m patch upstream OK
2020/11/02 06:23 12m upstream report log
2020/10/26 07:18 15m upstream report log

Sample crash report:
ntfs: (device loop0): ntfs_read_locked_inode(): Failed with error code -5.  Marking corrupt inode 0xa as bad.  Run chkdsk.
ntfs: (device loop0): load_and_init_upcase(): Failed to load $UpCase from the volume. Using default.
ntfs: volume version 3.1.
ntfs: (device loop0): map_mft_record_page(): Mft record 0x2 is corrupt.  Run chkdsk.
BUG: KASAN: use-after-free in ntfs_ucsncmp fs/ntfs/unistr.c:142 [inline]
BUG: KASAN: use-after-free in ntfs_are_names_equal+0x2f8/0x340 fs/ntfs/unistr.c:61
Read of size 2 at addr ffff888086758ee8 by task syz-executor601/6839

CPU: 0 PID: 6839 Comm: syz-executor601 Not tainted 5.9.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1d6/0x29e lib/dump_stack.c:118
 print_address_description+0x66/0x620 mm/kasan/report.c:383
 __kasan_report mm/kasan/report.c:513 [inline]
 kasan_report+0x132/0x1d0 mm/kasan/report.c:530
 ntfs_ucsncmp fs/ntfs/unistr.c:142 [inline]
 ntfs_are_names_equal+0x2f8/0x340 fs/ntfs/unistr.c:61
 ntfs_attr_find+0x36d/0xac0 fs/ntfs/attrib.c:614
 ntfs_attr_lookup+0x1ec/0x23b0 fs/ntfs/attrib.c:1189
 ntfs_read_locked_attr_inode fs/ntfs/inode.c:1233 [inline]
 ntfs_attr_iget+0x48c/0x21a0 fs/ntfs/inode.c:238
 ntfs_read_locked_inode+0x36fd/0x4e30 fs/ntfs/inode.c:954
 ntfs_iget+0xc2/0x130 fs/ntfs/inode.c:177
 load_system_files fs/ntfs/super.c:1974 [inline]
 ntfs_fill_super+0x5c38/0x8bd0 fs/ntfs/super.c:2894
 mount_bdev+0x24f/0x360 fs/super.c:1417
 legacy_get_tree+0xea/0x180 fs/fs_context.c:592
 vfs_get_tree+0x88/0x270 fs/super.c:1547
 do_new_mount fs/namespace.c:2875 [inline]
 path_mount+0x179d/0x29e0 fs/namespace.c:3192
 do_mount fs/namespace.c:3205 [inline]
 __do_sys_mount fs/namespace.c:3413 [inline]
 __se_sys_mount+0x126/0x180 fs/namespace.c:3390
 do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46
RIP: 0033:0x45726a
Code: b8 08 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 8d a3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 6a a3 fb ff c3 66 0f 1f 84 00 00 00 00 00
RSP: 002b:00007ffcaca0cb18 EFLAGS: 00000287 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ffcaca0cb70 RCX: 000000000045726a
RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007ffcaca0cb30
RBP: 0000000000000004 R08: 00007ffcaca0cb70 R09: 0000000000316777
R10: 0000000000000000 R11: 0000000000000287 R12: 0000000000000003
R13: 00007ffcaca0cb30 R14: 0000000000000000 R15: 0000000020001218

The buggy address belongs to the page:
page:000000007012e419 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x86758
flags: 0xfffe0000000000()
raw: 00fffe0000000000 ffffea000219d688 ffffea000219d3c8 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888086758d80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888086758e00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff888086758e80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888086758f00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff888086758f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff

Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets Title
ci-upstream-kasan-gce-smack-root 2020/10/12 18:21 upstream bbf5c979011a d32b0bbf .config console log report syz C
* Struck through repros no longer work on HEAD.