syzbot


KASAN: use-after-free Read in __ext4_check_dir_entry

Status: auto-obsoleted due to no activity on 2024/09/17 20:54
Reported-by: syzbot+038172fd3967d56fc244@syzkaller.appspotmail.com
First crash: 135d, last: 98d
Similar bugs (8)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in __ext4_check_dir_entry (3) ext4 C inconclusive 3 13d 9d15h 0/28 upstream: reported C repro on 2024/10/06 17:11
linux-4.14 KASAN: use-after-free Read in __ext4_check_dir_entry C inconclusive 6 1483d 1587d 0/1 upstream: reported C repro on 2020/06/12 02:23
upstream KASAN: use-after-free Read in __ext4_check_dir_entry (2) ext4 C error 1 144d 154d 0/28 closed as dup on 2024/06/26 08:39
linux-5.15 KASAN: use-after-free Read in __ext4_check_dir_entry origin:upstream C 10 24d 135d 0/3 upstream: reported C repro on 2024/06/03 01:15
android-5-15 KASAN: use-after-free Read in __ext4_check_dir_entry origin:upstream missing-backport C error 3 31d 109d 0/2 upstream: reported C repro on 2024/06/28 13:26
upstream KASAN: use-after-free Read in __ext4_check_dir_entry ext4 C 8 2387d 2390d 22/28 closed as dup on 2018/03/31 22:38
android-5-10 KASAN: use-after-free Read in __ext4_check_dir_entry C error 2 40d 158d 0/2 upstream: reported C repro on 2024/05/10 09:19
android-6-1 KASAN: use-after-free Read in __ext4_check_dir_entry origin:upstream missing-backport C error 4 33d 157d 0/2 upstream: reported C repro on 2024/05/11 11:53

Sample crash report:
EXT4-fs warning (device loop1): dx_probe:892: inode #2: comm syz.1.2: dx entry: limit 0 != root limit 124
EXT4-fs warning (device loop1): dx_probe:965: inode #2: comm syz.1.2: Corrupt directory, running e2fsck is recommended
==================================================================
BUG: KASAN: use-after-free in __ext4_check_dir_entry+0x6f3/0x870 fs/ext4/dir.c:85
Read of size 2 at addr ffff88801e5f3003 by task syz.1.2/3634

CPU: 0 PID: 3634 Comm: syz.1.2 Not tainted 6.1.97-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:284 [inline]
 print_report+0x15f/0x4f0 mm/kasan/report.c:395
 kasan_report+0x136/0x160 mm/kasan/report.c:495
 __ext4_check_dir_entry+0x6f3/0x870 fs/ext4/dir.c:85
 ext4_readdir+0x139e/0x3950 fs/ext4/dir.c:258
 iterate_dir+0x224/0x560
 __do_sys_getdents64 fs/readdir.c:369 [inline]
 __se_sys_getdents64+0x209/0x4f0 fs/readdir.c:354
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7f1f8af75bd9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 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:00007f1f8bd57048 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9
RAX: ffffffffffffffda RBX: 00007f1f8b103f60 RCX: 00007f1f8af75bd9
RDX: 0000000000000010 RSI: 0000000000000000 RDI: 0000000000000008
RBP: 00007f1f8afe4e60 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f1f8b103f60 R15: 00007ffdcccd8618
 </TASK>

Allocated by task 3536:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 __kasan_slab_alloc+0x65/0x70 mm/kasan/common.c:328
 kasan_slab_alloc include/linux/kasan.h:201 [inline]
 slab_post_alloc_hook+0x52/0x3a0 mm/slab.h:737
 slab_alloc_node mm/slub.c:3398 [inline]
 kmem_cache_alloc_node+0x136/0x310 mm/slub.c:3443
 __alloc_skb+0xde/0x670 net/core/skbuff.c:505
 alloc_skb include/linux/skbuff.h:1271 [inline]
 netlink_alloc_large_skb net/netlink/af_netlink.c:1198 [inline]
 netlink_sendmsg+0x6f8/0xd60 net/netlink/af_netlink.c:1849
 sock_sendmsg_nosec net/socket.c:718 [inline]
 __sock_sendmsg net/socket.c:730 [inline]
 ____sys_sendmsg+0x5a5/0x8f0 net/socket.c:2514
 ___sys_sendmsg net/socket.c:2568 [inline]
 __sys_sendmsg+0x2a9/0x390 net/socket.c:2597
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Freed by task 3536:
 kasan_save_stack mm/kasan/common.c:45 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:52
 kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516
 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236
 kasan_slab_free include/linux/kasan.h:177 [inline]
 slab_free_hook mm/slub.c:1724 [inline]
 slab_free_freelist_hook mm/slub.c:1750 [inline]
 slab_free mm/slub.c:3661 [inline]
 kmem_cache_free+0x292/0x510 mm/slub.c:3683
 netlink_unicast_kernel net/netlink/af_netlink.c:1327 [inline]
 netlink_unicast+0x7e0/0x970 net/netlink/af_netlink.c:1352
 netlink_sendmsg+0xa26/0xd60 net/netlink/af_netlink.c:1874
 sock_sendmsg_nosec net/socket.c:718 [inline]
 __sock_sendmsg net/socket.c:730 [inline]
 ____sys_sendmsg+0x5a5/0x8f0 net/socket.c:2514
 ___sys_sendmsg net/socket.c:2568 [inline]
 __sys_sendmsg+0x2a9/0x390 net/socket.c:2597
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

