public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Johan Hovold <johan@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	speakup@linux-speakup.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org, stable <stable@vger.kernel.org>,
	Okash Khawaja <okash.khawaja@gmail.com>
Subject: Re: [PATCH] staging: speakup: fix tty-operation NULL derefs
Date: Wed, 30 Jan 2019 10:54:27 +0100	[thread overview]
Message-ID: <20190130095427.yzaxbuuctd7uyqje@function> (raw)
In-Reply-To: <20190130094934.4231-1-johan@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 <stable@vger.kernel.org>     # 4.13
> Cc: Okash Khawaja <okash.khawaja@gmail.com>
> Cc: Samuel Thibault <samuel.thibault@ens-lyon.org>
> Signed-off-by: Johan Hovold <johan@kernel.org>

Indeed.

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> ---
>  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?

      reply	other threads:[~2019-01-30  9:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-30  9:49 [PATCH] staging: speakup: fix tty-operation NULL derefs Johan Hovold
2019-01-30  9:54 ` Samuel Thibault [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190130095427.yzaxbuuctd7uyqje@function \
    --to=samuel.thibault@ens-lyon.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=okash.khawaja@gmail.com \
    --cc=speakup@linux-speakup.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox