syzbot


KASAN: use-after-free Read in ext4_group_desc_csum

Status: auto-obsoleted due to no activity on 2023/08/15 14:19
Reported-by: syzbot+89d42537785a9b402274@syzkaller.appspotmail.com
First crash: 420d, last: 366d
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-5-10 KASAN: slab-out-of-bounds Read in ext4_group_desc_csum ext4 C error inconclusive 11 318d 420d 2/2 fixed on 2023/06/13 08:16
upstream KASAN: slab-out-of-bounds Read in ext4_group_desc_csum ext4 C error 26 339d 440d 22/26 fixed on 2023/07/01 16:05
android-5-15 KASAN: use-after-free Read in ext4_group_desc_csum ext4 origin:upstream C error 4 358d 429d 2/2 fixed on 2023/06/16 14:10
linux-5.15 KASAN: use-after-free Read in ext4_group_desc_csum 1 359d 359d 0/3 auto-obsoleted due to no activity on 2023/08/22 11:08

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in crc16+0x1fc/0x280 lib/crc16.c:58
Read of size 1 at addr ffff8881a4959000 by task syz-executor.2/9176

CPU: 0 PID: 9176 Comm: syz-executor.2 Not tainted 5.4.225-syzkaller-00007-g250ac66f1853 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/16/2023
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1d8/0x241 lib/dump_stack.c:118
 print_address_description+0x8c/0x600 mm/kasan/report.c:384
 __kasan_report+0xf3/0x120 mm/kasan/report.c:516
 kasan_report+0x30/0x60 mm/kasan/common.c:653
 crc16+0x1fc/0x280 lib/crc16.c:58
 ext4_group_desc_csum+0x90b/0xc40 fs/ext4/super.c:2544
 ext4_group_desc_csum_set+0x197/0x230 fs/ext4/super.c:2567
 ext4_mb_mark_diskspace_used+0xa2d/0x1130 fs/ext4/mballoc.c:3035
 ext4_mb_new_blocks+0x7d0/0x2d10 fs/ext4/mballoc.c:4594
 ext4_ext_map_blocks+0x1e70/0x7450 fs/ext4/extents.c:4511
 ext4_map_blocks+0xa83/0x1c40 fs/ext4/inode.c:659
 _ext4_get_block+0x21b/0x610 fs/ext4/inode.c:810
 ext4_block_write_begin+0x685/0x1180 fs/ext4/inode.c:1221
 ext4_write_begin+0x5ba/0x1900 fs/ext4/inode.c:1359
 ext4_da_write_begin+0x4a3/0xfe0 fs/ext4/inode.c:3117
 generic_perform_write+0x2c7/0x560 mm/filemap.c:3311
 __generic_file_write_iter+0x239/0x490 mm/filemap.c:3440
 ext4_file_write_iter+0x499/0x10e0 fs/ext4/file.c:270
 call_write_iter include/linux/fs.h:1981 [inline]
 new_sync_write fs/read_write.c:483 [inline]
 __vfs_write+0x5d3/0x750 fs/read_write.c:496
 vfs_write+0x206/0x4e0 fs/read_write.c:558
 ksys_write+0x199/0x2c0 fs/read_write.c:611
 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x5c/0xc1

