syzbot


WARNING in wnd_init

Status: upstream: reported C repro on 2022/09/29 08:15
Reported-by: syzbot+fa4648a5446460b7b963@syzkaller.appspotmail.com
Fix commit: fs/ntfs3: Use __GFP_NOWARN allocation at wnd_init() fs/ntfs3: Validate attribute data and valid sizes
Patched on: [ci-upstream-linux-next-kasan-gce-root], missing on: [ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-qemu2-riscv64 ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce ci-upstream-kmsan-gce-386 ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb]
First crash: 66d, last: 5d18h

Cause bisection: introduced by (bisect log) :
commit fa3cacf544636b2dc48cfb2f277a2071f14d66a2
Author: Kari Argillander <kari.argillander@gmail.com>
Date: Thu Aug 26 08:56:29 2021 +0000

  fs/ntfs3: Use kernel ALIGN macros over driver specific

Crash: WARNING in wnd_init (log)
Repro: C syz .config
Patch testing requests:
Created Duration User Patch Repo Result
2022/10/03 16:44 16m abdun.nihaal@gmail.com patch upstream OK log
2022/10/02 11:35 16m kari.argillander@gmail.com patch https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux master OK log

Sample crash report:
loop0: detected capacity change from 0 to 8192
ntfs3: loop0: Different NTFS' sector size (4096) and media sector size (512)
------------[ cut here ]------------
WARNING: CPU: 0 PID: 3630 at mm/page_alloc.c:5534 __alloc_pages+0x30a/0x560 mm/page_alloc.c:5534
Modules linked in:
CPU: 0 PID: 3630 Comm: syz-executor107 Not tainted 6.1.0-rc6-syzkaller-00308-g644e9524388a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
RIP: 0010:__alloc_pages+0x30a/0x560 mm/page_alloc.c:5534
Code: 5c 24 04 0f 85 f3 00 00 00 44 89 e1 81 e1 7f ff ff ff a9 00 00 04 00 41 0f 44 cc 41 89 cc e9 e3 00 00 00 c6 05 51 7b 8f 0c 01 <0f> 0b 83 fb 0a 0f 86 c8 fd ff ff 31 db 48 c7 44 24 20 0e 36 e0 45
RSP: 0018:ffffc90003bbf8e0 EFLAGS: 00010246
RAX: ffffc90003bbf940 RBX: 000000000000000c RCX: 0000000000000000
RDX: 0000000000000028 RSI: 0000000000000000 RDI: ffffc90003bbf968
RBP: ffffc90003bbf9f8 R08: dffffc0000000000 R09: ffffc90003bbf940
R10: fffff52000777f2d R11: 1ffff92000777f28 R12: 0000000000040d40
R13: 1ffff92000777f24 R14: dffffc0000000000 R15: 1ffff92000777f20
FS:  0000555555ecd300(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f46e07f5a70 CR3: 00000000299f2000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __alloc_pages_node include/linux/gfp.h:223 [inline]
 alloc_pages_node include/linux/gfp.h:246 [inline]
 __kmalloc_large_node+0x8a/0x1a0 mm/slab_common.c:1096
 __do_kmalloc_node mm/slab_common.c:943 [inline]
 __kmalloc+0xfe/0x1a0 mm/slab_common.c:968
 kmalloc_array include/linux/slab.h:605 [inline]
 kcalloc include/linux/slab.h:636 [inline]
 wnd_init+0x1db/0x310 fs/ntfs3/bitmap.c:664
 ntfs_fill_super+0x28ce/0x42a0 fs/ntfs3/super.c:1058
 get_tree_bdev+0x400/0x620 fs/super.c:1324
 vfs_get_tree+0x88/0x270 fs/super.c:1531
 do_new_mount+0x289/0xad0 fs/namespace.c:3040
 do_mount fs/namespace.c:3383 [inline]
 __do_sys_mount fs/namespace.c:3591 [inline]
 __se_sys_mount+0x2d3/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:0x7f029dd81ada
Code: 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff454249f8 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f029dd81ada
RDX: 0000000020020b80 RSI: 0000000020020bc0 RDI: 00007fff45424a10
RBP: 00007fff45424a10 R08: 00007fff45424a50 R09: 0000000000020b6a
R10: 0000000000000000 R11: 0000000000000286 R12: 0000000000000004
R13: 0000555555ecd2c0 R14: 0000000000000000 R15: 00007fff45424a50
 </TASK>

Crashes (19):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci2-upstream-fs 2022/11/26 17:56 upstream 644e9524388a f4470a7b .config log report syz C WARNING in wnd_init
ci-upstream-kasan-gce-root 2022/10/01 16:23 upstream ffb4d94b4314 feb56351 .config log report syz C WARNING in wnd_init
ci2-upstream-fs 2022/09/29 06:37 upstream 49c13ed0316d a41a2080 .config log report syz C WARNING in wnd_init
ci-upstream-linux-next-kasan-gce-root 2022/10/27 22:07 linux-next 4d48f589d294 86777b7f .config log report syz C WARNING in wnd_init
ci-upstream-gce-arm64 2022/11/27 07:25 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 6d464646530f 74a66371 .config log report syz C WARNING in wnd_init
ci-upstream-gce-arm64 2022/09/27 16:03 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci c194837ebb57 87840e00 .config log report syz C WARNING in wnd_init
ci2-upstream-fs 2022/11/21 07:36 upstream eb7081409f94 5bb70014 .config log report info WARNING in wnd_init
ci2-upstream-fs 2022/11/21 05:25 upstream eb7081409f94 5bb70014 .config log report info WARNING in wnd_init
ci2-upstream-fs 2022/11/19 06:05 upstream ab290eaddc4c 5bb70014 .config log report info WARNING in wnd_init
ci2-upstream-fs 2022/11/15 06:56 upstream e01d50cbd6ee 97de9cfc .config log report info WARNING in wnd_init
ci2-upstream-fs 2022/11/11 11:36 upstream 4bbf3422df78 f42ee5d8 .config log report info WARNING in wnd_init
ci2-upstream-fs 2022/11/04 20:52 upstream ee6050c8af96 6d752409 .config log report info WARNING in wnd_init
ci2-upstream-fs 2022/11/03 19:18 upstream b229b6ca5abb 7a2ebf95 .config log report info WARNING in wnd_init
ci2-upstream-fs 2022/10/31 09:16 upstream b229b6ca5abb 2a71366b .config log report info WARNING in wnd_init
ci2-upstream-fs 2022/10/17 14:01 upstream 493ffd6605b2 67cb024c .config log report info WARNING in wnd_init
ci2-upstream-fs 2022/10/16 15:26 upstream 493ffd6605b2 67cb024c .config log report info WARNING in wnd_init
ci2-upstream-fs 2022/10/15 13:39 upstream 493ffd6605b2 67cb024c .config log report info WARNING in wnd_init
ci2-upstream-fs 2022/10/13 08:54 upstream 493ffd6605b2 3f6b40a1 .config log report info WARNING in wnd_init
ci2-upstream-fs 2022/10/03 09:13 upstream a962b54e162c feb56351 .config log report info WARNING in wnd_init
* Struck through repros no longer work on HEAD.