syzbot


KASAN: use-after-free Write in ntfs_perform_write

Status: upstream: reported C repro on 2024/01/09 18:19
Subsystems: ntfs3
[Documentation on labels]
Reported-by: syzbot+f583da5774d7dd400312@syzkaller.appspotmail.com
First crash: 116d, last: 99d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [ntfs?] KASAN: use-after-free Write in ntfs_perform_write 0 (1) 2024/01/09 18:19
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 KASAN: use-after-free Write in ntfs_perform_write origin:upstream missing-backport C error 44 24d 119d 0/3 upstream: reported C repro on 2023/12/29 14:37
linux-6.1 KASAN: use-after-free Write in ntfs_perform_write origin:upstream missing-backport C inconclusive 6 26d 116d 0/3 upstream: reported C repro on 2024/01/01 16:19
Last patch testing requests (4)
Created Duration User Patch Repo Result
2024/04/22 05:16 29m retest repro git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci OK log
2024/04/22 05:16 28m retest repro git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci OK log
2024/01/18 11:11 1h32m (2) retest repro git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci report log
2024/01/18 11:11 3h06m retest repro git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci report log

Sample crash report:
ntfs: (device loop0): parse_options(): Option utf8 is no longer supported, using option nls=utf8. Please use option nls=utf8 in the future and make sure utf8 is compiled either as a module or into the kernel.
ntfs: volume version 3.1.
==================================================================
BUG: KASAN: use-after-free in ntfs_commit_pages_after_write fs/ntfs/file.c:1597 [inline]
BUG: KASAN: use-after-free in ntfs_perform_write+0x5354/0x82c8 fs/ntfs/file.c:1853
Write of size 1 at addr ffff0000de9b6170 by task syz-executor306/6098

CPU: 0 PID: 6098 Comm: syz-executor306 Not tainted 6.7.0-rc6-syzkaller-gaafe7ad77b91 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/10/2023
Call trace:
 dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:291
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:298
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xd0/0x124 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:364 [inline]
 print_report+0x174/0x514 mm/kasan/report.c:475
 kasan_report+0xd8/0x138 mm/kasan/report.c:588
 kasan_check_range+0x254/0x294 mm/kasan/generic.c:187
 __asan_memcpy+0x54/0x84 mm/kasan/shadow.c:106
 ntfs_commit_pages_after_write fs/ntfs/file.c:1597 [inline]
 ntfs_perform_write+0x5354/0x82c8 fs/ntfs/file.c:1853
 ntfs_file_write_iter+0xf3c/0x1738 fs/ntfs/file.c:1909
 call_write_iter include/linux/fs.h:2020 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x610/0x910 fs/read_write.c:584
 ksys_write+0x15c/0x26c fs/read_write.c:637
 __do_sys_write fs/read_write.c:649 [inline]
 __se_sys_write fs/read_write.c:646 [inline]
 __arm64_sys_write+0x7c/0x90 fs/read_write.c:646
 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:51
 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:136
 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:155
 el0_svc+0x54/0x158 arch/arm64/kernel/entry-common.c:678
 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:696
 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:595

The buggy address belongs to the physical page:
page:000000003d2e8ed5 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x11e9b6
flags: 0x5ffc00000000000(node=0|zone=2|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 05ffc00000000000 fffffc00037a6dc8 fffffc00037a6d48 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff0000de9b6000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff0000de9b6080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff0000de9b6100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                                                             ^
 ffff0000de9b6180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff0000de9b6200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/01/04 10:48 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci aafe7ad77b91 28c42cff .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-gce-arm64 KASAN: use-after-free Write in ntfs_perform_write
2024/01/02 03:52 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci aafe7ad77b91 fb427a07 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-gce-arm64 KASAN: use-after-free Write in ntfs_perform_write
* Struck through repros no longer work on HEAD.