syzbot


KASAN: stack-out-of-bounds Write in ktime_get_coarse_real_ts64

Status: auto-obsoleted due to no activity on 2023/08/16 11:49
Subsystems: ntfs3
[Documentation on labels]
Reported-by: syzbot+91eeffac5287c260f2d0@syzkaller.appspotmail.com
First crash: 396d, last: 335d
Cause bisection: failed (error log, bisect log)
  
Fix bisection: fixed by (bisect log) :
commit 267a36ba30a7425ad59d20e7e7e33bbdcc9cfb0a
Author: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Date: Mon Jan 16 08:52:10 2023 +0000

  fs/ntfs3: Remove noacsrules

  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [ntfs3?] KASAN: stack-out-of-bounds Write in ktime_get_coarse_real_ts64 0 (2) 2023/05/19 00:27
Last patch testing requests (1)
Created Duration User Patch Repo Result
2023/03/16 14:00 22m ivan.orlov0322@gmail.com upstream report log
Fix bisection attempts (3)
Created Duration User Patch Repo Result
2023/05/18 19:15 5h10m bisect fix upstream job log (1)
2023/04/18 11:15 33m bisect fix upstream job log (0) log
2023/03/19 10:42 32m bisect fix upstream job log (0) log

Sample crash report:
==================================================================
BUG: KASAN: stack-out-of-bounds in native_save_fl arch/x86/include/asm/irqflags.h:22 [inline]
BUG: KASAN: stack-out-of-bounds in arch_local_save_flags arch/x86/include/asm/irqflags.h:70 [inline]
BUG: KASAN: stack-out-of-bounds in arch_irqs_disabled arch/x86/include/asm/irqflags.h:130 [inline]
BUG: KASAN: stack-out-of-bounds in seqcount_lockdep_reader_access+0x177/0x220 include/linux/seqlock.h:104
Write of size 8 at addr ffffc90003daf2df by task syz-executor283/5128

CPU: 1 PID: 5128 Comm: syz-executor283 Not tainted 6.2.0-rc8-syzkaller-00083-g3ac88fa4605e #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/21/2023
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106
 print_address_description mm/kasan/report.c:306 [inline]
 print_report+0x163/0x4f0 mm/kasan/report.c:417
 kasan_report+0x13a/0x170 mm/kasan/report.c:517
 native_save_fl arch/x86/include/asm/irqflags.h:22 [inline]
 arch_local_save_flags arch/x86/include/asm/irqflags.h:70 [inline]
 arch_irqs_disabled arch/x86/include/asm/irqflags.h:130 [inline]
 seqcount_lockdep_reader_access+0x177/0x220 include/linux/seqlock.h:104
 ktime_get_coarse_real_ts64+0x3a/0x120 kernel/time/timekeeping.c:2261
 current_time+0x8b/0x300 fs/inode.c:2448
 atime_needs_update+0x3ec/0x7a0 fs/inode.c:1909
 touch_atime+0xe8/0x650 fs/inode.c:1926
 file_accessed include/linux/fs.h:2519 [inline]
 filemap_read+0x2f3d/0x3220 mm/filemap.c:2762
 call_read_iter include/linux/fs.h:2183 [inline]
 generic_file_splice_read+0x240/0x640 fs/splice.c:309
 do_splice_to fs/splice.c:793 [inline]
 splice_direct_to_actor+0x40c/0xbd0 fs/splice.c:865
 do_splice_direct+0x283/0x3d0 fs/splice.c:974
 do_sendfile+0x620/0xff0 fs/read_write.c:1255
 __do_sys_sendfile64 fs/read_write.c:1323 [inline]
 __se_sys_sendfile64+0x17c/0x1e0 fs/read_write.c:1309
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7ffa6835f409
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 11 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 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc847f4c98 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00000000000474f2 RCX: 00007ffa6835f409
RDX: 0000000000000000 RSI: 0000000000000005 RDI: 0000000000000004
RBP: 0000000000000000 R08: 00007ffc847f4d00 R09: 00007ffc847f4d00
R10: 0000000000010000 R11: 0000000000000246 R12: 00007ffc847f4ccc
R13: 00007ffc847f4d00 R14: 00007ffc847f4ce0 R15: 0000000000000006
 </TASK>

The buggy address belongs to stack of task syz-executor283/5128
 and is located at offset 31 in frame:
 seqcount_lockdep_reader_access+0x0/0x220

This frame has 2 objects:
 [32, 40) 'flags.i.i.i1'
 [64, 72) 'flags.i.i.i'

The buggy address belongs to the virtual mapping at
 [ffffc90003da8000, ffffc90003db1000) created by:
 copy_process+0x5c9/0x3f50 kernel/fork.c:2097

The buggy address belongs to the physical page:
page:ffffea0000844bc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2112f
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 5083, tgid 5083 (syz-executor283), ts 288268792766, free_ts 60390908841
 prep_new_page mm/page_alloc.c:2531 [inline]
 get_page_from_freelist+0x3449/0x35c0 mm/page_alloc.c:4283
 __alloc_pages+0x291/0x7e0 mm/page_alloc.c:5549
 vm_area_alloc_pages mm/vmalloc.c:2989 [inline]
 __vmalloc_area_node mm/vmalloc.c:3057 [inline]
 __vmalloc_node_range+0x966/0x1370 mm/vmalloc.c:3227
 alloc_thread_stack_node kernel/fork.c:311 [inline]
 dup_task_struct+0x3e5/0x6d0 kernel/fork.c:987
 copy_process+0x5c9/0x3f50 kernel/fork.c:2097
 kernel_clone+0x22d/0x990 kernel/fork.c:2681
 __do_sys_clone kernel/fork.c:2822 [inline]
 __se_sys_clone kernel/fork.c:2806 [inline]
 __x64_sys_clone+0x235/0x280 kernel/fork.c:2806
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 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:1446 [inline]
 free_pcp_prepare mm/page_alloc.c:1496 [inline]
 free_unref_page_prepare+0xf3a/0x1040 mm/page_alloc.c:3369
 free_unref_page+0x37/0x3f0 mm/page_alloc.c:3464
 pipe_buf_release include/linux/pipe_fs_i.h:183 [inline]
 pipe_read+0x6e5/0x12b0 fs/pipe.c:324
 call_read_iter include/linux/fs.h:2183 [inline]
 new_sync_read fs/read_write.c:389 [inline]
 vfs_read+0x7e2/0xbe0 fs/read_write.c:470
 ksys_read+0x1a0/0x2c0 fs/read_write.c:613
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd

Memory state around the buggy address:
 ffffc90003daf180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffffc90003daf200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffc90003daf280: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00 f2 f2 f2
                                                    ^
 ffffc90003daf300: 00 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00
 ffffc90003daf380: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/02/17 10:38 upstream 3ac88fa4605e 851bc19a .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-kasan-gce-smack-root KASAN: stack-out-of-bounds Write in ktime_get_coarse_real_ts64
* Struck through repros no longer work on HEAD.