syzbot


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

Status: auto-obsoleted due to no activity on 2024/01/25 22:09
Reported-by: syzbot+d75998c6ad14bd56c83d@syzkaller.appspotmail.com
First crash: 242d, last: 199d
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-use-after-free Read in __ext4_iget fs reiserfs 278 94d 332d 0/26 auto-obsoleted due to no activity on 2024/04/09 13:42
android-5-15 KASAN: use-after-free Read in __ext4_iget origin:lts syz 52 41d 311d 0/2 premoderation: reported syz repro on 2023/06/28 10:27
android-5-10 KASAN: use-after-free Read in __ext4_iget syz 81 24d 310d 0/2 premoderation: reported syz repro on 2023/06/28 15:01
linux-6.1 KASAN: slab-out-of-bounds Read in __ext4_iget 14 33d 289d 0/3 upstream: reported on 2023/07/19 22:47
linux-5.15 KASAN: use-after-free Read in __ext4_iget 6 22d 94d 0/3 upstream: reported on 2024/01/31 03:06

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in __ext4_iget+0x2ee/0x3f00 fs/ext4/inode.c:4641
Read of size 8 at addr ffff8880373d7f40 by task syz-executor.3/28035

CPU: 0 PID: 28035 Comm: syz-executor.3 Not tainted 5.15.130-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/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+0x63/0x3b0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0x16b/0x1c0 mm/kasan/report.c:451
 __ext4_iget+0x2ee/0x3f00 fs/ext4/inode.c:4641
 ext4_fill_super+0x7e9d/0xa110 fs/ext4/super.c:4832
 mount_bdev+0x2c9/0x3f0 fs/super.c:1387
 legacy_get_tree+0xeb/0x180 fs/fs_context.c:611
 vfs_get_tree+0x88/0x270 fs/super.c:1517
 do_new_mount+0x28b/0xae0 fs/namespace.c:2994
 do_mount fs/namespace.c:3337 [inline]
 __do_sys_mount fs/namespace.c:3545 [inline]
 __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3522
 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+0x61/0xcb
RIP: 0033:0x7f0dc75eb1ea
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 09 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f0dc5b6aee8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f0dc5b6af80 RCX: 00007f0dc75eb1ea
RDX: 00000000200004c0 RSI: 0000000020000500 RDI: 00007f0dc5b6af40
RBP: 00000000200004c0 R08: 00007f0dc5b6af80 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 0000000020000500
R13: 00007f0dc5b6af40 R14: 00000000000004a6 R15: 0000000020000c80
 </TASK>

Allocated by task 24873:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:434 [inline]
 __kasan_slab_alloc+0x8e/0xc0 mm/kasan/common.c:467
 kasan_slab_alloc include/linux/kasan.h:254 [inline]
 slab_post_alloc_hook+0x53/0x380 mm/slab.h:519
 slab_alloc_node mm/slub.c:3220 [inline]
 slab_alloc mm/slub.c:3228 [inline]
 kmem_cache_alloc+0xf3/0x280 mm/slub.c:3233
 ovl_alloc_inode+0x1b/0x80 fs/overlayfs/super.c:182
 alloc_inode fs/inode.c:236 [inline]
 iget5_locked+0x9c/0x260 fs/inode.c:1199
 ovl_get_trap_inode+0x86/0x190 fs/overlayfs/inode.c:1047
 ovl_setup_trap fs/overlayfs/super.c:1166 [inline]
 ovl_get_layers fs/overlayfs/super.c:1730 [inline]
 ovl_get_lowerstack+0x110b/0x1fe0 fs/overlayfs/super.c:1836
 ovl_fill_super+0x16d8/0x2a20 fs/overlayfs/super.c:2090
 mount_nodev+0x52/0xe0 fs/super.c:1433
 legacy_get_tree+0xeb/0x180 fs/fs_context.c:611
 vfs_get_tree+0x88/0x270 fs/super.c:1517
 do_new_mount+0x28b/0xae0 fs/namespace.c:2994
 do_mount fs/namespace.c:3337 [inline]
 __do_sys_mount fs/namespace.c:3545 [inline]
 __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3522
 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+0x61/0xcb

Last potentially related work creation:
 kasan_save_stack+0x36/0x60 mm/kasan/common.c:38
 kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348
 __call_rcu kernel/rcu/tree.c:2994 [inline]
 call_rcu+0x1c4/0xa70 kernel/rcu/tree.c:3074
 ovl_free_fs+0x321/0x720 fs/overlayfs/super.c:241
 generic_shutdown_super+0x136/0x2c0 fs/super.c:475
 kill_anon_super+0x37/0x60 fs/super.c:1076
 deactivate_locked_super+0xa0/0x110 fs/super.c:335
 cleanup_mnt+0x44e/0x500 fs/namespace.c:1143
 task_work_run+0x129/0x1a0 kernel/task_work.c:164
 tracehook_notify_resume include/linux/tracehook.h:189 [inline]
 exit_to_user_mode_loop+0x106/0x130 kernel/entry/common.c:175
 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:208
 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline]
 syscall_exit_to_user_mode+0x5d/0x250 kernel/entry/common.c:301
 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x61/0xcb

