syzbot


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

Status: auto-obsoleted due to no activity on 2023/08/22 15:25
Subsystems: nilfs
[Documentation on labels]
Reported-by: syzbot+cac676135771fc8f1eb2@syzkaller.appspotmail.com
First crash: 518d, last: 314d
Discussions (3)
Title Replies (including bot) Last reply
[syzbot] Monthly nilfs report (Apr 2023) 0 (1) 2023/04/27 10:39
[syzbot] Monthly nilfs report 0 (1) 2023/03/27 11:03
[syzbot] KASAN: slab-out-of-bounds Read in nilfs_iget_test 0 (1) 2022/10/04 08:55
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 KASAN: slab-out-of-bounds Read in nilfs_iget_test 1 221d 221d 0/3 auto-obsoleted due to no activity on 2023/11/04 02:15
linux-5.15 KASAN: slab-out-of-bounds Read in nilfs_iget_test 2 148d 188d 0/3 auto-obsoleted due to no activity on 2024/01/15 12:29

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in nilfs_iget_test+0x3e4/0x440 fs/nilfs2/inode.c:544
Read of size 8 at addr ffff88803ae5e1f0 by task syz-executor.3/12441

CPU: 1 PID: 12441 Comm: syz-executor.3 Not tainted 6.3.0-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+0xd9/0x150 lib/dump_stack.c:106
 print_address_description.constprop.0+0x2c/0x3c0 mm/kasan/report.c:319
 print_report mm/kasan/report.c:430 [inline]
 kasan_report+0x11c/0x130 mm/kasan/report.c:536
 nilfs_iget_test+0x3e4/0x440 fs/nilfs2/inode.c:544
 find_inode+0xe4/0x220 fs/inode.c:916
 ilookup5_nowait fs/inode.c:1429 [inline]
 ilookup5 fs/inode.c:1458 [inline]
 iget5_locked+0xb5/0x2c0 fs/inode.c:1239
 nilfs_iget_locked+0xa4/0xe0 fs/nilfs2/inode.c:605
 nilfs_dat_read+0x88/0x370 fs/nilfs2/dat.c:508
 nilfs_load_super_root fs/nilfs2/the_nilfs.c:120 [inline]
 load_nilfs+0x366/0x1340 fs/nilfs2/the_nilfs.c:301
 nilfs_fill_super fs/nilfs2/super.c:1069 [inline]
 nilfs_mount+0xb52/0x1160 fs/nilfs2/super.c:1326
 legacy_get_tree+0x109/0x220 fs/fs_context.c:610
 vfs_get_tree+0x8d/0x350 fs/super.c:1510
 do_new_mount fs/namespace.c:3042 [inline]
 path_mount+0x1342/0x1e40 fs/namespace.c:3372
 do_mount fs/namespace.c:3385 [inline]
 __do_sys_mount fs/namespace.c:3594 [inline]
 __se_sys_mount fs/namespace.c:3571 [inline]
 __x64_sys_mount+0x283/0x300 fs/namespace.c:3571
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fc461e8d69a
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:00007fc462c5df88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000000004581 RCX: 00007fc461e8d69a
RDX: 00000000200045c0 RSI: 0000000020004600 RDI: 00007fc462c5dfe0
RBP: 00007fc462c5e020 R08: 00007fc462c5e020 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 00000000200045c0
R13: 0000000020004600 R14: 00007fc462c5dfe0 R15: 0000000020004640
 </TASK>

