From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05E68C2F421 for ; Mon, 21 Jan 2019 16:41:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BBD8821721 for ; Mon, 21 Jan 2019 16:41:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548088904; bh=od4sZOQuXmRnJPsuAUZvEhigLHoURkMu1ndrArWPHvQ=; h=Subject:To:From:Date:List-ID:From; b=YJHpTiDLHxTmaB8ocVlrCZRCswCRP2rMBN41KLTvV82ENGyK45zXiRUtOb682vWcn fRV9swiY/OfwqwVj3PQaU05D5IvUWaxtzbrFLm7qsV48eZgaFddUayELr8xFYj4jDX 6HK4CDUbdfBq0QMWeLjNpaeSF3ykibGfyFu4igcw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730310AbfAUQlo (ORCPT ); Mon, 21 Jan 2019 11:41:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:34646 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729075AbfAUQlo (ORCPT ); Mon, 21 Jan 2019 11:41:44 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DF76C20870; Mon, 21 Jan 2019 16:41:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548088903; bh=od4sZOQuXmRnJPsuAUZvEhigLHoURkMu1ndrArWPHvQ=; h=Subject:To:From:Date:From; b=B9GpopCFsdk3ssHbee8VVDdbctJ8fTsuZG01TeAi5IdU51gtsJ7gS9OczzTbDoGvW IY8MMEduaaddy0HCX+dHsw4ArCvOqPFs6UIj/sayOqhNzYNCRHBJ9YtnLQJ7Tw9e6/ oRFW/AGyO9EXJIa8AHQlUCqr4OPIjcESYlPVPNfA= Subject: patch "tty: Handle problem if line discipline does not have receive_buf" added to tty-linus To: gregkh@linuxfoundation.org, jannh@google.com, stable@vger.kernel.org From: Date: Mon, 21 Jan 2019 17:41:31 +0100 Message-ID: <154808889114774@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This is a note to let you know that I've just added the patch titled tty: Handle problem if line discipline does not have receive_buf to my tty git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git in the tty-linus branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will hopefully also be merged in Linus's tree for the next -rc kernel release. If you have any questions about this process, please let me know. >From 27cfb3a53be46a54ec5e0bd04e51995b74c90343 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 20 Jan 2019 10:46:58 +0100 Subject: tty: Handle problem if line discipline does not have receive_buf Some tty line disciplines do not have a receive buf callback, so properly check for that before calling it. If they do not have this callback, just eat the character quietly, as we can't fail this call. Reported-by: Jann Horn Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/tty/tty_io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 23c6fd238422..21ffcce16927 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -2189,7 +2189,8 @@ static int tiocsti(struct tty_struct *tty, char __user *p) ld = tty_ldisc_ref_wait(tty); if (!ld) return -EIO; - ld->ops->receive_buf(tty, &ch, &mbz, 1); + if (ld->ops->receive_buf) + ld->ops->receive_buf(tty, &ch, &mbz, 1); tty_ldisc_deref(ld); return 0; } -- 2.20.1