general protection fault in do_blockdev_direct_IO

37 views
Skip to first unread message

syzbot

unread,
Aug 17, 2019, 3:41:06 AM8/17/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 45f092f9 Linux 4.14.139
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=10150ea6600000
kernel config: https://syzkaller.appspot.com/x/.config?x=56ab4cf14cc8892d
dashboard link: https://syzkaller.appspot.com/bug?extid=129e73149f399c136f13
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1047e302600000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1638189c600000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+129e73...@syzkaller.appspotmail.com

urandom_read: 1 callbacks suppressed
random: sshd: uninitialized urandom read (32 bytes read)
audit: type=1400 audit(1566023833.688:36): avc: denied { map } for
pid=6700 comm="syz-executor800" path="/root/syz-executor800965235"
dev="sda1" ino=16482 scontext=unconfined_u:system_r:insmod_t:s0-s0:c0.c1023
tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file permissive=1
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
Modules linked in:
CPU: 1 PID: 6700 Comm: syz-executor800 Not tainted 4.14.139 #35
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
task: ffff88809f574480 task.stack: ffff8880911b0000
RIP: 0010:__read_once_size include/linux/compiler.h:183 [inline]
RIP: 0010:compound_head include/linux/page-flags.h:147 [inline]
RIP: 0010:get_page include/linux/mm.h:833 [inline]
RIP: 0010:submit_page_section fs/direct-io.c:890 [inline]
RIP: 0010:do_direct_IO fs/direct-io.c:1097 [inline]
RIP: 0010:do_blockdev_direct_IO+0x1c75/0x7fd0 fs/direct-io.c:1336
RSP: 0018:ffff8880911b74c0 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: ffffea000270401c RCX: 000000000000000c
RDX: 0000000000000004 RSI: 0000000000000000 RDI: 0000000000000020
RBP: ffff8880911b77d8 R08: ffffed1013fc1a11 R09: ffff88809fe0d000
R10: ffffed1013fc1a10 R11: ffff88809fe0d087 R12: ffffea0002704000
R13: ffffea0002704000 R14: 0000000000000000 R15: ffff88808906da40
FS: 0000000001909880(0000) GS:ffff8880aef00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020788ffc CR3: 00000000a5e50000 CR4: 00000000001406e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
__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:0x440319
RSP: 002b:00007fffca48f298 EFLAGS: 00000246 ORIG_RAX: 0000000000000113
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440319
RDX: 0000000000000007 RSI: 0000000000000000 RDI: 0000000000000004
RBP: 00000000006ca018 R08: 00000000ffffffff R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000401ba0
R13: 0000000000401c30 R14: 0000000000000000 R15: 0000000000000000
Code: 22 a2 d8 ff e9 4a 1d 00 00 e8 f8 65 c1 ff 48 8b 84 24 f0 00 00 00 48
8d 78 20 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00
0f 85 3d 54 00 00 48 8b 84 24 f0 00 00 00 4c 8b 60
RIP: __read_once_size include/linux/compiler.h:183 [inline] RSP:
ffff8880911b74c0
RIP: compound_head include/linux/page-flags.h:147 [inline] RSP:
ffff8880911b74c0
RIP: get_page include/linux/mm.h:833 [inline] RSP: ffff8880911b74c0
RIP: submit_page_section fs/direct-io.c:890 [inline] RSP: ffff8880911b74c0
RIP: do_direct_IO fs/direct-io.c:1097 [inline] RSP: ffff8880911b74c0
RIP: do_blockdev_direct_IO+0x1c75/0x7fd0 fs/direct-io.c:1336 RSP:
ffff8880911b74c0
---[ end trace 4a2e7444e3184df4 ]---


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches

syzbot

unread,
Aug 17, 2019, 3:42:06 AM8/17/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: a5aa8058 Linux 4.19.67
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=13658b02600000
kernel config: https://syzkaller.appspot.com/x/.config?x=8e5f93d2c874cdab
dashboard link: https://syzkaller.appspot.com/bug?extid=8c86adbfb0a2e68ec466
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17305772600000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=100f0736600000

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+8c86ad...@syzkaller.appspotmail.com

