syzbot


KASAN: slab-out-of-bounds Read in __ext4_iget (2)

Status: upstream: reported on 2025/02/01 20:39
Reported-by: syzbot+fb7f7c3d4430262421a7@syzkaller.appspotmail.com
First crash: 161d, last: 9d03h
Similar bugs (10)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-54 KASAN: use-after-free Read in __ext4_iget (3) 19 C 58 48d 122d 0/2 upstream: reported C repro on 2025/03/13 17:21
linux-5.15 KASAN: use-after-free Read in __ext4_iget 19 37 3d01h 529d 0/3 upstream: reported on 2024/01/31 03:06
upstream KASAN: slab-use-after-free Read in __ext4_iget fs reiserfs 19 278 530d 767d 0/29 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 19 C 390 2d23h 102d 0/2 upstream: reported C repro on 2025/04/01 19:00
linux-5.15 KASAN: slab-out-of-bounds Read in __ext4_iget 19 6 634d 677d 0/3 auto-obsoleted due to no activity on 2024/01/25 22:09
android-54 KASAN: use-after-free Read in __ext4_iget 19 13 506d 713d 0/2 auto-obsoleted due to no activity on 2024/05/22 19:07
android-5-10 KASAN: use-after-free Read in __ext4_iget 19 C 322 20h34m 127d 0/2 upstream: reported C repro on 2025/03/08 14:28
linux-6.1 KASAN: slab-out-of-bounds Read in __ext4_iget 19 14 468d 724d 0/3 auto-obsoleted due to no activity on 2024/07/09 19:10
linux-6.1 KASAN: use-after-free Read in __ext4_iget 19 2 304d 346d 0/3 auto-obsoleted due to no activity on 2024/12/21 07:26
android-54 KASAN: use-after-free Read in __ext4_iget (2) 19 4 389d 407d 0/2 auto-obsoleted due to no activity on 2024/09/17 10:19

Sample crash report:
loop2: detected capacity change from 0 to 512
==================================================================
BUG: KASAN: slab-out-of-bounds in check_igot_inode fs/ext4/inode.c:-1 [inline]
BUG: KASAN: slab-out-of-bounds in __ext4_iget+0x2b8/0x3d80 fs/ext4/inode.c:4856
Read of size 8 at addr ffff888075387f30 by task syz.2.3698/12492

CPU: 0 PID: 12492 Comm: syz.2.3698 Not tainted 6.1.142-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:316 [inline]
 print_report+0xa8/0x220 mm/kasan/report.c:427
 kasan_report+0x10b/0x140 mm/kasan/report.c:531
 check_igot_inode fs/ext4/inode.c:-1 [inline]
 __ext4_iget+0x2b8/0x3d80 fs/ext4/inode.c:4856
 __ext4_fill_super fs/ext4/super.c:5402 [inline]
 ext4_fill_super+0x60fd/0x8110 fs/ext4/super.c:5666
 get_tree_bdev+0x3f1/0x610 fs/super.c:1366
 vfs_get_tree+0x88/0x270 fs/super.c:1573
 do_new_mount+0x24a/0xa40 fs/namespace.c:3058
 do_mount fs/namespace.c:3401 [inline]
 __do_sys_mount fs/namespace.c:3609 [inline]
 __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3586
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f6dd9f900ca
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f6ddae9fe68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f6ddae9fef0 RCX: 00007f6dd9f900ca
RDX: 0000200000000140 RSI: 00002000000001c0 RDI: 00007f6ddae9feb0
RBP: 0000200000000140 R08: 00007f6ddae9fef0 R09: 00000000032148d1
R10: 00000000032148d1 R11: 0000000000000246 R12: 00002000000001c0
R13: 00007f6ddae9feb0 R14: 00000000000004e4 R15: 000000000000002c
 </TASK>

