Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp3642895ima; Mon, 4 Feb 2019 02:41:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN4fTmC1rUHxO6JAts2K4xNC+gTHIatHBRlgjWqjqe4j4WUXXG9yOZKgm416DSTgJnxDmMr0 X-Received: by 2002:a17:902:f082:: with SMTP id go2mr51097689plb.115.1549276863336; Mon, 04 Feb 2019 02:41:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549276863; cv=none; d=google.com; s=arc-20160816; b=UIeczzJGKw2sMb+p4XI17+i1fmOjUshdzepnfjcxz6Ky7ZMmMdAD2TtjE2bBf81qBv 1e5YRwmLUhNrcdCszpxDTDCqyofQ+wN9jtvEhM+4l8pPd8ZqpmfR5G9aH7v5mgCf9QjD NooGzktcXQlPD+yVwNxBXBJ4jvcaQFX65jcWGDm8rsmRAnNGD5sOga8XhwaNM7FVlm6a DPOlcpmBmhkHWZSSW8UuufGgxujLvSOY6MuaY0uq8VmqIQjJSuti6FLJRJLxLV1bqk/Q oZ3xeuK80Bg39DZ7JRSwFPHYL3XcPlBAhEPU8rOStlaN0mmcazzwVVYY/xK+n8boYrgu KD2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zHPZKxAqWHOEgQGLHfr0WM+r+dD5u4kE3n89JYUof7k=; b=WjPaWm0xSM03cjBu+b10ju3L/6Qs+Tzhabjgal9AX8qd6G8KhjGvInIPEVSlNNY2Ju CXjPofxs7w+4l385xqlWQlXiqLxp0RDC/Xa5fI9+gdzHPc961qRlS8JXAnM9VLYghNWV XgVChnwCEp5mAOcbxY11xSBtZzS+0RZKqD5Nr4M/sfd5g9569B6gP9YmGfHTy5SbCLZz 72qK+GHy0DHJyee5bg8HpMmsJlz34Z9S+SmBYTy93ECRb750ab2z5SonQDuV6U2PjARe qy4AdnnEfsHgMuMoR2nCyOXBQPQiUJ3imTwssp+SDy0xqsFjMfMVsfc6nyC989f+93NJ J3mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LWQy4I2h; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5si10752834plr.355.2019.02.04.02.40.47; Mon, 04 Feb 2019 02:41:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LWQy4I2h; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729862AbfBDKjv (ORCPT + 99 others); Mon, 4 Feb 2019 05:39:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:37810 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729837AbfBDKjs (ORCPT ); Mon, 4 Feb 2019 05:39:48 -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 6F7C52075B; Mon, 4 Feb 2019 10:39:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549276787; bh=OSLyDtD8/6R59W91vHBHbDESVzOgGVB2Y3Lsewy5RRU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LWQy4I2hc+kFK32PUROnO8ediWdAl6Ve4atBFdueLQC+6tAttkOwBM48qtbwLpd2g GI1ZmcG9wtJftbBhUKI7Bh1AYaYOnAD5vWxIYCtmPpVvl8BjGKzop5pCEsbOiNtSdR QYdYR85uF7RuPestmyvEp13IPPY7lU+iCJ1cbOqk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jann Horn Subject: [PATCH 4.4 15/65] tty: Handle problem if line discipline does not have receive_buf Date: Mon, 4 Feb 2019 11:36:08 +0100 Message-Id: <20190204103612.951652448@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190204103610.583715954@linuxfoundation.org> References: <20190204103610.583715954@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Greg Kroah-Hartman commit 27cfb3a53be46a54ec5e0bd04e51995b74c90343 upstream. 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(-) --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -2297,7 +2297,8 @@ static int tiocsti(struct tty_struct *tt return -EFAULT; tty_audit_tiocsti(tty, ch); ld = tty_ldisc_ref_wait(tty); - 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; }