mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Mushahid Hussain <mushi.shar@gmail.com>
Cc: samuel.thibault@ens-lyon.org, speakup@linux-speakup.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Speakup: fix a segfault caused by switching consoles
Date: Mon, 10 Oct 2022 19:02:46 +0200	[thread overview]
Message-ID: <Y0RQNt80BnQjozZC@kroah.com> (raw)
In-Reply-To: <20221010165720.397042-1-mushi.shar@gmail.com>

On Mon, Oct 10, 2022 at 09:57:20PM +0500, Mushahid Hussain wrote:
> This patch fixes a segfault by adding a null check on synth in
> speakup_con_update(). The segfault can be reproduced as follows:
> 
> 	- Login into a text console
> 
> 	- Load speakup and speakup_soft modules
> 
> 	- Remove speakup_soft
> 
> 	- Switch to a graphics console
> 
> This is caused by lack of a null check on `synth` in
> speakup_con_update().
> 
> Here's the sequence that causes the segfault:
> 
> 	- When we remove the speakup_soft, synth_release() sets the synth
> 	  to null.
> 
> 	- After that, when we change the virtual console to graphics
> 	  console, vt_notifier_call() is fired, which then calls
> 	  speakup_con_update().
> 
> 	- Inside speakup_con_update() there's no null check on synth,
> 	  so it calls synth_printf().
> 
> 	- Inside synth_printf(), synth_buffer_add() and synth_start(),
> 	  both access synth, when it is null and causing a segfault.
> 
> Therefore adding a null check on synth solves the issue.
> 
> Signed-off-by: Mushahid Hussain <mushi.shar@gmail.com>
> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
> ---
>  drivers/accessibility/speakup/main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

What commit id does this fix?  Should it go to stable kernels?

thanks,

greg k-h

  reply	other threads:[~2022-10-10 17:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-10 16:57 Mushahid Hussain
2022-10-10 17:02 ` Greg KH [this message]
2022-10-10 17:17   ` Samuel Thibault

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=Y0RQNt80BnQjozZC@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mushi.shar@gmail.com \
    --cc=samuel.thibault@ens-lyon.org \
    --cc=speakup@linux-speakup.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

all inboxes | Powered by JetHome®