Allocated by task 10547:
 kasan_save_stack+0x22/0x40 mm/kasan/common.c:45
 kasan_set_track+0x25/0x30 mm/kasan/common.c:52
 __kasan_slab_alloc+0x7f/0x90 mm/kasan/common.c:328
 kasan_slab_alloc include/linux/kasan.h:186 [inline]
 slab_post_alloc_hook mm/slab.h:769 [inline]
 slab_alloc_node mm/slub.c:3452 [inline]
 slab_alloc mm/slub.c:3460 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3467 [inline]
 kmem_cache_alloc_lru+0x20a/0x600 mm/slub.c:3483
 alloc_inode_sb include/linux/fs.h:2686 [inline]
 f2fs_alloc_inode+0x103/0x5c0 fs/f2fs/super.c:1371
 alloc_inode+0x61/0x230 fs/inode.c:260
 iget_locked+0x1bb/0x700 fs/inode.c:1287
 f2fs_iget+0x63/0x5600 fs/f2fs/inode.c:504
 f2fs_fill_super+0x2fe5/0x8bb0 fs/f2fs/super.c:4254
 mount_bdev+0x351/0x410 fs/super.c:1380
 legacy_get_tree+0x109/0x220 fs/fs_context.c:610
 vfs_get_tree+0x8d/0x350 fs/super.c:1510
 do_new_mount fs/namespace.c:3042 [inline]
 path_mount+0x1342/0x1e40 fs/namespace.c:3372
 do_mount fs/namespace.c:3385 [inline]
 __do_sys_mount fs/namespace.c:3594 [inline]
 __se_sys_mount fs/namespace.c:3571 [inline]
 __x64_sys_mount+0x283/0x300 fs/namespace.c:3571
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Last potentially related work creation:
 kasan_save_stack+0x22/0x40 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:491
 __call_rcu_common.constprop.0+0x99/0x7e0 kernel/rcu/tree.c:2622
 destroy_inode+0x129/0x1b0 fs/inode.c:315
 iput_final fs/inode.c:1748 [inline]
 iput.part.0+0x50a/0x740 fs/inode.c:1774
 iput+0x5c/0x80 fs/inode.c:1764
 f2fs_put_super+0x4f7/0xc50 fs/f2fs/super.c:1600
 generic_shutdown_super+0x158/0x480 fs/super.c:500
 kill_block_super+0x9b/0xf0 fs/super.c:1407
 kill_f2fs_super+0x2af/0x3c0 fs/f2fs/super.c:4635
 deactivate_locked_super+0x98/0x160 fs/super.c:331
 deactivate_super+0xb1/0xd0 fs/super.c:362
 cleanup_mnt+0x2ae/0x3d0 fs/namespace.c:1177
 task_work_run+0x16f/0x270 kernel/task_work.c:179
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 exit_to_user_mode_loop kernel/entry/common.c:171 [inline]
 exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204
 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline]
 syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297
 do_syscall_64+0x46/0xb0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Second to last potentially related work creation:
 kasan_save_stack+0x22/0x40 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:491
 __call_rcu_common.constprop.0+0x99/0x7e0 kernel/rcu/tree.c:2622
 destroy_inode+0x129/0x1b0 fs/inode.c:315
 iput_final fs/inode.c:1748 [inline]
 iput.part.0+0x50a/0x740 fs/inode.c:1774
 iput+0x5c/0x80 fs/inode.c:1764
 f2fs_put_super+0x4a3/0xc50 fs/f2fs/super.c:1597
 generic_shutdown_super+0x158/0x480 fs/super.c:500
 kill_block_super+0x9b/0xf0 fs/super.c:1407
 kill_f2fs_super+0x2af/0x3c0 fs/f2fs/super.c:4635
 deactivate_locked_super+0x98/0x160 fs/super.c:331
 deactivate_super+0xb1/0xd0 fs/super.c:362
 cleanup_mnt+0x2ae/0x3d0 fs/namespace.c:1177
 task_work_run+0x16f/0x270 kernel/task_work.c:179
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 exit_to_user_mode_loop kernel/entry/common.c:171 [inline]
 exit_to_user_mode_prepare+0x210/0x240 kernel/entry/common.c:204
 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline]
 syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297
 do_syscall_64+0x46/0xb0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

The buggy address belongs to the object at ffff88803ae5d910
 which belongs to the cache f2fs_inode_cache of size 2152
The buggy address is located 120 bytes to the right of
 allocated 2152-byte region [ffff88803ae5d910, ffff88803ae5e178)

