WSL2-Linux-Kernel/drivers/accessibility/speakup
Mushahid Hussain a190a83db2 speakup: fix a segfault caused by switching consoles
commit 0fc801f801 upstream.

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.

Fixes: 2610df4148 ("staging: speakup: Add pause command used on switching to graphical mode")
Cc: stable <stable@kernel.org>
Signed-off-by: Mushahid Hussain <mushi.shar@gmail.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Link: https://lore.kernel.org/r/20221010165720.397042-1-mushi.shar@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-11-26 09:24:44 +01:00
..
DefaultKeyAssignments
Kconfig
Makefile
TODO
buffers.c
devsynth.c
fakekey.c
i18n.c speakup: use C99 syntax for array initializers 2021-07-21 13:45:53 +02:00
i18n.h speakup: Separate out translations for bright colors names 2021-06-15 17:07:46 +02:00
keyhelp.c
kobjects.c
main.c speakup: fix a segfault caused by switching consoles 2022-11-26 09:24:44 +01:00
selection.c
serialio.c speakup: add the missing synth parameter to all io functions 2021-01-27 13:12:04 +01:00
serialio.h
speakup.h
speakup_acnt.h
speakup_acntpc.c speakup: add the missing synth parameter to all io functions 2021-01-27 13:12:04 +01:00
speakup_acntsa.c
speakup_apollo.c speakup: add the missing synth parameter to all io functions 2021-01-27 13:12:04 +01:00
speakup_audptr.c speakup: add the missing synth parameter to all io functions 2021-01-27 13:12:04 +01:00
speakup_bns.c
speakup_decext.c speakup: add the missing synth parameter to all io functions 2021-01-27 13:12:04 +01:00
speakup_decpc.c speakup: add the missing synth parameter to all io functions 2021-01-27 13:12:04 +01:00
speakup_dectlk.c speakup-dectlk: Restore pitch setting 2022-02-16 12:56:37 +01:00
speakup_dtlk.c speakup: add the missing synth parameter to all io functions 2021-01-27 13:12:04 +01:00
speakup_dtlk.h
speakup_dummy.c
speakup_keypc.c speakup: add the missing synth parameter to all io functions 2021-01-27 13:12:04 +01:00
speakup_ltlk.c speakup: add the missing synth parameter to all io functions 2021-01-27 13:12:04 +01:00
speakup_soft.c speakup: replace sprintf() by scnprintf() 2021-07-21 13:46:03 +02:00
speakup_spkout.c speakup: add the missing synth parameter to all io functions 2021-01-27 13:12:04 +01:00
speakup_txprt.c
speakupmap.h
speakupmap.map
spk_priv.h speakup: add the missing synth parameter to all io functions 2021-01-27 13:12:04 +01:00
spk_priv_keyinfo.h
spk_ttyio.c tty: the rest, stop using tty_schedule_flip() 2022-07-29 17:25:32 +02:00
spk_types.h speakup: Make dectlk flush timeout configurable 2021-02-04 17:05:48 +01:00
synth.c speakup: Make dectlk flush timeout configurable 2021-02-04 17:05:48 +01:00
thread.c
varhandlers.c speakup: Make dectlk flush timeout configurable 2021-02-04 17:05:48 +01:00