Allocated by task 8732:
 save_stack mm/kasan/common.c:70 [inline]
 set_track mm/kasan/common.c:78 [inline]
 __kasan_kmalloc+0x130/0x1d0 mm/kasan/common.c:529
 slab_post_alloc_hook mm/slab.h:584 [inline]
 slab_alloc_node mm/slub.c:2829 [inline]
 slab_alloc mm/slub.c:2837 [inline]
 kmem_cache_alloc+0xd0/0x220 mm/slub.c:2842
 kmem_cache_zalloc include/linux/slab.h:680 [inline]
 __proc_create+0x419/0xa00 fs/proc/generic.c:424
 _proc_mkdir+0xd3/0x200 fs/proc/generic.c:488
 proc_net_mkdir include/linux/proc_fs.h:145 [inline]
 proc_net_ns_init+0x29f/0x3c0 fs/proc/proc_net.c:350
 ops_init+0x1d7/0x4e0 net/core/net_namespace.c:138
 setup_net+0x214/0x990 net/core/net_namespace.c:345
 copy_net_ns+0x30f/0x510 net/core/net_namespace.c:486
 create_new_namespaces+0x47a/0x570 kernel/nsproxy.c:103
 copy_namespaces+0x169/0x1b0 kernel/nsproxy.c:161
 copy_process+0x12da/0x3230 kernel/fork.c:2044
 _do_fork+0x197/0x900 kernel/fork.c:2391
 __do_sys_clone kernel/fork.c:2549 [inline]
 __se_sys_clone kernel/fork.c:2530 [inline]
 __x64_sys_clone+0x26b/0x2c0 kernel/fork.c:2530
 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x5c/0xc1

Freed by task 6932:
 save_stack mm/kasan/common.c:70 [inline]
 set_track mm/kasan/common.c:78 [inline]
 kasan_set_free_info mm/kasan/common.c:345 [inline]
 __kasan_slab_free+0x178/0x230 mm/kasan/common.c:487
 slab_free_hook mm/slub.c:1455 [inline]
 slab_free_freelist_hook mm/slub.c:1494 [inline]
 slab_free mm/slub.c:3080 [inline]
 kmem_cache_free+0xd5/0x290 mm/slub.c:3096
 remove_proc_entry+0x411/0x530 fs/proc/generic.c:708
 proc_net_ns_exit+0x43/0x60 fs/proc/proc_net.c:366
 ops_exit_list net/core/net_namespace.c:179 [inline]
 cleanup_net+0x665/0xc90 net/core/net_namespace.c:609
 process_one_work+0x765/0xd20 kernel/workqueue.c:2287
 worker_thread+0xaef/0x1470 kernel/workqueue.c:2433
 kthread+0x2da/0x360 kernel/kthread.c:288
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354

The buggy address belongs to the object at ffff8881a4959000
 which belongs to the cache proc_dir_entry of size 192
The buggy address is located 0 bytes inside of
 192-byte region [ffff8881a4959000, ffff8881a49590c0)
