]> git.baikalelectronics.ru Git - kernel.git/commit
tty: Use __GFP_NOFAIL for tty_ldisc_get()
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Wed, 25 Apr 2018 11:12:31 +0000 (20:12 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Apr 2018 13:03:44 +0000 (15:03 +0200)
commit843feaf87cbfec6c6465f8f29ab4d70625638dac
treeb022d1770f2ab76607c0071636e2012daa678cdb
parent0b37e44320353a12630c4ee753160577386e4093
tty: Use __GFP_NOFAIL for tty_ldisc_get()

syzbot is reporting crashes triggered by memory allocation fault injection
at tty_ldisc_get() [1]. As an attempt to handle OOM in a graceful way, we
have tried commit 00bade1afca705b7 ("tty: don't panic on OOM in
tty_set_ldisc()"). But we reverted that attempt by commit 767636a5ab8aed1a
("Revert "tty: don't panic on OOM in tty_set_ldisc()"") due to reproducible
crash. We should spend resource for finding and fixing race condition bugs
rather than complicate error paths for 2 * sizeof(void *) bytes allocation
failure.

[1] https://syzkaller.appspot.com/bug?id=489d33fa386453859ead58ff5171d43772b13aa3

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Reported-by: syzbot <syzbot+40b7287c2dc987c48c81@syzkaller.appspotmail.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Vegard Nossum <vegard.nossum@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Peter Hurley <peter@hurleysoftware.com>
Cc: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_ldisc.c