kauditd_printk_skb: 10 callbacks suppressed
audit: type=1400 audit(1566023898.003:36): avc: denied { map } for
pid=11938 comm="syz-executor596" path="/root/syz-executor596882648"
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
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 11938 Comm: syz-executor596 Not tainted 4.19.67 #41
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
RIP: 0010:__read_once_size include/linux/compiler.h:193 [inline]
RIP: 0010:compound_head include/linux/page-flags.h:142 [inline]
RIP: 0010:get_page include/linux/mm.h:924 [inline]
RIP: 0010:submit_page_section fs/direct-io.c:889 [inline]
RIP: 0010:do_direct_IO fs/direct-io.c:1096 [inline]
RIP: 0010:do_blockdev_direct_IO+0x2237/0x8cb0 fs/direct-io.c:1332
Code: fb ce ff e9 47 1d 00 00 e8 d6 0a b0 ff 48 8b 84 24 00 01 00 00 48 8d
78 08 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f
85 5d 6a 00 00 4c 8b b4 24 00 01 00 00 31 ff 4d 8b
RSP: 0018:ffff8880989d73e0 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff81bb4716
RDX: 0000000000000001 RSI: ffffffff81bb545a RDI: 0000000000000008
RBP: ffff8880989d7728 R08: ffff88809246c4c0 R09: fffff94000456907
R10: fffff94000456906 R11: ffffea00022b4837 R12: ffffea00022b4800
R13: ffffea00022b4800 R14: 0000000000000003 R15: ffff8880a0bf1a40
FS: 0000000000dbb880(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000561e177bb1a0 CR3: 0000000093753000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
__blockdev_direct_IO+0xa1/0xca fs/direct-io.c:1418
ext4_direct_IO_write fs/ext4/inode.c:3750 [inline]
ext4_direct_IO+0x990/0x19e0 fs/ext4/inode.c:3877
generic_file_direct_write+0x20f/0x4b0 mm/filemap.c:3064
__generic_file_write_iter+0x2ee/0x630 mm/filemap.c:3243
ext4_file_write_iter+0x32b/0x1060 fs/ext4/file.c:270
call_write_iter include/linux/fs.h:1820 [inline]
do_iter_readv_writev+0x558/0x830 fs/read_write.c:681
do_iter_write fs/read_write.c:960 [inline]
do_iter_write+0x184/0x5f0 fs/read_write.c:941
vfs_iter_write+0x77/0xb0 fs/read_write.c:973
iter_file_splice_write+0x661/0xbd0 fs/splice.c:750
do_splice_from fs/splice.c:852 [inline]
do_splice+0x642/0x12c0 fs/splice.c:1148
__do_sys_splice fs/splice.c:1415 [inline]
__se_sys_splice fs/splice.c:1395 [inline]
__x64_sys_splice+0x2c6/0x330 fs/splice.c:1395
do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x440319
Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 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 0f 83 fb 13 fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffffe00fba8 EFLAGS: 00000246 ORIG_RAX: 0000000000000113
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 0000000000440319
RDX: 0000000000000007 RSI: 0000000000000000 RDI: 0000000000000004
RBP: 00000000006ca018 R08: 00000000ffffffff R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000401ba0
R13: 0000000000401c30 R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
---[ end trace 15c4dcfd1a4437b0 ]---
RIP: 0010:__read_once_size include/linux/compiler.h:193 [inline]
RIP: 0010:compound_head include/linux/page-flags.h:142 [inline]
RIP: 0010:get_page include/linux/mm.h:924 [inline]
RIP: 0010:submit_page_section fs/direct-io.c:889 [inline]
RIP: 0010:do_direct_IO fs/direct-io.c:1096 [inline]
RIP: 0010:do_blockdev_direct_IO+0x2237/0x8cb0 fs/direct-io.c:1332
Code: fb ce ff e9 47 1d 00 00 e8 d6 0a b0 ff 48 8b 84 24 00 01 00 00 48 8d
78 08 48 b8 00 00 00 00 00 fc ff df 48 89 fa 48 c1 ea 03 <80> 3c 02 00 0f
85 5d 6a 00 00 4c 8b b4 24 00 01 00 00 31 ff 4d 8b
RSP: 0018:ffff8880989d73e0 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffffff81bb4716
RDX: 0000000000000001 RSI: ffffffff81bb545a RDI: 0000000000000008
RBP: ffff8880989d7728 R08: ffff88809246c4c0 R09: fffff94000456907
R10: fffff94000456906 R11: ffffea00022b4837 R12: ffffea00022b4800
R13: ffffea00022b4800 R14: 0000000000000003 R15: ffff8880a0bf1a40
FS: 0000000000dbb880(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000561e177bb1a0 CR3: 0000000093753000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


Reply all
Reply to author
Forward
0 new messages