syzbot


KASAN: slab-out-of-bounds Read in run_unpack

Status: upstream: reported C repro on 2022/09/22 22:46
Reported-by: syzbot+8d6fbb27a6aded64b25b@syzkaller.appspotmail.com
Fix commit: fs/ntfs3: Fix slab-out-of-bounds read in run_unpack
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: 81d, last: 1d23h
Patch testing requests:
Created Duration User Patch Repo Result
2022/09/23 10:27 16m yin31149@gmail.com patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master OK log
2022/09/23 03:17 16m yin31149@gmail.com patch https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master OK log

Sample crash report:
loop0: detected capacity change from 0 to 4096
ntfs3: loop0: Different NTFS' sector size (1024) and media sector size (512)
==================================================================
BUG: KASAN: slab-out-of-bounds in run_unpack+0x8b7/0x970 fs/ntfs3/run.c:944
Read of size 1 at addr ffff888021cac100 by task syz-executor283/3602

CPU: 0 PID: 3602 Comm: syz-executor283 Not tainted 6.1.0-rc2-syzkaller-00105-gb229b6ca5abb #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:284 [inline]
 print_report+0x15e/0x45d mm/kasan/report.c:395
 kasan_report+0xbb/0x1f0 mm/kasan/report.c:495
 run_unpack+0x8b7/0x970 fs/ntfs3/run.c:944
 run_unpack_ex+0xb0/0x7c0 fs/ntfs3/run.c:1057
 ntfs_read_mft fs/ntfs3/inode.c:368 [inline]
 ntfs_iget5+0xc20/0x3280 fs/ntfs3/inode.c:501
 ntfs_fill_super+0x258b/0x37f0 fs/ntfs3/super.c:1095
 get_tree_bdev+0x440/0x760 fs/super.c:1323
 vfs_get_tree+0x89/0x2f0 fs/super.c:1530
 do_new_mount fs/namespace.c:3040 [inline]
 path_mount+0x1326/0x1e20 fs/namespace.c:3370
 do_mount fs/namespace.c:3383 [inline]
 __do_sys_mount fs/namespace.c:3591 [inline]
 __se_sys_mount fs/namespace.c:3568 [inline]
 __x64_sys_mount+0x27f/0x300 fs/namespace.c:3568
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f97de22c36a
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:00007ffe3c8bfc18 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f97de22c36a
RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007ffe3c8bfc30
RBP: 00007ffe3c8bfc30 R08: 00007ffe3c8bfc70 R09: 00007ffe3c8bfca0
R10: 0000000000000000 R11: 0000000000000286 R12: 0000000000000004
R13: 00007ffe3c8bfc70 R14: 0000000000000107 R15: 0000000020001aa8
 </TASK>

The buggy address belongs to the object at ffff888021cac000
 which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 256 bytes inside of
 1024-byte region [ffff888021cac000, ffff888021cac400)