The buggy address belongs to the object at ffff88801e5f3000
 which belongs to the cache skbuff_head_cache of size 240
The buggy address is located 3 bytes inside of
 240-byte region [ffff88801e5f3000, ffff88801e5f30f0)

The buggy address belongs to the physical page:
page:ffffea0000797cc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1e5f3
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 0000000000000000 dead000000000001 ffff8880127f9000
raw: 0000000000000000 00000000000c000c 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 3003, tgid 3003 (udevadm), ts 15713841705, free_ts 15711701603
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2517
 prep_new_page mm/page_alloc.c:2524 [inline]
 get_page_from_freelist+0x322e/0x33b0 mm/page_alloc.c:4283
 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5551
 alloc_slab_page+0x6a/0x150 mm/slub.c:1794
 allocate_slab mm/slub.c:1939 [inline]
 new_slab+0x84/0x2d0 mm/slub.c:1992
 ___slab_alloc+0xc20/0x1270 mm/slub.c:3180
 __slab_alloc mm/slub.c:3279 [inline]
 slab_alloc_node mm/slub.c:3364 [inline]
 kmem_cache_alloc_node+0x1cf/0x310 mm/slub.c:3443
 __alloc_skb+0xde/0x670 net/core/skbuff.c:505
 alloc_skb include/linux/skbuff.h:1271 [inline]
 alloc_uevent_skb+0x74/0x220 lib/kobject_uevent.c:290
 uevent_net_broadcast_untagged lib/kobject_uevent.c:326 [inline]
 kobject_uevent_net_broadcast+0x2e5/0x560 lib/kobject_uevent.c:409
 kobject_uevent_env+0x576/0x8c0 lib/kobject_uevent.c:593
 kobject_synth_uevent+0x4eb/0xae0 lib/kobject_uevent.c:208
 uevent_store+0x47/0x70 drivers/base/bus.c:581
 kernfs_fop_write_iter+0x3a2/0x4f0 fs/kernfs/file.c:330
 call_write_iter include/linux/fs.h:2265 [inline]
 new_sync_write fs/read_write.c:491 [inline]
 vfs_write+0x7ae/0xba0 fs/read_write.c:584
 ksys_write+0x19c/0x2c0 fs/read_write.c:637
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1444 [inline]
 free_pcp_prepare mm/page_alloc.c:1494 [inline]
 free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3362
 free_unref_page+0x33/0x3e0 mm/page_alloc.c:3457
 free_slab mm/slub.c:2031 [inline]
 discard_slab mm/slub.c:2037 [inline]
 __unfreeze_partials+0x1b7/0x210 mm/slub.c:2586
 put_cpu_partial+0x17b/0x250 mm/slub.c:2662
 qlink_free mm/kasan/quarantine.c:168 [inline]
 qlist_free_all+0x76/0xe0 mm/kasan/quarantine.c:187
 kasan_quarantine_reduce+0x156/0x170 mm/kasan/quarantine.c:294
 __kasan_slab_alloc+0x1f/0x70 mm/kasan/common.c:305
 kasan_slab_alloc include/linux/kasan.h:201 [inline]
 slab_post_alloc_hook+0x52/0x3a0 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+0x10c/0x2d0 mm/slub.c:3422
 getname_flags+0xb8/0x4f0 fs/namei.c:139
 do_sys_openat2+0xd2/0x500 fs/open.c:1312
 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+0x243/0x290 fs/open.c:1345
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x68/0xd2

Memory state around the buggy address:
 ffff88801e5f2f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88801e5f2f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff88801e5f3000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                   ^
 ffff88801e5f3080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc
 ffff88801e5f3100: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
==================================================================

Crashes (15):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/07/09 20:53 linux-6.1.y 7753af06eebf 79d68ada .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __ext4_check_dir_entry
2024/07/09 20:53 linux-6.1.y 7753af06eebf 79d68ada .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __ext4_check_dir_entry
2024/07/09 20:52 linux-6.1.y 7753af06eebf 79d68ada .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __ext4_check_dir_entry
2024/07/09 09:14 linux-6.1.y 7753af06eebf bc23a442 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __ext4_check_dir_entry
2024/07/09 09:14 linux-6.1.y 7753af06eebf bc23a442 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __ext4_check_dir_entry
2024/07/08 13:15 linux-6.1.y 7753af06eebf cde64f7d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __ext4_check_dir_entry
2024/07/08 13:14 linux-6.1.y 7753af06eebf cde64f7d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __ext4_check_dir_entry
2024/07/08 13:14 linux-6.1.y 7753af06eebf cde64f7d .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __ext4_check_dir_entry
2024/07/06 23:41 linux-6.1.y 7753af06eebf 2a40360c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __ext4_check_dir_entry
2024/06/08 20:19 linux-6.1.y 88690811da69 82c05ab8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __ext4_check_dir_entry
2024/06/08 20:18 linux-6.1.y 88690811da69 82c05ab8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __ext4_check_dir_entry
2024/06/04 00:26 linux-6.1.y 88690811da69 a1feae05 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __ext4_check_dir_entry
2024/06/03 18:59 linux-6.1.y 88690811da69 0aba2352 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __ext4_check_dir_entry
2024/06/03 18:58 linux-6.1.y 88690811da69 0aba2352 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __ext4_check_dir_entry
2024/06/03 01:11 linux-6.1.y 88690811da69 3113787f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: use-after-free Read in __ext4_check_dir_entry
* Struck through repros no longer work on HEAD.