syzbot


KASAN: global-out-of-bounds Read in do_blockdev_direct_IO

Status: upstream: reported C repro on 2019/10/30 08:29
Reported-by: syzbot+8de2e06d1f9cda58c4d5@syzkaller.appspotmail.com
First crash: 1639d, last: 1414d
Cause bisection: introduced by (bisect log) :
commit 5d4c9bfbabdb1d497f21afd81501e5c54b0c85d9
Author: Eric Dumazet <edumazet@google.com>
Date: Thu Nov 19 05:03:33 2015 +0000

  tcp: fix potential huge kmalloc() calls in TCP_REPAIR

Crash: BUG: unable to handle kernel (log)
Repro: C syz .config
  
Fix bisection the fix commit could be any of (bisect log):
  ddef1e8e3f6e Linux 4.14.151
  56dfe6252c68 Linux 4.14.188
  
Last patch testing requests (2)
Created Duration User Patch Repo Result
2023/01/24 13:32 11m retest repro linux-4.14.y report log
2022/09/07 07:27 12m retest repro linux-4.14.y report log
Fix bisection attempts (8)
Created Duration User Patch Repo Result
2020/07/11 06:04 29m bisect fix linux-4.14.y job log (2)
2020/06/11 05:33 23m bisect fix linux-4.14.y job log (0) log
2020/05/12 05:09 24m bisect fix linux-4.14.y job log (0) log
2020/04/12 03:49 22m bisect fix linux-4.14.y job log (0) log
2020/03/13 03:24 24m bisect fix linux-4.14.y job log (0) log
2020/02/12 03:00 22m bisect fix linux-4.14.y job log (0) log
2020/01/13 02:24 22m bisect fix linux-4.14.y job log (0) log
2019/12/14 02:01 22m bisect fix linux-4.14.y job log (0) log

Sample crash report:
random: sshd: uninitialized urandom read (32 bytes read)
random: sshd: uninitialized urandom read (32 bytes read)
random: sshd: uninitialized urandom read (32 bytes read)
audit: type=1400 audit(1572420328.038:36): avc:  denied  { map } for  pid=6893 comm="syz-executor752" path="/root/syz-executor752021065" dev="sda1" ino=16483 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1
==================================================================
BUG: KASAN: global-out-of-bounds in __read_once_size include/linux/compiler.h:183 [inline]
BUG: KASAN: global-out-of-bounds in compound_head include/linux/page-flags.h:147 [inline]
BUG: KASAN: global-out-of-bounds in get_page include/linux/mm.h:833 [inline]
BUG: KASAN: global-out-of-bounds in submit_page_section fs/direct-io.c:890 [inline]
BUG: KASAN: global-out-of-bounds in do_direct_IO fs/direct-io.c:1097 [inline]
BUG: KASAN: global-out-of-bounds in do_blockdev_direct_IO+0x70c1/0x7fd0 fs/direct-io.c:1336
Read of size 8 at addr ffffffff885d3380 by task syz-executor752/6893

CPU: 0 PID: 6893 Comm: syz-executor752 Not tainted 4.14.151 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x138/0x197 lib/dump_stack.c:53
 print_address_description.cold+0x5/0x1dc mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report mm/kasan/report.c:409 [inline]
 kasan_report.cold+0xa9/0x2af mm/kasan/report.c:393
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430
 __read_once_size include/linux/compiler.h:183 [inline]
 compound_head include/linux/page-flags.h:147 [inline]
 get_page include/linux/mm.h:833 [inline]
 submit_page_section fs/direct-io.c:890 [inline]
 do_direct_IO fs/direct-io.c:1097 [inline]
 do_blockdev_direct_IO+0x70c1/0x7fd0 fs/direct-io.c:1336
 __blockdev_direct_IO+0xa1/0xca fs/direct-io.c:1422
 ext4_direct_IO_write fs/ext4/inode.c:3703 [inline]
 ext4_direct_IO+0x70d/0x1890 fs/ext4/inode.c:3833
 generic_file_direct_write+0x1e7/0x430 mm/filemap.c:2949
 __generic_file_write_iter+0x2bc/0x5b0 mm/filemap.c:3128
 ext4_file_write_iter+0x2ac/0xe90 fs/ext4/file.c:268
 call_write_iter include/linux/fs.h:1777 [inline]
 do_iter_readv_writev+0x418/0x670 fs/read_write.c:675
 do_iter_write fs/read_write.c:954 [inline]
 do_iter_write+0x154/0x540 fs/read_write.c:935
 vfs_iter_write+0x77/0xb0 fs/read_write.c:967
 iter_file_splice_write+0x572/0xad0 fs/splice.c:749
 do_splice_from fs/splice.c:851 [inline]
 do_splice fs/splice.c:1147 [inline]
 SYSC_splice fs/splice.c:1402 [inline]
 SyS_splice+0xd92/0x1430 fs/splice.c:1382
 do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x440309
RSP: 002b:00007fff13a831c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000113
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440309
RDX: 0000000000000007 RSI: 0000000000000000 RDI: 0000000000000004
RBP: 00000000006ca018 R08: 00000000ffffffff R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000401b90
R13: 0000000000401c20 R14: 0000000000000000 R15: 0000000000000000

The buggy address belongs to the variable:
 __key.65489+0x20/0x40

Memory state around the buggy address:
 ffffffff885d3280: fa fa fa fa 00 fa fa fa fa fa fa fa 00 fa fa fa
 ffffffff885d3300: fa fa fa fa 00 fa fa fa fa fa fa fa 00 fa fa fa
>ffffffff885d3380: fa fa fa fa 00 fa fa fa fa fa fa fa 00 fa fa fa
                   ^
 ffffffff885d3400: fa fa fa fa 00 fa fa fa fa fa fa fa 00 fa fa fa
 ffffffff885d3480: fa fa fa fa 00 fa fa fa fa fa fa fa 00 fa fa fa
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/10/30 07:28 linux-4.14.y ddef1e8e3f6e 5ea87a66 .config console log report syz C ci2-linux-4-14
* Struck through repros no longer work on HEAD.