The buggy address belongs to the physical page:
page:ffffea0000872a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x21ca8
head:ffffea0000872a00 order:3 compound_mapcount:0 compound_pincount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 0000000000000000 dead000000000122 ffff888011841dc0
raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd2040(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3602, tgid 3602 (syz-executor283), ts 36561645555, free_ts 36544098627
 prep_new_page mm/page_alloc.c:2538 [inline]
 get_page_from_freelist+0x10b5/0x2d50 mm/page_alloc.c:4287
 __alloc_pages+0x1c7/0x5a0 mm/page_alloc.c:5554
 alloc_pages+0x1a6/0x270 mm/mempolicy.c:2285
 alloc_slab_page mm/slub.c:1794 [inline]
 allocate_slab+0x213/0x300 mm/slub.c:1939
 new_slab mm/slub.c:1992 [inline]
 ___slab_alloc+0xa91/0x1400 mm/slub.c:3180
 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3279
 slab_alloc_node mm/slub.c:3364 [inline]
 __kmem_cache_alloc_node+0x191/0x3e0 mm/slub.c:3437
 __do_kmalloc_node mm/slab_common.c:954 [inline]
 __kmalloc+0x44/0xc0 mm/slab_common.c:968
 kmalloc include/linux/slab.h:581 [inline]
 kzalloc include/linux/slab.h:712 [inline]
 ntfs_init_from_boot fs/ntfs3/super.c:837 [inline]
 ntfs_fill_super+0x1360/0x37f0 fs/ntfs3/super.c:935
 get_tree_bdev+0x440/0x760 fs/super.c:1323
 vfs_get_tree+0x89/0x2f0 fs/super.c:1530
 do_new_mount fs/namespace.c:3040 [inline]
 path_mount+0x1326/0x1e20 fs/namespace.c:3370
 do_mount fs/namespace.c:3383 [inline]
 __do_sys_mount fs/namespace.c:3591 [inline]
 __se_sys_mount fs/namespace.c:3568 [inline]
 __x64_sys_mount+0x27f/0x300 fs/namespace.c:3568
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1458 [inline]
 free_pcp_prepare+0x65c/0xd90 mm/page_alloc.c:1508
 free_unref_page_prepare mm/page_alloc.c:3386 [inline]
 free_unref_page+0x19/0x4d0 mm/page_alloc.c:3482
 __unfreeze_partials+0x17c/0x1a0 mm/slub.c:2586
 qlink_free mm/kasan/quarantine.c:168 [inline]
 qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187
 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:294
 __kasan_slab_alloc+0x62/0x80 mm/kasan/common.c:302
 kasan_slab_alloc include/linux/kasan.h:201 [inline]
 slab_post_alloc_hook mm/slab.h:737 [inline]
 slab_alloc_node mm/slub.c:3398 [inline]
 kmem_cache_alloc_node+0x2fc/0x400 mm/slub.c:3443
 __alloc_skb+0x210/0x2f0 net/core/skbuff.c:497
 alloc_skb_fclone include/linux/skbuff.h:1317 [inline]
 tcp_stream_alloc_skb+0x38/0x580 net/ipv4/tcp.c:862
 tcp_sendmsg_locked+0xc4b/0x2960 net/ipv4/tcp.c:1325
 tcp_sendmsg+0x2b/0x40 net/ipv4/tcp.c:1483
 inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:825
 sock_sendmsg_nosec net/socket.c:714 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:734
 sock_write_iter+0x291/0x3d0 net/socket.c:1108
 call_write_iter include/linux/fs.h:2191 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x9e9/0xdd0 fs/read_write.c:584
 ksys_write+0x1e8/0x250 fs/read_write.c:637

Memory state around the buggy address:
 ffff888021cac000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888021cac080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888021cac100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                   ^
 ffff888021cac180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888021cac200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (92):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-root 2022/11/01 08:46 upstream b229b6ca5abb a1d8560a .config log report syz C KASAN: slab-out-of-bounds Read in run_unpack
ci2-upstream-fs 2022/10/22 21:36 upstream 440b7895c990 c0b80a55 .config log report syz C KASAN: slab-out-of-bounds Read in run_unpack
ci-upstream-kasan-gce-root 2022/10/15 23:13 upstream 55be6084c8e0 67cb024c .config log report syz C KASAN: slab-out-of-bounds Read in run_unpack
ci2-upstream-fs 2022/10/09 05:13 upstream a6afa4199d3d aea5da89 .config log report syz C KASAN: slab-out-of-bounds Read in run_unpack
ci2-upstream-fs 2022/09/30 10:24 upstream 987a926c1d8a 45fd7169 .config log report syz C KASAN: slab-out-of-bounds Read in run_unpack
ci2-upstream-fs 2022/09/30 02:10 upstream c3e0e1e23c70 45fd7169 .config log report syz C KASAN: slab-out-of-bounds Read in run_unpack
ci2-upstream-fs 2022/09/29 05:30 upstream 49c13ed0316d a41a2080 .config log report syz C KASAN: slab-out-of-bounds Read in run_unpack
ci-upstream-kasan-gce-root 2022/09/24 17:26 upstream a63f2e7cb110 0042f2b4 .config log report syz C KASAN: slab-out-of-bounds Read in run_unpack
ci-upstream-kasan-gce-root 2022/09/19 00:54 upstream 38eddeedbbea dd9a85ff .config log report syz C KASAN: slab-out-of-bounds Read in run_unpack
ci-upstream-kasan-gce-root 2022/10/09 15:34 upstream a6afa4199d3d aea5da89 .config log report syz C KASAN: use-after-free Read in run_unpack
ci-upstream-kasan-gce-root 2022/10/08 20:37 upstream e8bc52cb8df8 aea5da89 .config log report syz C KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/10/03 22:00 upstream 4fe89d07dcc2 feb56351 .config log report syz C KASAN: use-after-free Read in run_unpack
ci-upstream-kasan-gce-root 2022/10/03 19:10 upstream 4fe89d07dcc2 feb56351 .config log report syz C KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/10/03 05:57 upstream a962b54e162c feb56351 .config log report syz C KASAN: use-after-free Read in run_unpack
ci-upstream-kasan-gce-root 2022/10/03 04:53 upstream a962b54e162c feb56351 .config log report syz C KASAN: use-after-free Read in run_unpack
ci-upstream-kasan-gce-root 2022/10/01 15:58 upstream ffb4d94b4314 feb56351 .config log report syz C KASAN: use-after-free Read in run_unpack
ci-upstream-kasan-gce-root 2022/09/29 20:58 upstream c3e0e1e23c70 1d385642 .config log report syz C KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/09/27 20:19 upstream 3800a713b607 10323ddf .config log report syz C KASAN: use-after-free Read in run_unpack
ci-upstream-linux-next-kasan-gce-root 2022/09/18 23:07 linux-next e47eb90a0a9a dd9a85ff .config log report syz C KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/12/07 06:40 upstream 8ed710da2873 d88f3abb .config log report info KASAN: slab-out-of-bounds Read in run_unpack
ci2-upstream-fs 2022/12/03 15:59 upstream 97ee9d1c1696 e080de16 .config log report info KASAN: slab-out-of-bounds Read in run_unpack
ci-upstream-kasan-gce-selinux-root 2022/11/23 01:20 upstream eb7081409f94 9da37ae8 .config log report info KASAN: slab-out-of-bounds Read in run_unpack
ci2-upstream-fs 2022/11/19 16:34 upstream ab290eaddc4c 5bb70014 .config log report info KASAN: slab-out-of-bounds Read in run_unpack
ci2-upstream-fs 2022/11/19 13:57 upstream ab290eaddc4c 5bb70014 .config log report info KASAN: slab-out-of-bounds Read in run_unpack
ci2-upstream-fs 2022/11/19 09:07 upstream ab290eaddc4c 5bb70014 .config log report info KASAN: slab-out-of-bounds Read in run_unpack
ci2-upstream-fs 2022/11/17 23:56 upstream 81ac25651a62 4ba8ab94 .config log report info KASAN: slab-out-of-bounds Read in run_unpack
ci2-upstream-fs 2022/11/15 16:55 upstream e01d50cbd6ee 97de9cfc .config log report info KASAN: slab-out-of-bounds Read in run_unpack
ci2-upstream-fs 2022/11/12 13:42 upstream 8f2975c2bb4c f42ee5d8 .config log report info KASAN: slab-out-of-bounds Read in run_unpack
ci2-upstream-fs 2022/11/11 03:13 upstream 1767a722a708 3ead01ad .config log report info KASAN: slab-out-of-bounds Read in run_unpack
ci2-upstream-fs 2022/11/09 19:51 upstream f141df371335 bebca8b7 .config log report info KASAN: slab-out-of-bounds Read in run_unpack
ci2-upstream-fs 2022/11/08 16:15 upstream 59f2f4b8a757 060f945e .config log report info KASAN: slab-out-of-bounds Read in run_unpack
ci2-upstream-fs 2022/11/06 06:18 upstream b208b9fbbcba 6d752409 .config log report info KASAN: slab-out-of-bounds Read in run_unpack
ci2-upstream-fs 2022/11/02 19:27 upstream b229b6ca5abb 08977f5d .config log report info KASAN: slab-out-of-bounds Read in run_unpack
ci2-upstream-fs 2022/10/30 13:34 upstream b229b6ca5abb 2a71366b .config log report info KASAN: slab-out-of-bounds Read in run_unpack
ci2-upstream-fs 2022/10/29 09:46 upstream b229b6ca5abb 899d812a .config log report info KASAN: slab-out-of-bounds Read in run_unpack
ci-upstream-kasan-gce-smack-root 2022/10/27 05:25 upstream 98555239e4c3 86777b7f .config log report info KASAN: slab-out-of-bounds Read in run_unpack
ci2-upstream-fs 2022/10/24 20:41 upstream 247f34f7b803 faae2fda .config log report info KASAN: slab-out-of-bounds Read in run_unpack
ci2-upstream-fs 2022/10/19 19:16 upstream 493ffd6605b2 b31320fc .config log report info KASAN: slab-out-of-bounds Read in run_unpack
ci2-upstream-fs 2022/10/18 06:51 upstream 493ffd6605b2 94744d21 .config log report info KASAN: slab-out-of-bounds Read in run_unpack
ci-upstream-linux-next-kasan-gce-root 2022/09/18 22:41 linux-next e47eb90a0a9a dd9a85ff .config log report info KASAN: slab-out-of-bounds Read in run_unpack
ci2-upstream-fs 2022/11/21 14:42 upstream eb7081409f94 5bb70014 .config log report info KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/11/21 13:14 upstream eb7081409f94 5bb70014 .config log report info KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/11/21 02:41 upstream 77c51ba552a1 5bb70014 .config log report info KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/11/20 21:19 upstream 77c51ba552a1 5bb70014 .config log report info KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/11/17 04:32 upstream 59d0d52c30d4 3a127a31 .config log report info KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/11/16 06:27 upstream 81e7cfa3a9eb 3a127a31 .config log report info KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/11/15 10:24 upstream e01d50cbd6ee 97de9cfc .config log report info KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/11/13 00:15 upstream 8f2975c2bb4c f42ee5d8 .config log report info KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/11/12 19:52 upstream 8f2975c2bb4c f42ee5d8 .config log report info KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/11/12 02:43 upstream eb037f16f7e8 f42ee5d8 .config log report info KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/11/11 01:53 upstream 1767a722a708 3ead01ad .config log report info KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/11/09 21:09 upstream f141df371335 bebca8b7 .config log report info KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/11/08 03:51 upstream 59f2f4b8a757 6feb842b .config log report info KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/11/03 01:42 upstream b229b6ca5abb 08977f5d .config log report info KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/11/02 12:32 upstream b229b6ca5abb 08977f5d .config log report info KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/11/01 13:13 upstream b229b6ca5abb a1d8560a .config log report info KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/11/01 00:30 upstream b229b6ca5abb 2a71366b .config log report info KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/10/30 17:33 upstream b229b6ca5abb 2a71366b .config log report info KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/10/30 04:35 upstream b229b6ca5abb 2a71366b .config log report info KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/10/27 01:36 upstream 4dc12f37a8e9 86777b7f .config log report info KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/10/26 05:39 upstream 1a2dcbdde82e 2159e4d2 .config log report info KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/10/23 19:32 upstream d47136c28015 23bf86af .config log report info KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/10/23 16:29 upstream d47136c28015 23bf86af .config log report info KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/10/23 14:47 upstream d47136c28015 23bf86af .config log report info KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/10/20 09:01 upstream 493ffd6605b2 b31320fc .config log report info KASAN: use-after-free Read in run_unpack
ci2-upstream-fs 2022/10/19 17:09 upstream 493ffd6605b2 b31320fc .config log report info KASAN: use-after-free Read in run_unpack
ci-qemu-upstream 2022/09/23 22:20 upstream 1707c39ae309 0042f2b4 .config log report info KASAN: use-after-free Read in run_unpack
* Struck through repros no longer work on HEAD.