The buggy address belongs to the page:
page:ffffea0006925640 refcount:1 mapcount:0 mapping:ffff8881f5cfa280 index:0x0
flags: 0x8000000000000200(slab)
raw: 8000000000000200 dead000000000100 dead000000000122 ffff8881f5cfa280
raw: 0000000000000000 0000000000100010 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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY)
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook mm/page_alloc.c:2165 [inline]
 prep_new_page+0x18f/0x370 mm/page_alloc.c:2171
 get_page_from_freelist+0x2ce8/0x2d70 mm/page_alloc.c:3794
 __alloc_pages_nodemask+0x393/0x840 mm/page_alloc.c:4891
 alloc_slab_page+0x39/0x3c0 mm/slub.c:343
 allocate_slab mm/slub.c:1683 [inline]
 new_slab+0x97/0x440 mm/slub.c:1749
 new_slab_objects mm/slub.c:2505 [inline]
 ___slab_alloc+0x2fe/0x490 mm/slub.c:2667
 __slab_alloc+0x5a/0x90 mm/slub.c:2707
 slab_alloc_node mm/slub.c:2792 [inline]
 slab_alloc mm/slub.c:2837 [inline]
 kmem_cache_alloc+0x100/0x220 mm/slub.c:2842
 kmem_cache_zalloc include/linux/slab.h:680 [inline]
 __proc_create+0x419/0xa00 fs/proc/generic.c:424
 proc_create_reg fs/proc/generic.c:551 [inline]
 proc_create_single_data+0x123/0x240 fs/proc/generic.c:644
 snmp6_register_dev+0xa1/0x110 net/ipv6/proc.c:254
 ipv6_add_dev+0x51d/0x1070 net/ipv6/addrconf.c:408
 addrconf_notify+0x59b/0xe50 net/ipv6/addrconf.c:3534
 notifier_call_chain kernel/notifier.c:98 [inline]
 __raw_notifier_call_chain kernel/notifier.c:399 [inline]
 raw_notifier_call_chain+0x95/0x110 kernel/notifier.c:406
 call_netdevice_notifiers_info net/core/dev.c:1670 [inline]
 call_netdevice_notifiers_extack net/core/dev.c:1682 [inline]
 call_netdevice_notifiers net/core/dev.c:1696 [inline]
 register_netdevice+0xeef/0x12a0 net/core/dev.c:9207
 __ip_tunnel_create+0x2b0/0x370 net/ipv4/ip_tunnel.c:267
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1176 [inline]
 __free_pages_ok+0x83d/0x940 mm/page_alloc.c:1438
 free_the_page mm/page_alloc.c:4953 [inline]
 __free_pages+0x91/0x140 mm/page_alloc.c:4959
 __free_slab+0x221/0x2e0 mm/slub.c:1774
 free_slab mm/slub.c:1789 [inline]
 discard_slab mm/slub.c:1795 [inline]
 unfreeze_partials+0x14e/0x180 mm/slub.c:2288
 put_cpu_partial+0xb4/0x150 mm/slub.c:2324
 __slab_free+0x288/0x350 mm/slub.c:2971
 qlist_free_all+0x43/0xb0 mm/kasan/quarantine.c:167
 quarantine_reduce+0x174/0x190 mm/kasan/quarantine.c:260
 __kasan_kmalloc+0x43/0x1d0 mm/kasan/common.c:507
 slab_post_alloc_hook mm/slab.h:584 [inline]
 slab_alloc_node mm/slub.c:2829 [inline]
 slab_alloc mm/slub.c:2837 [inline]
 __kmalloc+0x100/0x2b0 mm/slub.c:3909
 kmalloc include/linux/slab.h:561 [inline]
 kzalloc include/linux/slab.h:690 [inline]
 ops_init+0x85/0x4e0 net/core/net_namespace.c:128
 setup_net+0x214/0x990 net/core/net_namespace.c:345
 copy_net_ns+0x30f/0x510 net/core/net_namespace.c:486
 create_new_namespaces+0x47a/0x570 kernel/nsproxy.c:103
 copy_namespaces+0x169/0x1b0 kernel/nsproxy.c:161
 copy_process+0x12da/0x3230 kernel/fork.c:2044

Memory state around the buggy address:
 ffff8881a4958f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff8881a4958f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffff8881a4959000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                   ^
 ffff8881a4959080: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff8881a4959100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/03/04 09:43 android12-5.4 250ac66f1853 f8902b57 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-4-kasan KASAN: use-after-free Read in ext4_group_desc_csum
2023/02/23 01:38 android12-5.4 66c3e3ab77a2 9f1e2cb3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-4-kasan KASAN: use-after-free Read in ext4_group_desc_csum
2023/04/17 14:19 android12-5.4 21086923c1e6 c6ec7083 .config console log report info ci2-android-5-4-kasan KASAN: slab-out-of-bounds Read in ext4_group_desc_csum
2023/04/06 05:06 android12-5.4 21086923c1e6 8b834965 .config console log report info ci2-android-5-4-kasan KASAN: slab-out-of-bounds Read in ext4_group_desc_csum
2023/04/04 17:56 android12-5.4 a6b5274af71b 928dd177 .config console log report info ci2-android-5-4-kasan KASAN: slab-out-of-bounds Read in ext4_group_desc_csum
2023/02/23 11:32 android12-5.4 66c3e3ab77a2 9e2ebb3c .config console log report info [disk image] [vmlinux] [kernel image] ci2-android-5-4-kasan KASAN: slab-out-of-bounds Read in ext4_group_desc_csum
* Struck through repros no longer work on HEAD.