syzbot


KASAN: vmalloc-out-of-bounds Read in cleanup_bitmap_list

Status: upstream: reported C repro on 2023/05/22 16:15
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+38bf434ed65b32c79dd9@syzkaller.appspotmail.com
First crash: 549d, last: 78d
Fix bisection: failed (error log, bisect log)
  
Bug presence (1)
Date Name Commit Repro Result
2023/05/22 upstream (ToT) 44c026a73be8 C [report] KASAN: vmalloc-out-of-bounds Read in cleanup_bitmap_list
Similar bugs (5)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: vmalloc-out-of-bounds Read in cleanup_bitmap_list reiserfs C error done 100 323d 754d 25/28 fixed on 2024/02/16 19:40
linux-5.15 KASAN: vmalloc-out-of-bounds Read in cleanup_bitmap_list (2) origin:upstream C 4 31d 298d 0/3 upstream: reported C repro on 2024/01/28 16:33
linux-5.15 KASAN: vmalloc-out-of-bounds Read in cleanup_bitmap_list 3 502d 578d 0/3 auto-obsoleted due to no activity on 2023/10/16 09:07
linux-4.14 BUG: unable to handle kernel paging request in cleanup_bitmap_list C 1 640d 753d 0/1 upstream: reported C repro on 2022/10/30 13:58
linux-4.19 BUG: unable to handle kernel paging request in cleanup_bitmap_list reiserfs C error 2 672d 755d 0/1 upstream: reported C repro on 2022/10/28 06:50
Fix bisection attempts (13)
Created Duration User Patch Repo Result
2024/10/15 00:35 0m bisect fix linux-6.1.y error job log
2024/09/03 18:39 1h33m bisect fix linux-6.1.y OK (0) job log log
2024/07/30 17:22 1h21m bisect fix linux-6.1.y OK (0) job log log
2024/06/13 01:39 1h47m bisect fix linux-6.1.y OK (0) job log log
2024/04/28 17:30 2h28m bisect fix linux-6.1.y OK (0) job log log
2024/03/28 05:58 1h05m bisect fix linux-6.1.y OK (0) job log log
2024/02/27 02:50 2h40m bisect fix linux-6.1.y OK (0) job log log
2024/01/18 08:37 1h29m bisect fix linux-6.1.y OK (0) job log log
2023/12/18 19:12 1h16m bisect fix linux-6.1.y OK (0) job log log
2023/11/18 13:19 1h24m bisect fix linux-6.1.y OK (0) job log log
2023/10/17 15:44 1h27m bisect fix linux-6.1.y OK (0) job log log
2023/08/13 16:15 2h42m bisect fix linux-6.1.y OK (0) job log log
2023/06/22 21:19 1h00m bisect fix linux-6.1.y OK (0) job log log

Sample crash report:
REISERFS error (device loop1): vs-13070 reiserfs_read_locked_inode: i/o failure occurred trying to find stat data of [1 2 0x0 SD]
REISERFS warning (device loop1):  reiserfs_fill_super: corrupt root inode, run fsck
==================================================================
BUG: KASAN: vmalloc-out-of-bounds in cleanup_bitmap_list+0x175/0x500 fs/reiserfs/journal.c:231
Read of size 8 at addr ffffc900015b6008 by task syz-executor764/3700

CPU: 1 PID: 3700 Comm: syz-executor764 Not tainted 6.1.29-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/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 mm/kasan/report.c:284 [inline]
 print_report+0x15f/0x4f0 mm/kasan/report.c:395
 kasan_report+0x136/0x160 mm/kasan/report.c:495
 cleanup_bitmap_list+0x175/0x500 fs/reiserfs/journal.c:231
 free_list_bitmaps+0x48/0x1a0 fs/reiserfs/journal.c:249
 free_journal_ram+0xf8/0x3f0 fs/reiserfs/journal.c:1887
 do_journal_release fs/reiserfs/journal.c:1960 [inline]
 journal_release_error+0x76/0x90 fs/reiserfs/journal.c:1978
 reiserfs_fill_super+0x1595/0x2620 fs/reiserfs/super.c:2223
 mount_bdev+0x26d/0x3a0 fs/super.c:1423
 legacy_get_tree+0xeb/0x180 fs/fs_context.c:610
 vfs_get_tree+0x88/0x270 fs/super.c:1553
 do_new_mount+0x28b/0xad0 fs/namespace.c:3040
 do_mount fs/namespace.c:3383 [inline]
 __do_sys_mount fs/namespace.c:3591 [inline]
 __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3568
 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+0x63/0xcd
