syzbot


KASAN: use-after-free Write in diWrite

Status: upstream: reported C repro on 2024/09/20 20:20
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+32799a32790e9973dc5b@syzkaller.appspotmail.com
First crash: 129d, last: 1d12h
Bug presence (1)
Date Name Commit Repro Result
2025/01/03 upstream (ToT) 0bc21e701a6f C [report] KASAN: slab-out-of-bounds Write in diWrite
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: slab-out-of-bounds Write in diWrite jfs C inconclusive 20 10d 277d 0/28 upstream: reported C repro on 2024/04/25 21:10
linux-4.19 KASAN: use-after-free Write in diWrite syz error 2 831d 832d 0/1 upstream: reported syz repro on 2022/10/19 03:08
upstream UBSAN: array-index-out-of-bounds in diWrite jfs C error done 13 410d 829d 25/28 fixed on 2024/01/30 15:47
Last patch testing requests (1)
Created Duration User Patch Repo Result
2025/01/11 23:07 31m retest repro linux-5.15.y report log

Sample crash report:
loop0: detected capacity change from 0 to 32768
==================================================================
BUG: KASAN: slab-out-of-bounds in diWrite+0xddb/0x19b0 fs/jfs/jfs_imap.c:753
Write of size 32 at addr ffff88801f7270c0 by task syz-executor411/4164

CPU: 1 PID: 4164 Comm: syz-executor411 Not tainted 5.15.175-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2d0 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
 kasan_check_range+0x27e/0x290 mm/kasan/generic.c:189
 memcpy+0x3c/0x60 mm/kasan/shadow.c:66
 diWrite+0xddb/0x19b0 fs/jfs/jfs_imap.c:753
 txCommit+0xa13/0x6ba0 fs/jfs/jfs_txnmgr.c:1255
 add_missing_indices+0x8af/0xbf0 fs/jfs/jfs_dtree.c:2959
 jfs_readdir+0x2008/0x3bc0 fs/jfs/jfs_dtree.c:3315
 iterate_dir+0x224/0x570
 __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:50 [inline]
 do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f0b357ea159
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 1c 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc9ac7a618 EFLAGS: 00000246 ORIG_RAX: 00000000000000d9
RAX: ffffffffffffffda RBX: 00007f0b3582e269 RCX: 00007f0b357ea159
RDX: 000000000000009e RSI: 0000000020000280 RDI: 0000000000000004
RBP: 00007f0b3582e239 R08: 00007ffc9ac7a690 R09: 00007ffc9ac7a690
R10: 00007ffc9ac7a690 R11: 0000000000000246 R12: 00007f0b3582e1d7
R13: 00007f0b3582e0ed R14: 00007f0b3582e05f R15: 00007ffc9ac7a648
 </TASK>

Allocated by task 1:
 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_kmalloc+0xba/0xf0 mm/kasan/common.c:513
 kasan_kmalloc include/linux/kasan.h:264 [inline]
 kmem_cache_alloc_trace+0x143/0x290 mm/slub.c:3247
 kmalloc include/linux/slab.h:591 [inline]
 kzalloc include/linux/slab.h:721 [inline]
 drm_property_add_enum+0x1b2/0x3c0 drivers/gpu/drm/drm_property.c:420
 drm_property_create_enum+0xb0/0x140 drivers/gpu/drm/drm_property.c:177
 drm_connector_create_standard_properties+0x14b/0x240 drivers/gpu/drm/drm_connector.c:1288
 drm_mode_create_standard_properties drivers/gpu/drm/drm_mode_config.c:223 [inline]
 drmm_mode_config_init+0x566/0x1460 drivers/gpu/drm/drm_mode_config.c:424
 drm_mode_config_init include/drm/drm_mode_config.h:967 [inline]
 vkms_modeset_init drivers/gpu/drm/vkms/vkms_drv.c:145 [inline]
 vkms_create drivers/gpu/drm/vkms/vkms_drv.c:201 [inline]
 vkms_init+0x35d/0x6d0 drivers/gpu/drm/vkms/vkms_drv.c:235
 do_one_initcall+0x22b/0x7a0 init/main.c:1302
 do_initcall_level+0x157/0x210 init/main.c:1375
 do_initcalls+0x49/0x90 init/main.c:1391
 kernel_init_freeable+0x425/0x5c0 init/main.c:1615
 kernel_init+0x19/0x290 init/main.c:1506
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