Allocated by task 11880:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 __kasan_slab_alloc+0x6b/0x80 mm/kasan/common.c:328
 kasan_slab_alloc include/linux/kasan.h:201 [inline]
 slab_post_alloc_hook+0x4b/0x480 mm/slab.h:737
 slab_alloc_node mm/slub.c:3398 [inline]
 slab_alloc mm/slub.c:3406 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3413 [inline]
 kmem_cache_alloc_lru+0x11a/0x2e0 mm/slub.c:3429
 alloc_inode_sb include/linux/fs.h:3245 [inline]
 alloc_inode fs/inode.c:263 [inline]
 new_inode_pseudo+0x7e/0x1c0 fs/inode.c:1063
 new_inode+0x25/0x1c0 fs/inode.c:1091
 debugfs_get_inode fs/debugfs/inode.c:72 [inline]
 __debugfs_create_file+0x148/0x510 fs/debugfs/inode.c:432
 add_files net/mac80211/debugfs_netdev.c:792 [inline]
 ieee80211_debugfs_add_netdev+0x1ff/0xec0 net/mac80211/debugfs_netdev.c:834
 ieee80211_if_add+0x6bb/0x1590 net/mac80211/iface.c:2275
 ieee80211_register_hw+0x2d46/0x38c0 net/mac80211/main.c:1402
 mac80211_hwsim_new_radio+0x28c2/0x4c40 drivers/net/wireless/mac80211_hwsim.c:4587
 hwsim_new_radio_nl+0xafa/0xce0 drivers/net/wireless/mac80211_hwsim.c:5181
 genl_family_rcv_msg_doit+0x22e/0x320 net/netlink/genetlink.c:756
 genl_family_rcv_msg net/netlink/genetlink.c:833 [inline]
 genl_rcv_msg+0x5f2/0x780 net/netlink/genetlink.c:850
 netlink_rcv_skb+0x1de/0x420 net/netlink/af_netlink.c:2493
 genl_rcv+0x24/0x40 net/netlink/genetlink.c:861
 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline]
 netlink_unicast+0x74c/0x8c0 net/netlink/af_netlink.c:1337
 netlink_sendmsg+0x89e/0xbc0 net/netlink/af_netlink.c:1859
 sock_sendmsg_nosec net/socket.c:718 [inline]
 __sock_sendmsg net/socket.c:730 [inline]
 __sys_sendto+0x44f/0x5c0 net/socket.c:2153
 __do_sys_sendto net/socket.c:2165 [inline]
 __se_sys_sendto net/socket.c:2161 [inline]
 __x64_sys_sendto+0xda/0xf0 net/socket.c:2161
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Last potentially related work creation:
 kasan_save_stack+0x3a/0x60 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:486
 call_rcu+0x14b/0x970 kernel/rcu/tree.c:2845
 destroy_inode fs/inode.c:316 [inline]
 evict+0x7da/0x870 fs/inode.c:720
 __dentry_kill+0x431/0x650 fs/dcache.c:611
 dentry_kill+0xb8/0x290 fs/dcache.c:-1
 dput+0xfa/0x1d0 fs/dcache.c:918
 find_next_child fs/libfs.c:265 [inline]
 simple_recursive_removal+0x289/0x850 fs/libfs.c:280
 debugfs_remove+0x52/0x70 fs/debugfs/inode.c:778
 ieee80211_debugfs_remove_netdev+0x4e/0xa0 net/mac80211/debugfs_netdev.c:842
 ieee80211_teardown_sdata net/mac80211/iface.c:839 [inline]
 ieee80211_if_change_type+0x14c/0xa50 net/mac80211/iface.c:1987
 ieee80211_change_iface+0x58/0x4c0 net/mac80211/cfg.c:217
 rdev_change_virtual_intf net/wireless/rdev-ops.h:74 [inline]
 cfg80211_change_iface+0x7e6/0xf80 net/wireless/util.c:1159
 nl80211_set_interface+0x5db/0x820 net/wireless/nl80211.c:4209
 genl_family_rcv_msg_doit+0x22e/0x320 net/netlink/genetlink.c:756
 genl_family_rcv_msg net/netlink/genetlink.c:833 [inline]
 genl_rcv_msg+0x5f2/0x780 net/netlink/genetlink.c:850
 netlink_rcv_skb+0x1de/0x420 net/netlink/af_netlink.c:2493
 genl_rcv+0x24/0x40 net/netlink/genetlink.c:861
 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline]
 netlink_unicast+0x74c/0x8c0 net/netlink/af_netlink.c:1337
 netlink_sendmsg+0x89e/0xbc0 net/netlink/af_netlink.c:1859
 sock_sendmsg_nosec net/socket.c:718 [inline]
 __sock_sendmsg net/socket.c:730 [inline]
 __sys_sendto+0x44f/0x5c0 net/socket.c:2153
 __do_sys_sendto net/socket.c:2165 [inline]
 __se_sys_sendto net/socket.c:2161 [inline]
 __x64_sys_sendto+0xda/0xf0 net/socket.c:2161
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Second to last potentially related work creation:
 kasan_save_stack+0x3a/0x60 mm/kasan/common.c:45
 __kasan_record_aux_stack+0xb2/0xc0 mm/kasan/generic.c:486
 call_rcu+0x14b/0x970 kernel/rcu/tree.c:2845
 destroy_inode fs/inode.c:316 [inline]
 evict+0x7da/0x870 fs/inode.c:720
 __dentry_kill+0x431/0x650 fs/dcache.c:611
 shrink_dentry_list+0x39b/0x6a0 fs/dcache.c:1206
 shrink_dcache_parent+0xa8/0x3c0 fs/dcache.c:-1
 d_invalidate+0x118/0x260 fs/dcache.c:1742
 lookup_fast+0x310/0x4d0 fs/namei.c:1655
 walk_component fs/namei.c:1994 [inline]
 link_path_walk+0x5f2/0xe50 fs/namei.c:2325
 path_openat+0x276/0x2e70 fs/namei.c:3779
 do_filp_open+0x1c1/0x3c0 fs/namei.c:3810
 do_sys_openat2+0x142/0x490 fs/open.c:1318
 do_sys_open fs/open.c:1334 [inline]
 __do_sys_openat fs/open.c:1350 [inline]
 __se_sys_openat fs/open.c:1345 [inline]
 __x64_sys_openat+0x135/0x160 fs/open.c:1345
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

