syzbot


KASAN: use-after-free Read in ntfs_attr_find

Status: auto-obsoleted due to no activity on 2023/08/21 05:46
Reported-by: syzbot+279eca13fc32f1cad97f@syzkaller.appspotmail.com
First crash: 591d, last: 580d
Similar bugs (9)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 KASAN: use-after-free Read in ntfs_attr_find missing-backport origin:lts-only C done 5 43d 307d 0/3 upstream: reported C repro on 2024/01/20 12:39
upstream KASAN: use-after-free Read in ntfs_attr_find ntfs3 C done 74 654d 820d 22/28 fixed on 2023/02/24 13:50
linux-4.14 KASAN: slab-out-of-bounds Read in ntfs_attr_find (2) C 31 635d 820d 0/1 upstream: reported C repro on 2022/08/25 11:21
upstream KASAN: use-after-free Read in ntfs_attr_find (2) ntfs3 C error done 22 279d 632d 0/28 auto-obsoleted due to no activity on 2024/05/28 05:52
linux-4.19 KASAN: use-after-free Read in ntfs_attr_find (2) C 1 636d 636d 0/1 upstream: reported C repro on 2023/02/26 02:15
linux-4.14 KASAN: use-after-free Read in ntfs_attr_find C done 4 1502d 1521d 1/1 fixed on 2020/11/12 10:36
linux-4.19 KASAN: use-after-free Read in ntfs_attr_find C done 13 1487d 1518d 1/1 fixed on 2020/11/27 11:32
linux-6.1 KASAN: use-after-free Read in ntfs_attr_find (2) origin:upstream missing-backport C inconclusive 2 191d 337d 0/3 upstream: reported C repro on 2023/12/22 04:54
linux-5.15 KASAN: slab-out-of-bounds Read in ntfs_attr_find 1 579d 579d 0/3 auto-obsoleted due to no activity on 2023/08/22 04:27

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in ntfs_attr_find+0x7d6/0xd50 fs/ntfs/attrib.c:609
Read of size 2 at addr ffff8880af6880a2 by task syz-executor.2/25929

CPU: 0 PID: 25929 Comm: syz-executor.2 Not tainted 6.1.25-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:284 [inline]
 print_report+0x15f/0x4f0 mm/kasan/report.c:395
 kasan_report+0x136/0x160 mm/kasan/report.c:495
 ntfs_attr_find+0x7d6/0xd50 fs/ntfs/attrib.c:609
 ntfs_attr_lookup+0x4e0/0x2390
 ntfs_read_locked_inode+0xd80/0x49c0 fs/ntfs/inode.c:999
 ntfs_read_inode_mount+0xda2/0x2660 fs/ntfs/inode.c:2098
 ntfs_fill_super+0x1880/0x2bd0 fs/ntfs/super.c:2855
 mount_bdev+0x26d/0x3a0 fs/super.c:1423
 legacy_get_tree+0xeb/0x180 fs/fs_context.c:610
 vfs_get_tree+0x88/0x270 fs/super.c:1553
 do_new_mount+0x28b/0xad0 fs/namespace.c:3040
 do_mount fs/namespace.c:3383 [inline]
 __do_sys_mount fs/namespace.c:3591 [inline]
 __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3568
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fd42fe8d69a
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:00007fd430cd7f88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 000000000001f604 RCX: 00007fd42fe8d69a
RDX: 000000002001f6c0 RSI: 000000002001f640 RDI: 00007fd430cd7fe0
RBP: 00007fd430cd8020 R08: 00007fd430cd8020 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 000000002001f6c0
R13: 000000002001f640 R14: 00007fd430cd7fe0 R15: 000000002001f680
 </TASK>

The buggy address belongs to the physical page:
page:ffffea0002bda200 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0xaf688
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 ffffea0002bfc248 ffffea0002b9e588 0000000000000000
raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as freed
page last allocated via order 0, migratetype Movable, gfp_mask 0x140dca(GFP_HIGHUSER_MOVABLE|__GFP_COMP|__GFP_ZERO), pid 25861, tgid 25861 (syz-executor.1), ts 2687554096085, free_ts 2687699907287
 prep_new_page mm/page_alloc.c:2540 [inline]
 get_page_from_freelist+0x32ed/0x3480 mm/page_alloc.c:4292
 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5559
 __folio_alloc+0xf/0x30 mm/page_alloc.c:5591
 vma_alloc_folio+0x486/0x990 mm/mempolicy.c:2248
 alloc_page_vma include/linux/gfp.h:284 [inline]
 do_anonymous_page mm/memory.c:4123 [inline]
 handle_pte_fault mm/memory.c:4962 [inline]
 __handle_mm_fault mm/memory.c:5106 [inline]
 handle_mm_fault+0x2b04/0x5140 mm/memory.c:5227
 do_user_addr_fault arch/x86/mm/fault.c:1428 [inline]
 handle_page_fault arch/x86/mm/fault.c:1519 [inline]
 exc_page_fault+0x58d/0x790 arch/x86/mm/fault.c:1575
 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1460 [inline]
 free_pcp_prepare mm/page_alloc.c:1510 [inline]
 free_unref_page_prepare+0xf5e/0x1110 mm/page_alloc.c:3388
 free_unref_page_list+0x107/0x810 mm/page_alloc.c:3530
 release_pages+0x2836/0x2b40 mm/swap.c:1055
 tlb_batch_pages_flush mm/mmu_gather.c:59 [inline]
 tlb_flush_mmu_free mm/mmu_gather.c:254 [inline]
 tlb_flush_mmu+0xfc/0x210 mm/mmu_gather.c:261
 zap_pte_range mm/memory.c:1515 [inline]
 zap_pmd_range mm/memory.c:1564 [inline]
 zap_pud_range mm/memory.c:1593 [inline]
 zap_p4d_range mm/memory.c:1614 [inline]
 unmap_page_range+0x2112/0x26e0 mm/memory.c:1635
 unmap_vmas+0x3c4/0x560 mm/memory.c:1720
 exit_mmap+0x252/0x9f0 mm/mmap.c:3089
 __mmput+0x115/0x3c0 kernel/fork.c:1191
 exit_mm+0x226/0x300 kernel/exit.c:563
 do_exit+0x67e/0x2300 kernel/exit.c:856
 do_group_exit+0x202/0x2b0 kernel/exit.c:1019
 get_signal+0x16f7/0x17d0 kernel/signal.c:2858
 arch_do_signal_or_restart+0xb0/0x1a10 arch/x86/kernel/signal.c:869
 exit_to_user_mode_loop+0x6a/0x100 kernel/entry/common.c:168
 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:204
 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline]
 syscall_exit_to_user_mode+0x60/0x270 kernel/entry/common.c:297

Memory state around the buggy address:
 ffff8880af687f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8880af688000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8880af688080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
                               ^
 ffff8880af688100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
 ffff8880af688180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/04/23 05:46 linux-6.1.y f17b0ab65d17 2b32bd34 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in ntfs_attr_find
2023/04/12 10:40 linux-6.1.y 543aff194ab6 1a1596b6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in ntfs_attr_find
2023/04/12 03:04 linux-6.1.y 543aff194ab6 49faf98d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in ntfs_attr_find
* Struck through repros no longer work on HEAD.