RIP: 0033:0x7f9daca927da
Code: 48 c7 c2 c0 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 a8 00 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fff50daacb8 EFLAGS: 00000286 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 00007f9daca927da
RDX: 0000000020001100 RSI: 0000000020001140 RDI: 00007fff50daacd0
RBP: 00007fff50daacd0 R08: 00007fff50daad10 R09: 0000000000000000
R10: 0000000000800008 R11: 0000000000000286 R12: 0000000000000004
R13: 00005555564502c0 R14: 0000000000800008 R15: 00007fff50daad10
 </TASK>

The buggy address belongs to the virtual mapping at
 [ffffc900015b6000, ffffc900015b8000) created by:
 reiserfs_allocate_list_bitmaps+0x4c/0x220 fs/reiserfs/journal.c:290

The buggy address belongs to the physical page:
page:ffffea0001d66a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x759a8
flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000000 0000000000000000 dead000000000122 0000000000000000
raw: 0000000000000000 0000000000000000 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 0x2dc2(GFP_KERNEL|__GFP_HIGHMEM|__GFP_NOWARN|__GFP_ZERO), pid 3700, tgid 3700 (syz-executor764), ts 76479102739, free_ts 76339738149
 set_page_owner include/linux/page_owner.h:31 [inline]
 post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2533
 prep_new_page mm/page_alloc.c:2540 [inline]
 get_page_from_freelist+0x32ed/0x3480 mm/page_alloc.c:4292
 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5559
 __alloc_pages_bulk+0x83c/0xe80 mm/page_alloc.c:5507
 vm_area_alloc_pages mm/vmalloc.c:2951 [inline]
 __vmalloc_area_node mm/vmalloc.c:3047 [inline]
 __vmalloc_node_range+0x743/0x1460 mm/vmalloc.c:3219
 __vmalloc_node mm/vmalloc.c:3284 [inline]
 vzalloc+0x75/0x80 mm/vmalloc.c:3357
 reiserfs_allocate_list_bitmaps+0x4c/0x220 fs/reiserfs/journal.c:290
 journal_init+0x2e8/0x24b0 fs/reiserfs/journal.c:2733
 reiserfs_fill_super+0x1035/0x2620 fs/reiserfs/super.c:2022
 mount_bdev+0x26d/0x3a0 fs/super.c:1423
 legacy_get_tree+0xeb/0x180 fs/fs_context.c:610
 vfs_get_tree+0x88/0x270 fs/super.c:1553
 do_new_mount+0x28b/0xad0 fs/namespace.c:3040
 do_mount fs/namespace.c:3383 [inline]
 __do_sys_mount fs/namespace.c:3591 [inline]
 __se_sys_mount+0x2d5/0x3c0 fs/namespace.c:3568
 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+0x63/0xcd
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1460 [inline]
 free_pcp_prepare mm/page_alloc.c:1510 [inline]
 free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3388
 free_unref_page_list+0x107/0x810 mm/page_alloc.c:3530
 release_pages+0x2836/0x2b40 mm/swap.c:1055
 __pagevec_release+0x80/0xf0 mm/swap.c:1075
 pagevec_release include/linux/pagevec.h:71 [inline]
 folio_batch_release include/linux/pagevec.h:135 [inline]
 truncate_inode_pages_range+0x48a/0x1340 mm/truncate.c:373
 kill_bdev block/bdev.c:76 [inline]
 blkdev_flush_mapping+0x154/0x2b0 block/bdev.c:662
 blkdev_put_whole block/bdev.c:693 [inline]
 blkdev_put+0x4c0/0x750 block/bdev.c:953
 blkdev_close+0x56/0x80 block/fops.c:514
 __fput+0x3b7/0x890 fs/file_table.c:320
 task_work_run+0x246/0x300 kernel/task_work.c:179
 exit_task_work include/linux/task_work.h:38 [inline]
 do_exit+0x6fb/0x2300 kernel/exit.c:869
 do_group_exit+0x202/0x2b0 kernel/exit.c:1019
 __do_sys_exit_group kernel/exit.c:1030 [inline]
 __se_sys_exit_group kernel/exit.c:1028 [inline]
 __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:1028
 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+0x63/0xcd

Memory state around the buggy address:
 ffffc900015b5f00: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
 ffffc900015b5f80: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
>ffffc900015b6000: 00 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
                      ^
 ffffc900015b6080: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
 ffffc900015b6100: f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8 f8
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/05/22 16:14 linux-6.1.y fa74641fb6b9 4bce1a3e .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan KASAN: vmalloc-out-of-bounds Read in cleanup_bitmap_list
2024/05/13 22:07 linux-6.1.y 909ba1f1b414 9026e142 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: vmalloc-out-of-bounds Read in cleanup_bitmap_list
2023/09/13 16:06 linux-6.1.y 09045dae0d90 0b6a67ac .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: vmalloc-out-of-bounds Read in cleanup_bitmap_list
* Struck through repros no longer work on HEAD.