The buggy address belongs to the object at ffff8880753877b0
 which belongs to the cache inode_cache of size 1168
The buggy address is located 752 bytes to the right of
 1168-byte region [ffff8880753877b0, ffff888075387c40)

The buggy address belongs to the physical page:
page:ffffea0001d4e100 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888075385440 pfn:0x75384
head:ffffea0001d4e100 order:2 compound_mapcount:0 compound_pincount:0
memcg:ffff888027588981
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea0001d2fb08 ffffea0001d25308 ffff8881400098c0
raw: ffff888075385440 00000000000c0003 00000001ffffffff ffff888027588981
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Reclaimable, gfp_mask 0xd20d0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_RECLAIMABLE), pid 3652, tgid 3652 (udevadm), ts 30571963561, free_ts 24073420526
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2532
 prep_new_page mm/page_alloc.c:2539 [inline]
 get_page_from_freelist+0x1a26/0x1ac0 mm/page_alloc.c:4328
 __alloc_pages+0x1df/0x4e0 mm/page_alloc.c:5614
 alloc_slab_page+0x5d/0x160 mm/slub.c:1794
 allocate_slab mm/slub.c:1939 [inline]
 new_slab+0x87/0x2c0 mm/slub.c:1992
 ___slab_alloc+0xbc6/0x1220 mm/slub.c:3180
 __slab_alloc mm/slub.c:3279 [inline]
 slab_alloc_node mm/slub.c:3364 [inline]
 slab_alloc mm/slub.c:3406 [inline]
 __kmem_cache_alloc_lru mm/slub.c:3413 [inline]
 kmem_cache_alloc_lru+0x1ae/0x2e0 mm/slub.c:3429
 alloc_inode_sb include/linux/fs.h:3245 [inline]
 alloc_inode fs/inode.c:263 [inline]
 iget_locked+0x206/0x830 fs/inode.c:1373
 kernfs_get_inode+0x4b/0x6d0 fs/kernfs/inode.c:254
 kernfs_iop_lookup+0x25f/0x380 fs/kernfs/dir.c:1189
 __lookup_slow+0x27d/0x3a0 fs/namei.c:1690
 lookup_slow+0x53/0x70 fs/namei.c:1707
 walk_component+0x2be/0x3f0 fs/namei.c:1998
 lookup_last fs/namei.c:2455 [inline]
 path_lookupat+0x169/0x440 fs/namei.c:2479
 filename_lookup+0x1f0/0x500 fs/namei.c:2508
 user_path_at_empty+0x3e/0x60 fs/namei.c:2905
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1459 [inline]
 free_pcp_prepare mm/page_alloc.c:1509 [inline]
 free_unref_page_prepare+0x8b4/0x9a0 mm/page_alloc.c:3384
 free_unref_page+0x2e/0x3f0 mm/page_alloc.c:3479
 free_contig_range+0x9d/0x150 mm/page_alloc.c:9574
 destroy_args+0xef/0x8bf mm/debug_vm_pgtable.c:1031
 debug_vm_pgtable+0x32a/0x37e mm/debug_vm_pgtable.c:1354
 do_one_initcall+0x214/0x7a0 init/main.c:1298
 do_initcall_level+0x137/0x1e4 init/main.c:1371
 do_initcalls+0x4b/0x8a init/main.c:1387
 kernel_init_freeable+0x3fa/0x5ac init/main.c:1626
 kernel_init+0x19/0x1b0 init/main.c:1514
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