The buggy address belongs to the object at ffff88801f727080
 which belongs to the cache kmalloc-64 of size 64
The buggy address is located 0 bytes to the right of
 64-byte region [ffff88801f727080, ffff88801f7270c0)
The buggy address belongs to the page:
page:ffffea00007dc9c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1f727
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 0000000000000000 0000000400000001 ffff888017441640
raw: 0000000000000000 0000000000200020 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 1, ts 8012677507, free_ts 8010666038
 prep_new_page mm/page_alloc.c:2426 [inline]
 get_page_from_freelist+0x3b78/0x3d40 mm/page_alloc.c:4192
 __alloc_pages+0x272/0x700 mm/page_alloc.c:5465
 alloc_page_interleave+0x22/0x1c0 mm/mempolicy.c:2031
 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_trace+0x1a0/0x290 mm/slub.c:3245
 kmalloc include/linux/slab.h:591 [inline]
 kzalloc include/linux/slab.h:721 [inline]
 drm_property_add_enum+0x1b2/0x3c0 drivers/gpu/drm/drm_property.c:420
 drm_property_create_enum+0xb0/0x140 drivers/gpu/drm/drm_property.c:177
 drm_connector_create_standard_properties+0x7a/0x240 drivers/gpu/drm/drm_connector.c:1265
 drm_mode_create_standard_properties drivers/gpu/drm/drm_mode_config.c:223 [inline]
 drmm_mode_config_init+0x566/0x1460 drivers/gpu/drm/drm_mode_config.c:424
 drm_mode_config_init include/drm/drm_mode_config.h:967 [inline]
 vkms_modeset_init drivers/gpu/drm/vkms/vkms_drv.c:145 [inline]
 vkms_create drivers/gpu/drm/vkms/vkms_drv.c:201 [inline]
 vkms_init+0x35d/0x6d0 drivers/gpu/drm/vkms/vkms_drv.c:235
 do_one_initcall+0x22b/0x7a0 init/main.c:1302
 do_initcall_level+0x157/0x210 init/main.c:1375
 do_initcalls+0x49/0x90 init/main.c:1391
 kernel_init_freeable+0x425/0x5c0 init/main.c:1615
 kernel_init+0x19/0x290 init/main.c:1506
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1340 [inline]
 free_pcp_prepare mm/page_alloc.c:1391 [inline]
 free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317
 free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396
 __vunmap+0x8d4/0xa20 mm/vmalloc.c:2621
 free_work+0x57/0x80 mm/vmalloc.c:95
 process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310
 worker_thread+0xaca/0x1280 kernel/workqueue.c:2457
 kthread+0x3f6/0x4f0 kernel/kthread.c:334
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

Memory state around the buggy address:
 ffff88801f726f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff88801f727000: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc
>ffff88801f727080: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc
                                           ^
 ffff88801f727100: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc
 ffff88801f727180: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/12/28 21:44 linux-5.15.y 91786f140358 d3ccff63 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in diWrite
2025/01/26 14:33 linux-5.15.y 003148680b79 9fbd772e .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in diWrite
2024/11/29 04:29 linux-5.15.y 0a51d2d4527b 5df23865 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in diWrite
2024/09/20 20:19 linux-5.15.y 3a5928702e71 6f888b75 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Write in diWrite
2024/12/28 20:36 linux-5.15.y 91786f140358 d3ccff63 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: slab-out-of-bounds Write in diWrite
* Struck through repros no longer work on HEAD.