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=-12.0 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,URIBL_BLOCKED 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 1A539C282D7 for ; Wed, 30 Jan 2019 10:54:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E007C2184D for ; Wed, 30 Jan 2019 10:54:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548845664; bh=d4Lc8LQmofmkA00tjdGihsdOt0ar/A6j7TZVvWyZkGg=; h=Subject:To:From:Date:List-ID:From; b=cRYJSOk0Atnqo6iMFV3v3QW4TCu7th6nMQLSxKCYHUqStdteenQEL3dHb66y9Nvgm iakVFShn65166QMpX613Xrifkn8G1fl+LJCvAc7r98bSx1YNgduvjRGQHfoY90ddLU wIxSbX1D86r3750bk7yKbm4AlXUX158EXSZ9WSLE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728017AbfA3KyX (ORCPT ); Wed, 30 Jan 2019 05:54:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:53186 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726548AbfA3KyX (ORCPT ); Wed, 30 Jan 2019 05:54:23 -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 11BCD20857; Wed, 30 Jan 2019 10:54:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548845662; bh=d4Lc8LQmofmkA00tjdGihsdOt0ar/A6j7TZVvWyZkGg=; h=Subject:To:From:Date:From; b=khZp6v7MHNlQ0s3U8LgFOUgN4rWQpxr16l+edoS9Vag/LkIQCAZoFniMAidfya0Hz 5gXN7XQfMinMRxfhiBvv0ABURSc+48psFr0wuxc/IjzGekNOF3VS18Agmxh8mZzsZF axiGmEYtj0YuDBuxrdapxIJcndi05Q2NnrqPtEVo= Subject: patch "staging: speakup: fix tty-operation NULL derefs" added to tty-linus To: johan@kernel.org, gregkh@linuxfoundation.org, okash.khawaja@gmail.com, samuel.thibault@ens-lyon.org, stable@vger.kernel.org From: Date: Wed, 30 Jan 2019 11:54:19 +0100 Message-ID: <154884565910247@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 staging: speakup: fix tty-operation NULL derefs 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 a1960e0f1639cb1f7a3d94521760fc73091f6640 Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Wed, 30 Jan 2019 10:49:34 +0100 Subject: staging: speakup: fix tty-operation NULL derefs 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 Reviewed-by: Samuel Thibault Signed-off-by: Greg Kroah-Hartman --- 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