Memory state around the buggy address:
 ffff888075387e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888075387e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888075387f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                                     ^
 ffff888075387f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888075388000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (14):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/07/04 14:57 linux-6.1.y 7e69c33e4858 d869b261 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: slab-out-of-bounds Read in __ext4_iget
2025/02/01 20:38 linux-6.1.y 0cbb5f65e52f 568559e4 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: slab-out-of-bounds Read in __ext4_iget
2025/04/03 18:14 linux-6.1.y 8e60a714ba3b d7ae3a11 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in __ext4_iget
2025/04/02 05:44 linux-6.1.y 8e60a714ba3b c799dfdd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: slab-out-of-bounds Read in __ext4_iget
2025/06/21 02:05 linux-6.1.y 58485ff1a74f d6cdfb8a .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __ext4_iget
2025/06/05 22:51 linux-6.1.y 58485ff1a74f 6b6b5f21 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __ext4_iget
2025/05/21 12:00 linux-6.1.y 325285d9fc86 dc5d3808 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __ext4_iget
2025/04/01 02:21 linux-6.1.y 8e60a714ba3b 36d76a97 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __ext4_iget
2025/03/13 08:29 linux-6.1.y 6ae7ac5c4251 44be8b44 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __ext4_iget
2025/05/05 10:00 linux-6.1.y ac7079a42ea5 b0714e37 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in __ext4_iget
2025/04/15 10:20 linux-6.1.y 420102835862 23b969b7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in __ext4_iget
2025/04/01 22:53 linux-6.1.y 8e60a714ba3b b8645499 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in __ext4_iget
2025/03/29 17:06 linux-6.1.y 8e60a714ba3b d3999433 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in __ext4_iget
2025/03/13 13:25 linux-6.1.y 344a09659766 44be8b44 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 KASAN: use-after-free Read in __ext4_iget
* Struck through repros no longer work on HEAD.