Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5695037imu; Wed, 30 Jan 2019 01:55:21 -0800 (PST) X-Google-Smtp-Source: ALg8bN7KKuFMJxSEv3MYx5fgzJLfLuRou0+tTgRowLaSpNTZ9ow8jS3HCWt7O/Gfl8mEn3+MUOZz X-Received: by 2002:a17:902:442:: with SMTP id 60mr28153508ple.73.1548842121778; Wed, 30 Jan 2019 01:55:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548842121; cv=none; d=google.com; s=arc-20160816; b=tQIu/k0Ei+EUU04KCEyb/MhzkuEElyREcaNey4KXf1pxXD1Cz6SGIvf8X9m9KkKZ7u Iddt4i+cakF2RlyNMLDysHMgwpzXGKmXcmNKNsqS9tAbkXgKrIRLUWMEMNpxfahUej/9 TYw+ejZEqLkoQFQaxB+Hs1AaK0Jj0GL6rfIlg0i6Zwox7SS+at3FF3jxnliQBFKPJqqG iplweJWriq95VMdZ6kXSCz18S2v8Ha/gsn9qgeopMQAwWND+Wqa3qZ5A+5z1vzA5yl9d AAupOHXdyi3RcD2GX0M6O7ikKTGqZXeTVLCuATPe1Hi+EUqU471UOsUSlCh3/OFmpAFV JBCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date; bh=5cRyPD2tTa1vX2VEqkvgaopal37bN6BRUKjQ65BNLN4=; b=anV219+Zm/C+Svg4Jgc/itAky38/HYdSeNH/CBRlCX3iB8S0XEHLBEioiGMKhFUbWt /iVJ8EjbuTMbRdRaBOzgzWC5/gX/DLxTEd3uTfLBuwaZJgaPOc5PPRRXW47NrydVNih6 n7dC3RY/mczsf4j3OAceG78k9jIKOlBizdofXHR6FO61oxKddO4vWYA/ciUScwguVXbC kbPP95PwZ7vvWkOViMr4OIIzV8zalXt11y7YzKZvQh9JieasjKxE0cJZpikY9/72oBxJ xngWtjMmhB9b83S2eQvclI/DETaplvOEzkhbYUcH1HRdgpWp6rXzcDfLUewGMjBQw0Vh D9nw== ARC-Authentication-Results: i=1; mx.google.com; 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 e3si1045630pfe.203.2019.01.30.01.55.06; Wed, 30 Jan 2019 01:55:21 -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; 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 S1730588AbfA3Jyq (ORCPT + 99 others); Wed, 30 Jan 2019 04:54:46 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:9517 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726406AbfA3Jyp (ORCPT ); Wed, 30 Jan 2019 04:54:45 -0500 X-IronPort-AV: E=Sophos;i="5.56,540,1539640800"; d="scan'208";a="293767244" Received: from unknown (HELO function) ([193.50.110.115]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/AES256-GCM-SHA384; 30 Jan 2019 10:54:27 +0100 Received: from samy by function with local (Exim 4.92-RC4) (envelope-from ) id 1gomZf-00044o-LG; Wed, 30 Jan 2019 10:54:27 +0100 Date: Wed, 30 Jan 2019 10:54:27 +0100 From: Samuel Thibault To: Johan Hovold Cc: Greg Kroah-Hartman , speakup@linux-speakup.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, stable , Okash Khawaja Subject: Re: [PATCH] staging: speakup: fix tty-operation NULL derefs Message-ID: <20190130095427.yzaxbuuctd7uyqje@function> Mail-Followup-To: Samuel Thibault , Johan Hovold , Greg Kroah-Hartman , speakup@linux-speakup.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, stable , Okash Khawaja References: <20190130094934.4231-1-johan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190130094934.4231-1-johan@kernel.org> Organization: I am not organized User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Johan Hovold, le mer. 30 janv. 2019 10:49:34 +0100, a ecrit: > The send_xchar() and tiocmset() tty operations are optional. Add the > missing sanity checks to prevent user-space triggerable NULL-pointer > dereferences. > > Fixes: 6b9ad1c742bf ("staging: speakup: add send_xchar, tiocmset and input functionality for tty") > Cc: stable # 4.13 > Cc: Okash Khawaja > Cc: Samuel Thibault > Signed-off-by: Johan Hovold Indeed. Reviewed-by: Samuel Thibault > --- > drivers/staging/speakup/spk_ttyio.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/speakup/spk_ttyio.c b/drivers/staging/speakup/spk_ttyio.c > index c92bbd05516e..005de0024dd4 100644 > --- a/drivers/staging/speakup/spk_ttyio.c > +++ b/drivers/staging/speakup/spk_ttyio.c > @@ -265,7 +265,8 @@ static void spk_ttyio_send_xchar(char ch) > return; > } > > - speakup_tty->ops->send_xchar(speakup_tty, ch); > + if (speakup_tty->ops->send_xchar) > + speakup_tty->ops->send_xchar(speakup_tty, ch); > mutex_unlock(&speakup_tty_mutex); > } > > @@ -277,7 +278,8 @@ static void spk_ttyio_tiocmset(unsigned int set, unsigned int clear) > return; > } > > - speakup_tty->ops->tiocmset(speakup_tty, set, clear); > + if (speakup_tty->ops->tiocmset) > + speakup_tty->ops->tiocmset(speakup_tty, set, clear); > mutex_unlock(&speakup_tty_mutex); > } > > -- > 2.20.1 > -- Samuel R: Parce que ça renverse bêtement l'ordre naturel de lecture! Q: Mais pourquoi citer en fin d'article est-il si effroyable? R: Citer en fin d'article Q: Quelle est la chose la plus désagréable sur les groupes de news?