Second to last potentially related work creation:
 kasan_save_stack+0x36/0x60 mm/kasan/common.c:38
 kasan_record_aux_stack+0xba/0x100 mm/kasan/generic.c:348
 __call_rcu kernel/rcu/tree.c:2994 [inline]
 call_rcu+0x1c4/0xa70 kernel/rcu/tree.c:3074
 ovl_free_fs+0x74/0x720 fs/overlayfs/super.c:227
 generic_shutdown_super+0x136/0x2c0 fs/super.c:475
 kill_anon_super+0x37/0x60 fs/super.c:1076
 deactivate_locked_super+0xa0/0x110 fs/super.c:335
 cleanup_mnt+0x44e/0x500 fs/namespace.c:1143
 task_work_run+0x129/0x1a0 kernel/task_work.c:164
 tracehook_notify_resume include/linux/tracehook.h:189 [inline]
 exit_to_user_mode_loop+0x106/0x130 kernel/entry/common.c:175
 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:208
 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline]
 syscall_exit_to_user_mode+0x5d/0x250 kernel/entry/common.c:301
 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x61/0xcb

The buggy address belongs to the object at ffff8880373d74e0
 which belongs to the cache ovl_inode of size 1368
The buggy address is located 1288 bytes to the right of
 1368-byte region [ffff8880373d74e0, ffff8880373d7a38)
The buggy address belongs to the page:
page:ffffea0000dcf400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x373d0
head:ffffea0000dcf400 order:3 compound_mapcount:0 compound_pincount:0
memcg:ffff88801e236401
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea0000e60a00 0000000200000002 ffff8880189528c0
raw: 0000000000000000 0000000080150015 00000001ffffffff ffff88801e236401
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Reclaimable, gfp_mask 0x1d20d0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 4240, ts 185160191037, free_ts 0
 prep_new_page mm/page_alloc.c:2426 [inline]
 get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159
 __alloc_pages+0x272/0x700 mm/page_alloc.c:5421
 alloc_slab_page mm/slub.c:1775 [inline]
 allocate_slab mm/slub.c:1912 [inline]
 new_slab+0xbb/0x4b0 mm/slub.c:1975
 ___slab_alloc+0x6f6/0xe10 mm/slub.c:3008
 __slab_alloc mm/slub.c:3095 [inline]
 slab_alloc_node mm/slub.c:3186 [inline]
 slab_alloc mm/slub.c:3228 [inline]
 kmem_cache_alloc+0x18e/0x280 mm/slub.c:3233
 ovl_alloc_inode+0x1b/0x80 fs/overlayfs/super.c:182
 alloc_inode fs/inode.c:236 [inline]
 iget5_locked+0x9c/0x260 fs/inode.c:1199
 ovl_get_trap_inode+0x86/0x190 fs/overlayfs/inode.c:1047
 ovl_setup_trap fs/overlayfs/super.c:1166 [inline]
 ovl_get_upper+0x206/0x5f0 fs/overlayfs/super.c:1218
 ovl_fill_super+0x1697/0x2a20 fs/overlayfs/super.c:2066
 mount_nodev+0x52/0xe0 fs/super.c:1433
 legacy_get_tree+0xeb/0x180 fs/fs_context.c:611
 vfs_get_tree+0x88/0x270 fs/super.c:1517
 do_new_mount+0x28b/0xae0 fs/namespace.c:2994
 do_mount fs/namespace.c:3337 [inline]
 __do_sys_mount fs/namespace.c:3545 [inline]
 __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3522
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
page_owner free stack trace missing

Memory state around the buggy address:
 ffff8880373d7e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8880373d7e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880373d7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                                           ^
 ffff8880373d7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8880373d8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/09/04 18:45 linux-5.15.y 8f790700c974 db3306a6 .config console log report info ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Read in __ext4_iget
2023/10/12 11:04 linux-5.15.y 02e21884dcf2 1b231e3c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in __ext4_iget
2023/10/10 08:58 linux-5.15.y 1edcec18cfb7 c9be5398 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in __ext4_iget
2023/09/29 18:51 linux-5.15.y b911329317b4 8e26a358 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in __ext4_iget
2023/09/13 13:12 linux-5.15.y aff03380bda4 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in __ext4_iget
2023/10/17 22:08 linux-5.15.y 02e21884dcf2 342b9c55 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in __ext4_iget
* Struck through repros no longer work on HEAD.