BUG: sleeping function called from invalid context in do_user_addr_fault

24 views
Skip to first unread message

syzbot

unread,
Jun 21, 2020, 6:07:12 AM6/21/20
to linux-...@vger.kernel.org, linux-...@vger.kernel.org, syzkall...@googlegroups.com, vi...@zeniv.linux.org.uk
Hello,

syzbot found the following crash on:

HEAD commit: 7ae77150 Merge tag 'powerpc-5.8-1' of git://git.kernel.org..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1772c3a9100000
kernel config: https://syzkaller.appspot.com/x/.config?x=be4578b3f1083656
dashboard link: https://syzkaller.appspot.com/bug?extid=7748c5375dc20dfdb92f
compiler: clang version 10.0.0 (https://github.com/llvm/llvm-project/ c2443155a0fb245c8f17f2c1c72b6ea391e86e81)

Unfortunately, I don't have any reproducer for this crash yet.

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

BUG: sleeping function called from invalid context at arch/x86/mm/fault.c:1259
in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 10572, name: syz-executor.3
2 locks held by syz-executor.3/10572:
#0: ffffffff892e89d0 (rcu_read_lock){....}-{1:2}, at: rcu_lock_acquire+0x5/0x30 include/linux/rcupdate.h:240
#1: ffff88809b127028 (&mm->mmap_sem#2){++++}-{3:3}, at: do_user_addr_fault+0x344/0xba0 arch/x86/mm/fault.c:1242
Preemption disabled at:
[<ffffffff8147bc44>] irq_enter+0x64/0x100 kernel/softirq.c:358
CPU: 0 PID: 10572 Comm: syz-executor.3 Not tainted 5.7.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1e9/0x30e lib/dump_stack.c:118
___might_sleep+0x3c0/0x570 kernel/sched/core.c:6877
do_user_addr_fault+0x377/0xba0 arch/x86/mm/fault.c:1259
page_fault+0x39/0x40 arch/x86/entry/entry_64.S:1203
RIP: 0010:__read_once_size include/linux/compiler.h:252 [inline]
RIP: 0010:__sanitizer_cov_trace_pc+0x3f/0x60 kernel/kcov.c:202
Code: c2 00 01 ff 00 74 11 f7 c2 00 01 00 00 74 35 83 b9 04 14 00 00 00 74 2c 8b 91 e0 13 00 00 83 fa 02 75 21 48 8b 91 e8 13 00 00 <48> 8b 32 48 8d 7e 01 8b 89 e4 13 00 00 48 39 cf 73 08 48 89 44 f2
RSP: 0018:ffffc90004b37938 EFLAGS: 00010246
RAX: ffffffff81c35ba2 RBX: 0000000000000001 RCX: ffff88805962a380
RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffff8880ae8387d8
RBP: 0000000000000000 R08: dffffc0000000000 R09: ffffed1015d070fc
R10: ffffed1015d070fc R11: 0000000000000000 R12: dffffc0000000000
R13: ffffc90004b37d30 R14: ffffc900000ca3b0 R15: ffff8880a26f4170
rcu_read_lock include/linux/rcupdate.h:635 [inline]
__d_lookup+0xa2/0x6e0 fs/dcache.c:2386
lookup_fast+0x99/0x700 fs/namei.c:1488
walk_component+0x72/0x680 fs/namei.c:1842
link_path_walk+0x66d/0xba0 fs/namei.c:2165
path_openat+0x21d/0x38b0 fs/namei.c:3342
do_filp_open+0x191/0x3a0 fs/namei.c:3373
do_sys_openat2+0x463/0x770 fs/open.c:1179
do_sys_open fs/open.c:1195 [inline]
__do_sys_openat fs/open.c:1209 [inline]
__se_sys_openat fs/open.c:1204 [inline]
__x64_sys_openat+0x1c8/0x1f0 fs/open.c:1204
do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:295
entry_SYSCALL_64_after_hwframe+0x49/0xb3
RIP: 0033:0x45ca59
Code: 0d b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 db b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fada1226c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00000000004f7e60 RCX: 000000000045ca59
RDX: 0000000000000000 RSI: 0000000020000100 RDI: ffffffffffffff9c
RBP: 000000000078c180 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 00000000000007b2 R14: 00000000004ca90b R15: 00007fada12276d4
BUG: kernel NULL pointer dereference, address: 0000000000000000
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
PGD a1df9067 P4D a1df9067 PUD a0772067 PMD 0
Oops: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 10572 Comm: syz-executor.3 Tainted: G W 5.7.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:__read_once_size include/linux/compiler.h:252 [inline]
RIP: 0010:__sanitizer_cov_trace_pc+0x3f/0x60 kernel/kcov.c:202
Code: c2 00 01 ff 00 74 11 f7 c2 00 01 00 00 74 35 83 b9 04 14 00 00 00 74 2c 8b 91 e0 13 00 00 83 fa 02 75 21 48 8b 91 e8 13 00 00 <48> 8b 32 48 8d 7e 01 8b 89 e4 13 00 00 48 39 cf 73 08 48 89 44 f2
RSP: 0018:ffffc90004b37938 EFLAGS: 00010246
RAX: ffffffff81c35ba2 RBX: 0000000000000001 RCX: ffff88805962a380
RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffff8880ae8387d8
RBP: 0000000000000000 R08: dffffc0000000000 R09: ffffed1015d070fc
R10: ffffed1015d070fc R11: 0000000000000000 R12: dffffc0000000000
R13: ffffc90004b37d30 R14: ffffc900000ca3b0 R15: ffff8880a26f4170
FS: 00007fada1227700(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 00000000a7654000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
rcu_read_lock include/linux/rcupdate.h:635 [inline]
__d_lookup+0xa2/0x6e0 fs/dcache.c:2386
lookup_fast+0x99/0x700 fs/namei.c:1488
walk_component+0x72/0x680 fs/namei.c:1842
link_path_walk+0x66d/0xba0 fs/namei.c:2165
path_openat+0x21d/0x38b0 fs/namei.c:3342
do_filp_open+0x191/0x3a0 fs/namei.c:3373
do_sys_openat2+0x463/0x770 fs/open.c:1179
do_sys_open fs/open.c:1195 [inline]
__do_sys_openat fs/open.c:1209 [inline]
__se_sys_openat fs/open.c:1204 [inline]
__x64_sys_openat+0x1c8/0x1f0 fs/open.c:1204
do_syscall_64+0xf3/0x1b0 arch/x86/entry/common.c:295
entry_SYSCALL_64_after_hwframe+0x49/0xb3
RIP: 0033:0x45ca59
Code: 0d b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 db b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007fada1226c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00000000004f7e60 RCX: 000000000045ca59
RDX: 0000000000000000 RSI: 0000000020000100 RDI: ffffffffffffff9c
RBP: 000000000078c180 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 00000000000007b2 R14: 00000000004ca90b R15: 00007fada12276d4
Modules linked in:
CR2: 0000000000000000
---[ end trace 4b5ea1725b962f43 ]---
RIP: 0010:__read_once_size include/linux/compiler.h:252 [inline]
RIP: 0010:__sanitizer_cov_trace_pc+0x3f/0x60 kernel/kcov.c:202
Code: c2 00 01 ff 00 74 11 f7 c2 00 01 00 00 74 35 83 b9 04 14 00 00 00 74 2c 8b 91 e0 13 00 00 83 fa 02 75 21 48 8b 91 e8 13 00 00 <48> 8b 32 48 8d 7e 01 8b 89 e4 13 00 00 48 39 cf 73 08 48 89 44 f2
RSP: 0018:ffffc90004b37938 EFLAGS: 00010246
RAX: ffffffff81c35ba2 RBX: 0000000000000001 RCX: ffff88805962a380
RDX: 0000000000000000 RSI: 0000000000000004 RDI: ffff8880ae8387d8
RBP: 0000000000000000 R08: dffffc0000000000 R09: ffffed1015d070fc
R10: ffffed1015d070fc R11: 0000000000000000 R12: dffffc0000000000
R13: ffffc90004b37d30 R14: ffffc900000ca3b0 R15: ffff8880a26f4170
FS: 00007fada1227700(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 00000000a7654000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


---
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

unread,
Jul 7, 2020, 4:16:26 PM7/7/20
to b...@alien8.de, h...@zytor.com, linux-...@vger.kernel.org, linux-...@vger.kernel.org, lu...@kernel.org, mi...@redhat.com, syzkall...@googlegroups.com, tg...@linutronix.de, vi...@zeniv.linux.org.uk, x...@kernel.org
syzbot has found a reproducer for the following crash on:

HEAD commit: 7cc2a8ea Merge tag 'block-5.8-2020-07-01' of git://git.ker..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=14ed01a3100000
kernel config: https://syzkaller.appspot.com/x/.config?x=183dd243398ba7ec
dashboard link: https://syzkaller.appspot.com/bug?extid=7748c5375dc20dfdb92f
compiler: clang version 10.0.0 (https://github.com/llvm/llvm-project/ c2443155a0fb245c8f17f2c1c72b6ea391e86e81)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1469d28f100000

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

BUG: sleeping function called from invalid context at arch/x86/mm/fault.c:1253
in_atomic(): 0, irqs_disabled(): 1, non_block: 0, pid: 6824, name: syz-executor.2
1 lock held by syz-executor.2/6824:
#0: ffff88809abb82a8 (&mm->mmap_lock#2){++++}-{3:3}, at: mmap_read_trylock include/linux/mmap_lock.h:56 [inline]
#0: ffff88809abb82a8 (&mm->mmap_lock#2){++++}-{3:3}, at: do_user_addr_fault+0x344/0xba0 arch/x86/mm/fault.c:1236
irq event stamp: 190300
hardirqs last enabled at (190299): [<ffffffff881efdef>] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline]
hardirqs last enabled at (190299): [<ffffffff881efdef>] _raw_spin_unlock_irqrestore+0x6f/0xd0 kernel/locking/spinlock.c:191
hardirqs last disabled at (190300): [<ffffffff810075c2>] __syscall_return_slowpath+0x52/0x180 arch/x86/entry/common.c:328
softirqs last enabled at (187494): [<ffffffff88200f0f>] asm_call_on_stack+0xf/0x20 arch/x86/entry/entry_64.S:711
softirqs last disabled at (187473): [<ffffffff88200f0f>] asm_call_on_stack+0xf/0x20 arch/x86/entry/entry_64.S:711
CPU: 0 PID: 6824 Comm: syz-executor.2 Not tainted 5.8.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1f0/0x31e lib/dump_stack.c:118
___might_sleep+0x3c0/0x570 kernel/sched/core.c:6899
do_user_addr_fault+0x377/0xba0 arch/x86/mm/fault.c:1253
handle_page_fault arch/x86/mm/fault.c:1365 [inline]
exc_page_fault+0x124/0x1f0 arch/x86/mm/fault.c:1418
asm_exc_page_fault+0x1e/0x30 arch/x86/include/asm/idtentry.h:565
RIP: 0010:__prepare_exit_to_usermode+0x52/0x1e0 arch/x86/entry/common.c:240
Code: 24 50 15 00 00 0f 85 8f 01 00 00 f0 41 80 64 24 03 7f 83 3d 9f e9 6c 08 00 74 23 41 83 bc 24 cc 08 00 00 00 75 18 41 83 00 00 <00> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
RSP: 0018:ffffc90001607f10 EFLAGS: 00010006
RAX: 0000000000000000 RBX: 000000000000003d RCX: ffff888095318300
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffc90001607f58
RBP: 0000000000000000 R08: ffffffff817a2250 R09: ffffed10128c82ed
R10: ffffed10128c82ed R11: 0000000000000000 R12: ffff888095318300
R13: 0000000000000000 R14: ffffc90001607f58 R15: ffffc90001607f58
do_syscall_64+0x7f/0xe0 arch/x86/entry/common.c:368
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x4169ca
Code: Bad RIP value.
RSP: 002b:00007fff61070cd8 EFLAGS: 00000246 ORIG_RAX: 000000000000003d
RAX: 0000000000000000 RBX: 000000000000e1d1 RCX: 00000000004169ca
RDX: 0000000040000001 RSI: 00007fff61070d10 RDI: ffffffffffffffff
RBP: 0000000000000002 R08: 0000000000000001 R09: 0000000001cf2940
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000008
R13: 00007fff61070d10 R14: 000000000000de93 R15: 00007fff61070d20
BUG: kernel NULL pointer dereference, address: 0000000000000000
#PF: supervisor write access in kernel mode
#PF: error_code(0x0002) - not-present page
PGD a7cf1067 P4D a7cf1067 PUD a0728067 PMD 0
Oops: 0002 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 6824 Comm: syz-executor.2 Tainted: G W 5.8.0-rc3-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:__prepare_exit_to_usermode+0x52/0x1e0 arch/x86/entry/common.c:240
Code: 24 50 15 00 00 0f 85 8f 01 00 00 f0 41 80 64 24 03 7f 83 3d 9f e9 6c 08 00 74 23 41 83 bc 24 cc 08 00 00 00 75 18 41 83 00 00 <00> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
RSP: 0018:ffffc90001607f10 EFLAGS: 00010006
RAX: 0000000000000000 RBX: 000000000000003d RCX: ffff888095318300
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffc90001607f58
RBP: 0000000000000000 R08: ffffffff817a2250 R09: ffffed10128c82ed
R10: ffffed10128c82ed R11: 0000000000000000 R12: ffff888095318300
R13: 0000000000000000 R14: ffffc90001607f58 R15: ffffc90001607f58
FS: 0000000001cf2940(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 00000000a380c000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
do_syscall_64+0x7f/0xe0 arch/x86/entry/common.c:368
entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x4169ca
Code: Bad RIP value.
RSP: 002b:00007fff61070cd8 EFLAGS: 00000246 ORIG_RAX: 000000000000003d
RAX: 0000000000000000 RBX: 000000000000e1d1 RCX: 00000000004169ca
RDX: 0000000040000001 RSI: 00007fff61070d10 RDI: ffffffffffffffff
RBP: 0000000000000002 R08: 0000000000000001 R09: 0000000001cf2940
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000008
R13: 00007fff61070d10 R14: 000000000000de93 R15: 00007fff61070d20
Modules linked in:
CR2: 0000000000000000
---[ end trace bee8a2ac971d1076 ]---
RIP: 0010:__prepare_exit_to_usermode+0x52/0x1e0 arch/x86/entry/common.c:240
Code: 24 50 15 00 00 0f 85 8f 01 00 00 f0 41 80 64 24 03 7f 83 3d 9f e9 6c 08 00 74 23 41 83 bc 24 cc 08 00 00 00 75 18 41 83 00 00 <00> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
RSP: 0018:ffffc90001607f10 EFLAGS: 00010006
RAX: 0000000000000000 RBX: 000000000000003d RCX: ffff888095318300
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffc90001607f58
RBP: 0000000000000000 R08: ffffffff817a2250 R09: ffffed10128c82ed
R10: ffffed10128c82ed R11: 0000000000000000 R12: ffff888095318300
R13: 0000000000000000 R14: ffffc90001607f58 R15: ffffc90001607f58
FS: 0000000001cf2940(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 00000000a380c000 CR4: 00000000001406f0

Eric Biggers

unread,
Jul 7, 2020, 4:24:07 PM7/7/20
to syzbot, b...@alien8.de, h...@zytor.com, linux-...@vger.kernel.org, linux-...@vger.kernel.org, lu...@kernel.org, mi...@redhat.com, syzkall...@googlegroups.com, tg...@linutronix.de, vi...@zeniv.linux.org.uk, x...@kernel.org
On Tue, Jul 07, 2020 at 01:16:25PM -0700, syzbot wrote:
> syzbot has found a reproducer for the following crash on:
>
> HEAD commit: 7cc2a8ea Merge tag 'block-5.8-2020-07-01' of git://git.ker..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=14ed01a3100000
> kernel config: https://syzkaller.appspot.com/x/.config?x=183dd243398ba7ec
> dashboard link: https://syzkaller.appspot.com/bug?extid=7748c5375dc20dfdb92f
> compiler: clang version 10.0.0 (https://github.com/llvm/llvm-project/ c2443155a0fb245c8f17f2c1c72b6ea391e86e81)
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1469d28f100000
>

The reproducer uses ioctl$FBIOPUT_VSCREENINFO on /dev/fb0, which is generating
lots of other syzbot reports. This is probably another duplicate.
See https://lkml.kernel.org/lkml/000000000000ff...@google.com/T/#u
for some previous discussion.

syzbot

unread,
Sep 2, 2020, 5:41:07 PM9/2/20
to b...@alien8.de, daniel...@ffwll.ch, ebig...@kernel.org, gre...@linuxfoundation.org, h...@zytor.com, linux-...@vger.kernel.org, linux-...@vger.kernel.org, lu...@kernel.org, mi...@redhat.com, penguin...@i-love.sakura.ne.jp, penguin...@i-love.sakura.ne.jp, syzkall...@googlegroups.com, tg...@linutronix.de, vi...@zeniv.linux.org.uk, x...@kernel.org
syzbot suspects this issue was fixed by commit:

commit 033724d6864245a11f8e04c066002e6ad22b3fd0
Author: Tetsuo Handa <penguin...@I-love.SAKURA.ne.jp>
Date: Wed Jul 15 01:51:02 2020 +0000

fbdev: Detect integer underflow at "struct fbcon_ops"->clear_margins.

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=156ad38e900000
start commit: 7cc2a8ea Merge tag 'block-5.8-2020-07-01' of git://git.ker..
git tree: upstream
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1469d28f100000

If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: fbdev: Detect integer underflow at "struct fbcon_ops"->clear_margins.

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

Tetsuo Handa

unread,
Sep 2, 2020, 6:06:05 PM9/2/20
to syzbot, syzkaller-bugs
Reproducer is doing

ioctl$FBIOPUT_VSCREENINFO(r0, 0x4601, &(0x7f0000000000)={0x504, 0x0, 0x0, 0xf0, 0x0, 0x0, 0x4, 0x0, {}, {}, {}, {}, 0x3})

which might cause similar problem.

#syz dup: general protection fault in syscall_return_slowpath

Reply all
Reply to author
Forward
0 new messages