The buggy address belongs to the physical page:
page:ffffea0000eb9600 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88803ae5a3a0 pfn:0x3ae58
head:ffffea0000eb9600 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
memcg:ffff888075f31e01
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffff88801c0a5c80 ffffea0000e65200 dead000000000004
raw: ffff88803ae5a3a0 00000000800e0001 00000001ffffffff ffff888075f31e01
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Reclaimable, gfp_mask 0x1d2050(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 10842, tgid 10840 (syz-executor.3), ts 564218335623, free_ts 529799079197
 prep_new_page mm/page_alloc.c:2553 [inline]
 get_page_from_freelist+0x1190/0x2e20 mm/page_alloc.c:4326
 __alloc_pages+0x1cb/0x4a0 mm/page_alloc.c:5592
 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2277
 alloc_slab_page mm/slub.c:1851 [inline]
 allocate_slab+0x25f/0x390 mm/slub.c:1998
 new_slab mm/slub.c:2051 [inline]
 ___slab_alloc+0xa91/0x1400 mm/slub.c:3193
 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3292
 __slab_alloc_node mm/slub.c:3345 [inline]
 slab_alloc_node mm/slub.c:3442 [inline]
 slab_alloc mm/slub.c:3460 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3467 [inline]
 kmem_cache_alloc_lru+0x4a8/0x600 mm/slub.c:3483
 alloc_inode_sb include/linux/fs.h:2686 [inline]
 f2fs_alloc_inode+0x103/0x5c0 fs/f2fs/super.c:1371
 alloc_inode+0x61/0x230 fs/inode.c:260
 new_inode_pseudo fs/inode.c:1019 [inline]
 new_inode+0x2b/0x280 fs/inode.c:1047
 f2fs_new_inode+0xe1/0x2750 fs/f2fs/namei.c:217
 f2fs_mkdir+0x16a/0x630 fs/f2fs/namei.c:756
 vfs_mkdir+0x242/0x460 fs/namei.c:4038
 do_mkdirat+0x28d/0x310 fs/namei.c:4061
 __do_sys_mkdirat fs/namei.c:4076 [inline]
 __se_sys_mkdirat fs/namei.c:4074 [inline]
 __x64_sys_mkdirat+0x119/0x170 fs/namei.c:4074
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1454 [inline]
 free_pcp_prepare+0x5d5/0xa50 mm/page_alloc.c:1504
 free_unref_page_prepare mm/page_alloc.c:3388 [inline]
 free_unref_page+0x1d/0x490 mm/page_alloc.c:3483
 __unfreeze_partials+0x17c/0x1a0 mm/slub.c:2637
 qlink_free mm/kasan/quarantine.c:168 [inline]
 qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187
 kasan_quarantine_reduce+0x192/0x220 mm/kasan/quarantine.c:294
 __kasan_slab_alloc+0x63/0x90 mm/kasan/common.c:305
 kasan_slab_alloc include/linux/kasan.h:186 [inline]
 slab_post_alloc_hook mm/slab.h:769 [inline]
 slab_alloc_node mm/slub.c:3452 [inline]
 slab_alloc mm/slub.c:3460 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3467 [inline]
 kmem_cache_alloc+0x17c/0x3b0 mm/slub.c:3476
 getname_flags.part.0+0x50/0x4f0 fs/namei.c:140
 getname_flags include/linux/audit.h:321 [inline]
 getname+0x92/0xd0 fs/namei.c:219
 do_sys_openat2+0xf5/0x4c0 fs/open.c:1342
 do_sys_open fs/open.c:1364 [inline]
 __do_sys_openat fs/open.c:1380 [inline]
 __se_sys_openat fs/open.c:1375 [inline]
 __x64_sys_openat+0x143/0x1f0 fs/open.c:1375
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Memory state around the buggy address:
 ffff88803ae5e080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff88803ae5e100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc
>ffff88803ae5e180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc 00
                                                             ^
 ffff88803ae5e200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88803ae5e280: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (21):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/04/24 15:24 upstream 457391b03803 fdc18293 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in nilfs_iget_test
2023/04/14 22:55 upstream 95abc817ab3a ec410564 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: slab-out-of-bounds Read in nilfs_iget_test
2023/04/12 20:35 upstream 0bcc40255504 82d5e53e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: slab-out-of-bounds Read in nilfs_iget_test
2023/04/12 03:33 upstream e62252bc55b6 49faf98d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: slab-out-of-bounds Read in nilfs_iget_test
2023/04/08 00:35 upstream aa318c48808c 71147e29 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: slab-out-of-bounds Read in nilfs_iget_test
2023/03/30 07:31 upstream ffe78bbd5121 f325deb0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: slab-out-of-bounds Read in nilfs_iget_test
2023/03/29 02:18 upstream fcd476ea6a88 fc067f05 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root KASAN: slab-out-of-bounds Read in nilfs_iget_test
2023/03/16 06:22 upstream 9c1bec9c0b08 18b58603 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in nilfs_iget_test
2023/01/24 22:12 upstream 7bf70dbb1882 9dfcf09c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root KASAN: slab-out-of-bounds Read in nilfs_iget_test
2022/12/23 00:26 upstream 0a924817d2ed 9da18ae8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: slab-out-of-bounds Read in nilfs_iget_test
2022/12/07 21:33 upstream 8ed710da2873 d88f3abb .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: slab-out-of-bounds Read in nilfs_iget_test
2022/12/07 12:17 upstream 8ed710da2873 d88f3abb .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: slab-out-of-bounds Read in nilfs_iget_test
2022/11/29 11:32 upstream ca57f02295f1 ca9683b8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: slab-out-of-bounds Read in nilfs_iget_test
2022/11/15 11:28 upstream e01d50cbd6ee 97de9cfc .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: slab-out-of-bounds Read in nilfs_iget_test
2022/11/13 11:44 upstream fef7fd48922d f42ee5d8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: slab-out-of-bounds Read in nilfs_iget_test
2022/11/12 09:40 upstream 8f2975c2bb4c f42ee5d8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: slab-out-of-bounds Read in nilfs_iget_test
2022/10/03 00:43 upstream a962b54e162c feb56351 .config console log report info [disk image] [vmlinux] ci2-upstream-fs KASAN: slab-out-of-bounds Read in nilfs_iget_test
2023/01/06 21:39 linux-next cc3c08b41a9c 1dac8c7a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root KASAN: slab-out-of-bounds Read in nilfs_iget_test
2023/04/12 18:19 git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci 7920df21c1b7 1a1596b6 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-gce-arm64 KASAN: slab-out-of-bounds Read in nilfs_iget_test
2022/12/14 07:42 upstream 02bf43c7b7f7 f6511626 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: use-after-free Read in nilfs_iget_test
2022/12/07 03:37 upstream 8ed710da2873 d88f3abb .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs KASAN: use-after-free Read in nilfs_iget_test
* Struck through repros no longer work on HEAD.