https://github.com/torvalds/linux
Revision 3d63b7e4ae0dc5e02d28ddd2fa1f945defc68d81 authored by Tetsuo Handa on 26 May 2018, 00:53:13 UTC, committed by Greg Kroah-Hartman on 28 June 2018, 12:30:16 UTC
syzbot is reporting stalls at n_tty_receive_char_special() [1]. This is
because comparison is not working as expected since ldata->read_head can
change at any moment. Mitigate this by explicitly masking with buffer size
when checking condition for "while" loops.

[1] https://syzkaller.appspot.com/bug?id=3d7481a346958d9469bebbeb0537d5f056bdd6e8

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Reported-by: syzbot <syzbot+18df353d7540aa6b5467@syzkaller.appspotmail.com>
Fixes: bc5a5e3f45d04784 ("n_tty: Don't wrap input buffer indices at buffer size")
Cc: stable <stable@vger.kernel.org>
Cc: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 7daf201
History
Tip revision: 3d63b7e4ae0dc5e02d28ddd2fa1f945defc68d81 authored by Tetsuo Handa on 26 May 2018, 00:53:13 UTC
n_tty: Fix stall at n_tty_receive_char_special().
Tip revision: 3d63b7e
File Mode Size
Makefile -rw-r--r-- 361 bytes
compat.c -rw-r--r-- 2.2 KB
ipc_sysctl.c -rw-r--r-- 5.4 KB
mq_sysctl.c -rw-r--r-- 2.9 KB
mqueue.c -rw-r--r-- 39.0 KB
msg.c -rw-r--r-- 29.7 KB
msgutil.c -rw-r--r-- 3.6 KB
namespace.c -rw-r--r-- 4.8 KB
sem.c -rw-r--r-- 61.2 KB
shm.c -rw-r--r-- 41.6 KB
syscall.c -rw-r--r-- 4.7 KB
util.c -rw-r--r-- 22.6 KB
util.h -rw-r--r-- 8.9 KB

back to top