tty: WARNING in n_hdlc_tty_read

From: Dmitry Vyukov
Date: Fri Dec 11 2015 - 08:44:27 EST


Hello,

I am hitting the following WARNING on commit
aa53685549a2cfb5f175b0c4a20bc9aa1e5a1b85 (Dec 8):

------------[ cut here ]------------
WARNING: CPU: 2 PID: 24931 at kernel/sched/core.c:7557
__might_sleep+0x138/0x1a0()
do not call blocking ops when !TASK_RUNNING; state=1 set at
[<ffffffff82bf3066>] n_hdlc_tty_read+0x246/0x670
drivers/tty/n_hdlc.c:607
Modules linked in:
CPU: 2 PID: 24931 Comm: syzkaller_execu Not tainted 4.4.0-rc4+ #160
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
00000000ffffffff ffff880065297928 ffffffff82899b0d ffff880065297998
ffff880066bc0000 ffffffff85c3bf40 ffff880065297968 ffffffff812ebbb9
ffffffff813620c8 ffffed000ca52f2f ffffffff85c3bf40 0000000000001d85
Call Trace:
[<ffffffff812ebcc9>] warn_slowpath_fmt+0xa9/0xd0 kernel/panic.c:472
[<ffffffff813620c8>] __might_sleep+0x138/0x1a0 kernel/sched/core.c:7552
[<ffffffff8165e55f>] __might_fault+0xaf/0x1d0 mm/memory.c:3794
[< inline >] copy_to_user ./arch/x86/include/asm/uaccess.h:732
[<ffffffff82bf3355>] n_hdlc_tty_read+0x535/0x670 drivers/tty/n_hdlc.c:618
[<ffffffff82bcb345>] tty_read+0x165/0x250 drivers/tty/tty_io.c:1071
[<ffffffff8170f2b1>] do_loop_readv_writev+0x141/0x1e0 fs/read_write.c:680
[<ffffffff81711e18>] do_readv_writev+0x5f8/0x6e0 fs/read_write.c:810
[<ffffffff81711f83>] vfs_readv+0x83/0xb0 fs/read_write.c:834
[< inline >] SYSC_readv fs/read_write.c:860
[<ffffffff81714861>] SyS_readv+0x111/0x2b0 fs/read_write.c:852
[<ffffffff85b67576>] entry_SYSCALL_64_fastpath+0x16/0x7a
arch/x86/entry/entry_64.S:185
---[ end trace 4ace39d7f6cc3bf1 ]---


Seems to be introduced by:
commit 1035b63d3c6fc34a9b8c4a181366eec6d6158b31
Author: Paul Fulghum
Date: Tue Jan 18 14:03:25 2011 -0800
n_hdlc: fix read and write locking
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/