BUG: sleeping function called from invalid context in __do_page_fault

8 views
Skip to first unread message

syzbot

unread,
Aug 17, 2019, 9:17:06 PM8/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=1539d49c600000
kernel config: https://syzkaller.appspot.com/x/.config?x=8e5f93d2c874cdab
dashboard link: https://syzkaller.appspot.com/bug?extid=bdc436f2f85b2ea3be27
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=15a4fc4c600000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13d7e76a600000

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

IPv6: ADDRCONF(NETDEV_CHANGE): hsr_slave_1: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): hsr0: link becomes ready
IPv6: ADDRCONF(NETDEV_UP): vxcan1: link is not ready
8021q: adding VLAN 0 to HW filter on device batadv0
BUG: sleeping function called from invalid context at
arch/x86/mm/fault.c:1333
in_atomic(): 0, irqs_disabled(): 1, pid: 7664, name: syz-executor703
4 locks held by syz-executor703/7664:
#0: 0000000082188cc4 (&tty->ldisc_sem){++++}, at:
ldsem_down_read+0x33/0x40 drivers/tty/tty_ldsem.c:362
#1: 0000000027bf4400 (&tty->termios_rwsem){++++}, at:
tty_unthrottle+0x20/0x100 drivers/tty/tty_ioctl.c:136
#2: 000000002ca40604 (&tty->ldisc_sem){++++}, at: tty_ldisc_ref+0x22/0x90
drivers/tty/tty_ldisc.c:293
#3: 0000000035e14d6e (&mm->mmap_sem){++++}, at:
__do_page_fault+0x3c9/0xe90 arch/x86/mm/fault.c:1319
irq event stamp: 12
hardirqs last enabled at (11): [<ffffffff8100a0c6>]
do_syscall_64+0x26/0x620 arch/x86/entry/common.c:280
hardirqs last disabled at (12): [<ffffffff81460159>]
queue_work_on+0x99/0x200 kernel/workqueue.c:1483
softirqs last enabled at (0): [<ffffffff813e47be>]
copy_process.part.0+0x158e/0x7a30 kernel/fork.c:1835
softirqs last disabled at (0): [<0000000000000000>] (null)
CPU: 0 PID: 7664 Comm: syz-executor703 Not tainted 4.19.67 #41
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+0x172/0x1f0 lib/dump_stack.c:113
___might_sleep.cold+0x1bd/0x1f6 kernel/sched/core.c:6150
__might_sleep+0x95/0x190 kernel/sched/core.c:6103
__do_page_fault+0x3f4/0xe90 arch/x86/mm/fault.c:1333
do_page_fault+0x71/0x57d arch/x86/mm/fault.c:1465
page_fault+0x1e/0x30 arch/x86/entry/entry_64.S:1204
RIP: 0010:test_and_set_bit arch/x86/include/asm/bitops.h:209 [inline]
RIP: 0010:queue_work_on+0x99/0x200 kernel/workqueue.c:1485
Code: 03 80 3c 10 00 0f 85 4a 01 00 00 48 83 3d 8e 43 2c 07 00 0f 84 16 01
00 00 e8 e3 5d 25 00 fa 66 0f 1f 44 00 00 e8 07 93 2a 00 <f0> 49 0f ba 2c
24 00 41 0f 92 c5 31 ff 45 31 ff 44 89 ee e8 ff 5e
RSP: 0018:ffff8880a5b97a30 EFLAGS: 00010082
RAX: 0000000000000007 RBX: 0000000000000293 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8880a0fac844
RBP: ffff8880a5b97a60 R08: ffff8880a0fac000 R09: 0000000000000002
R10: ffff8880a0fac8d0 R11: 000000007ad05ee4 R12: 0000000000000050
R13: ffffffff841ddb90 R14: ffff88812c3ec7c0 R15: ffff88809e6dac80
queue_work include/linux/workqueue.h:512 [inline]
schedule_work include/linux/workqueue.h:570 [inline]
slcan_write_wakeup+0x66/0x90 drivers/net/can/slcan.c:348
tty_wakeup+0xdc/0x110 drivers/tty/tty_io.c:534
pty_unthrottle+0x37/0x50 drivers/tty/pty.c:94
tty_unthrottle+0x9a/0x100 drivers/tty/tty_ioctl.c:139
__tty_perform_flush+0x1b3/0x200 drivers/tty/tty_ioctl.c:861
n_tty_ioctl_helper+0x1cc/0x3b0 drivers/tty/tty_ioctl.c:937
n_tty_ioctl+0x59/0x360 drivers/tty/n_tty.c:2464
tty_ioctl+0x8b5/0x1510 drivers/tty/tty_io.c:2678
vfs_ioctl fs/ioctl.c:46 [inline]
file_ioctl fs/ioctl.c:501 [inline]
do_vfs_ioctl+0xd5f/0x1380 fs/ioctl.c:688
ksys_ioctl+0xab/0xd0 fs/ioctl.c:705
__do_sys_ioctl fs/ioctl.c:712 [inline]
__se_sys_ioctl fs/ioctl.c:710 [inline]
__x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:710
do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x447a69
Code: e8 4c 15 03 00 48 83 c4 18 c3 0f 1f 80 00 00 00 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 9b 0c fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f564736dc48 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000006ddc58 RCX: 0000000000447a69
RDX: 0000000000000000 RSI: 000000000000540b RDI: 0000000000000003
RBP: 00000000006ddc50 R08: 00007f564736e700 R09: 0000000000000000
R10: 00007f564736e700 R11: 0000000000000246 R12: 00000000006ddc5c
R13: 00007ffcf6ea5fdf R14: 00007f564736e9c0 R15: 0000000000000006
BUG: unable to handle kernel NULL pointer dereference at 0000000000000050
PGD 903ae067 P4D 903ae067 PUD 94b42067 PMD 0
Oops: 0002 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 7664 Comm: syz-executor703 Tainted: G W 4.19.67
#41
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
RIP: 0010:test_and_set_bit arch/x86/include/asm/bitops.h:209 [inline]
RIP: 0010:queue_work_on+0x99/0x200 kernel/workqueue.c:1485
Code: 03 80 3c 10 00 0f 85 4a 01 00 00 48 83 3d 8e 43 2c 07 00 0f 84 16 01
00 00 e8 e3 5d 25 00 fa 66 0f 1f 44 00 00 e8 07 93 2a 00 <f0> 49 0f ba 2c
24 00 41 0f 92 c5 31 ff 45 31 ff 44 89 ee e8 ff 5e
RSP: 0018:ffff8880a5b97a30 EFLAGS: 00010082
RAX: 0000000000000007 RBX: 0000000000000293 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8880a0fac844
RBP: ffff8880a5b97a60 R08: ffff8880a0fac000 R09: 0000000000000002
R10: ffff8880a0fac8d0 R11: 000000007ad05ee4 R12: 0000000000000050
R13: ffffffff841ddb90 R14: ffff88812c3ec7c0 R15: ffff88809e6dac80
FS: 00007f564736e700(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000050 CR3: 0000000093dcd000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
queue_work include/linux/workqueue.h:512 [inline]
schedule_work include/linux/workqueue.h:570 [inline]
slcan_write_wakeup+0x66/0x90 drivers/net/can/slcan.c:348
tty_wakeup+0xdc/0x110 drivers/tty/tty_io.c:534
pty_unthrottle+0x37/0x50 drivers/tty/pty.c:94
tty_unthrottle+0x9a/0x100 drivers/tty/tty_ioctl.c:139
__tty_perform_flush+0x1b3/0x200 drivers/tty/tty_ioctl.c:861
n_tty_ioctl_helper+0x1cc/0x3b0 drivers/tty/tty_ioctl.c:937
n_tty_ioctl+0x59/0x360 drivers/tty/n_tty.c:2464
tty_ioctl+0x8b5/0x1510 drivers/tty/tty_io.c:2678
vfs_ioctl fs/ioctl.c:46 [inline]
file_ioctl fs/ioctl.c:501 [inline]
do_vfs_ioctl+0xd5f/0x1380 fs/ioctl.c:688
ksys_ioctl+0xab/0xd0 fs/ioctl.c:705
__do_sys_ioctl fs/ioctl.c:712 [inline]
__se_sys_ioctl fs/ioctl.c:710 [inline]
__x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:710
do_syscall_64+0xfd/0x620 arch/x86/entry/common.c:293
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x447a69
Code: e8 4c 15 03 00 48 83 c4 18 c3 0f 1f 80 00 00 00 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 9b 0c fc ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f564736dc48 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000006ddc58 RCX: 0000000000447a69
RDX: 0000000000000000 RSI: 000000000000540b RDI: 0000000000000003
RBP: 00000000006ddc50 R08: 00007f564736e700 R09: 0000000000000000
R10: 00007f564736e700 R11: 0000000000000246 R12: 00000000006ddc5c
R13: 00007ffcf6ea5fdf R14: 00007f564736e9c0 R15: 0000000000000006
Modules linked in:
CR2: 0000000000000050
---[ end trace 2bcf464bdd1ff016 ]---
RIP: 0010:test_and_set_bit arch/x86/include/asm/bitops.h:209 [inline]
RIP: 0010:queue_work_on+0x99/0x200 kernel/workqueue.c:1485
Code: 03 80 3c 10 00 0f 85 4a 01 00 00 48 83 3d 8e 43 2c 07 00 0f 84 16 01
00 00 e8 e3 5d 25 00 fa 66 0f 1f 44 00 00 e8 07 93 2a 00 <f0> 49 0f ba 2c
24 00 41 0f 92 c5 31 ff 45 31 ff 44 89 ee e8 ff 5e
RSP: 0018:ffff8880a5b97a30 EFLAGS: 00010082
RAX: 0000000000000007 RBX: 0000000000000293 RCX: 0000000000000000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8880a0fac844
RBP: ffff8880a5b97a60 R08: ffff8880a0fac000 R09: 0000000000000002
R10: ffff8880a0fac8d0 R11: 000000007ad05ee4 R12: 0000000000000050
R13: ffffffff841ddb90 R14: ffff88812c3ec7c0 R15: ffff88809e6dac80
FS: 00007f564736e700(0000) GS:ffff8880ae800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000050 CR3: 0000000093dcd000 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 can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches
Reply all
Reply to author
Forward
0 new messages