syzbot


KASAN: use-after-free Read in jfs_lazycommit

Status: upstream: reported C repro on 2023/05/06 12:04
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+22c79e795372bfe8b681@syzkaller.appspotmail.com
First crash: 354d, last: 8d11h
Fix bisection: failed (error log, bisect log)
  
Bug presence (1)
Date Name Commit Repro Result
2023/10/25 upstream (ToT) 611da07b89fd C [report] KASAN: slab-use-after-free Read in jfs_lazycommit
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in jfs_lazycommit jfs C error 93 31m 571d 0/26 upstream: reported C repro on 2022/10/01 13:43
linux-4.19 KASAN: use-after-free Read in jfs_lazycommit jfs C error 5 442d 559d 0/1 upstream: reported C repro on 2022/10/13 08:33
linux-6.1 KASAN: use-after-free Read in jfs_lazycommit origin:upstream C 10 5d16h 353d 0/3 upstream: reported C repro on 2023/05/07 23:35
linux-4.14 KASAN: use-after-free Read in jfs_lazycommit jfs C 6 419d 561d 0/1 upstream: reported C repro on 2022/10/11 20:09
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2023/11/13 02:23 0m bisect fix linux-5.15.y error job log (0)
2023/10/11 15:07 1h48m bisect fix linux-5.15.y job log (0) log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in jfs_lazycommit+0x7d4/0xc30 fs/jfs/jfs_txnmgr.c:2764
Read of size 4 at addr ffff888019ad4894 by task jfsCommit/276

CPU: 1 PID: 276 Comm: jfsCommit Not tainted 5.15.114-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/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
 jfs_lazycommit+0x7d4/0xc30 fs/jfs/jfs_txnmgr.c:2764
 kthread+0x3f6/0x4f0 kernel/kthread.c:319
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
 </TASK>

Allocated by task 3870:
 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]
 jfs_fill_super+0xfb/0xc70 fs/jfs/super.c:500
 mount_bdev+0x2c9/0x3f0 fs/super.c:1378
 legacy_get_tree+0xeb/0x180 fs/fs_context.c:610
 vfs_get_tree+0x88/0x270 fs/super.c:1508
 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

Freed by task 3534:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4b/0x80 mm/kasan/common.c:46
 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
 ____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:366
 kasan_slab_free include/linux/kasan.h:230 [inline]
 slab_free_hook mm/slub.c:1705 [inline]
 slab_free_freelist_hook+0xdd/0x160 mm/slub.c:1731
 slab_free mm/slub.c:3499 [inline]
 kfree+0xf1/0x270 mm/slub.c:4559
 generic_shutdown_super+0x136/0x2c0 fs/super.c:475
 kill_block_super+0x7a/0xe0 fs/super.c:1405
 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 ffff888019ad4800
 which belongs to the cache kmalloc-256 of size 256
The buggy address is located 148 bytes inside of
 256-byte region [ffff888019ad4800, ffff888019ad4900)
The buggy address belongs to the page:
page:ffffea000066b500 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x19ad4
head:ffffea000066b500 order:1 compound_mapcount:0
flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000010200 ffffea00004a7900 0000000300000003 ffff888011c41b40
raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 1, ts 6006515982, 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_pages_node include/linux/gfp.h:570 [inline]
 alloc_slab_page mm/slub.c:1777 [inline]
 allocate_slab mm/slub.c:1912 [inline]
 new_slab+0xb1/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]
 kmem_cache_alloc_node_trace+0x1ce/0x2e0 mm/slub.c:3270
 kmalloc_node include/linux/slab.h:609 [inline]
 kzalloc_node include/linux/slab.h:732 [inline]
 blk_mq_init_tags+0x72/0x380 block/blk-mq-tag.c:552
 blk_mq_alloc_rq_map+0x7a/0x190 block/blk-mq.c:2409
 __blk_mq_alloc_map_and_request+0x94/0x310 block/blk-mq.c:2866
 __blk_mq_alloc_rq_maps block/blk-mq.c:3356 [inline]
 blk_mq_alloc_map_and_requests+0xbe/0x4f0 block/blk-mq.c:3382
 blk_mq_alloc_tag_set+0x797/0xfc0 block/blk-mq.c:3541
 scsi_add_host_with_dma+0x15a/0x990 drivers/scsi/hosts.c:232
 scsi_add_host include/scsi/scsi_host.h:773 [inline]
 virtscsi_probe+0x817/0xe70 drivers/scsi/virtio_scsi.c:906
 virtio_dev_probe+0x815/0xa50 drivers/virtio/virtio.c:273
 really_probe+0x24e/0xb60 drivers/base/dd.c:595
 __driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:755
 driver_probe_device+0x50/0x420 drivers/base/dd.c:785
page_owner free stack trace missing

Memory state around the buggy address:
 ffff888019ad4780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888019ad4800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff888019ad4880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                         ^
 ffff888019ad4900: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888019ad4980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (24):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/06/03 06:46 linux-5.15.y 0ab06468cbd1 a4ae4f42 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan KASAN: use-after-free Read in jfs_lazycommit
2023/05/07 14:32 linux-5.15.y 8a7f2a5c5aa1 90c93c40 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
2023/05/14 03:00 linux-5.15.y b0ece631f84a 2b9ba477 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
2024/04/16 16:29 linux-5.15.y fa3df276cd36 18f6e127 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in jfs_lazycommit
2024/04/13 13:51 linux-5.15.y fa3df276cd36 c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in jfs_lazycommit
2024/04/12 17:48 linux-5.15.y cdfd0a7f0139 c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in jfs_lazycommit
2023/11/28 13:11 linux-5.15.y 2a910f4af54d 9fe51b7c .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in jfs_lazycommit
2024/04/14 14:42 linux-5.15.y fa3df276cd36 c8349e48 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
2024/01/05 18:19 linux-5.15.y 26c690eff0a5 28c42cff .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
2023/08/25 11:49 linux-5.15.y f6f7927ac664 03d9c195 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
2023/08/08 23:06 linux-5.15.y c275eaaaa342 9552ae77 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
2023/07/10 19:42 linux-5.15.y d54cfc420586 d47e94ee .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
2023/07/07 10:08 linux-5.15.y d54cfc420586 22ae5830 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
2023/07/06 04:11 linux-5.15.y d54cfc420586 ba5dba36 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
2023/07/03 23:37 linux-5.15.y 4af60700a60c 6e553898 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
2023/06/30 02:06 linux-5.15.y 4af60700a60c 01298212 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
2023/06/28 22:23 linux-5.15.y 4af60700a60c ca69c785 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
2023/06/19 18:49 linux-5.15.y 471e639e59d1 d521bc56 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
2023/06/13 21:02 linux-5.15.y 7349e40704a0 d2ee9228 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
2023/06/13 00:41 linux-5.15.y 7349e40704a0 aaed0183 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
2023/05/12 03:01 linux-5.15.y b0ece631f84a adb9a3cd .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
2023/05/09 04:09 linux-5.15.y 8a7f2a5c5aa1 c7a5e2a0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
2023/05/08 23:16 linux-5.15.y 8a7f2a5c5aa1 c7a5e2a0 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
2023/05/06 12:03 linux-5.15.y 8a7f2a5c5aa1 90c93c40 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in jfs_lazycommit
* Struck through repros no longer work on HEAD.