syzbot


KASAN: stack-out-of-bounds Read in gfs2_dump_glock

Status: upstream: reported C repro on 2023/05/02 11:39
Bug presence: origin:upstream
[Documentation on labels]
Reported-by: syzbot+40ad3ff8aa43131f14c1@syzkaller.appspotmail.com
First crash: 358d, last: 25d
Bug presence (2)
Date Name Commit Repro Result
2023/05/30 upstream (ToT) 8b817fded42d C [report] KASAN: stack-out-of-bounds Read in gfs2_dump_glock
2024/04/14 upstream (ToT) 7efd0a74039f C Failed due to an error; will retry later
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream general protection fault in gfs2_dump_glock gfs2 C 25 426d 828d 22/26 fixed on 2023/02/24 13:50
upstream general protection fault in gfs2_dump_glock (2) gfs2 C done done 48 107d 414d 0/26 auto-obsoleted due to no activity on 2024/04/08 04:28
Fix bisection attempts (8)
Created Duration User Patch Repo Result
2024/03/29 15:34 3h19m bisect fix linux-6.1.y job log (0) log
2024/02/28 09:09 1h48m bisect fix linux-6.1.y job log (0) log
2024/01/20 17:09 1h57m bisect fix linux-6.1.y job log (0) log
2023/12/21 10:27 2h07m bisect fix linux-6.1.y job log (0) log
2023/11/20 20:41 1h51m bisect fix linux-6.1.y job log (0) log
2023/10/18 10:01 1h49m bisect fix linux-6.1.y job log (0) log
2023/09/13 19:49 2h42m bisect fix linux-6.1.y job log (0) log
2023/06/30 08:23 51m bisect fix linux-6.1.y job log (0) log

Sample crash report:
==================================================================
BUG: KASAN: stack-out-of-bounds in gfs2_dump_glock+0x1537/0x1b70
Read of size 8 at addr ffffc900058afcc0 by task syz-executor269/4534

CPU: 0 PID: 4534 Comm: syz-executor269 Not tainted 6.1.30-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 mm/kasan/report.c:284 [inline]
 print_report+0x15f/0x4f0 mm/kasan/report.c:395
 kasan_report+0x136/0x160 mm/kasan/report.c:495
 gfs2_dump_glock+0x1537/0x1b70
 gfs2_consist_inode_i+0xf1/0x110 fs/gfs2/util.c:465
 gfs2_dirent_scan+0x512/0x640 fs/gfs2/dir.c:602
 gfs2_dirent_search+0x30a/0x8c0 fs/gfs2/dir.c:850
 gfs2_dir_search+0xae/0x2f0 fs/gfs2/dir.c:1650
 gfs2_lookupi+0x45f/0x5e0 fs/gfs2/inode.c:323
 __gfs2_lookup+0xa0/0x270 fs/gfs2/inode.c:870
 gfs2_atomic_open+0x9a/0x220 fs/gfs2/inode.c:1274
 atomic_open fs/namei.c:3276 [inline]
 lookup_open fs/namei.c:3384 [inline]
 open_last_lookups fs/namei.c:3481 [inline]
 path_openat+0xf4e/0x2e60 fs/namei.c:3711
 do_filp_open+0x230/0x480 fs/namei.c:3741
 do_sys_openat2+0x13b/0x500 fs/open.c:1318
 do_sys_open fs/open.c:1334 [inline]
 __do_sys_open fs/open.c:1342 [inline]
 __se_sys_open fs/open.c:1338 [inline]
 __x64_sys_open+0x221/0x270 fs/open.c:1338
 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:0x7fa45eb22179
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 d1 15 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:00007fa456eab318 EFLAGS: 00000246 ORIG_RAX: 0000000000000002
RAX: ffffffffffffffda RBX: 00007fa45ebb97b8 RCX: 00007fa45eb22179
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00000000200025c0
RBP: 00007fa45ebb97b0 R08: 00007fa456eab700 R09: 0000000000000000
R10: 00007fa456eab700 R11: 0000000000000246 R12: 0030656c69662f2e
R13: 00007ffe069d65af R14: 00007fa456eab400 R15: 0000000000022000
 </TASK>

The buggy address belongs to the virtual mapping at
 [ffffc900058a8000, ffffc900058b1000) created by:
 copy_process+0x637/0x4020 kernel/fork.c:2090

The buggy address belongs to the physical page:
page:ffffea0000a1df00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2877c
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 4526, tgid 4526 (syz-executor269), ts 780897127472, free_ts 780846560151
 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
 vm_area_alloc_pages mm/vmalloc.c:2979 [inline]
 __vmalloc_area_node mm/vmalloc.c:3047 [inline]
 __vmalloc_node_range+0x96c/0x1460 mm/vmalloc.c:3219
 alloc_thread_stack_node kernel/fork.c:311 [inline]
 dup_task_struct+0x3e5/0x6d0 kernel/fork.c:980
 copy_process+0x637/0x4020 kernel/fork.c:2090
 kernel_clone+0x222/0x920 kernel/fork.c:2679
 __do_sys_clone kernel/fork.c:2820 [inline]
 __se_sys_clone kernel/fork.c:2804 [inline]
 __x64_sys_clone+0x231/0x280 kernel/fork.c:2804
 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
 deactivate_locked_super+0xa0/0x110 fs/super.c:332
 cleanup_mnt+0x490/0x520 fs/namespace.c:1186
 task_work_run+0x246/0x300 kernel/task_work.c:179
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 exit_to_user_mode_loop+0xd9/0x100 kernel/entry/common.c:171
 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:204
 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline]
 syscall_exit_to_user_mode+0x60/0x270 kernel/entry/common.c:297
 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Memory state around the buggy address:
 ffffc900058afb80: 00 00 00 00 f1 f1 f1 f1 00 00 00 00 00 00 00 00
 ffffc900058afc00: 00 f2 f2 f2 f2 f2 00 f2 f2 f2 00 00 00 00 00 00
>ffffc900058afc80: 00 00 00 00 00 00 00 00 f3 f3 f3 f3 00 00 00 00
                                           ^
 ffffc900058afd00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffffc900058afd80: f1 f1 f1 f1 04 f3 f3 f3 00 00 00 00 00 00 00 00
==================================================================

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/05/30 12:44 linux-6.1.y a343b0dd87b4 cf184559 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan KASAN: stack-out-of-bounds Read in gfs2_dump_glock
2023/05/02 11:39 linux-6.1.y ca48fc16c493 52d40fd2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan KASAN: stack-out-of-bounds Read in gfs2_dump_glock
2023/05/03 22:52 linux-6.1.y ca48fc16c493 b5918830 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan general protection fault in gfs2_dump_glock
2023/05/02 20:59 linux-6.1.y ca48fc16c493 52d40fd2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan general protection fault in gfs2_dump_glock
* Struck through repros no longer work on HEAD.