1
0
Fork 0
alistair23-linux/drivers/staging/speakup
Samuel Thibault 3b78db2646 speakup: Do not let the line discipline be used several times
commit d412275444 upstream.

Speakup has only one speakup_tty variable to store the tty it is managing. This
makes sense since its codebase currently assumes that there is only one user who
controls the screen reading.

That however means that we have to forbid using the line discipline several
times, otherwise the second closure would try to free a NULL ldisc_data, leading to

general protection fault: 0000 [#1] SMP KASAN PTI
RIP: 0010:spk_ttyio_ldisc_close+0x2c/0x60
Call Trace:
 tty_ldisc_release+0xa2/0x340
 tty_release_struct+0x17/0xd0
 tty_release+0x9d9/0xcc0
 __fput+0x231/0x740
 task_work_run+0x12c/0x1a0
 do_exit+0x9b5/0x2230
 ? release_task+0x1240/0x1240
 ? __do_page_fault+0x562/0xa30
 do_group_exit+0xd5/0x2a0
 __x64_sys_exit_group+0x35/0x40
 do_syscall_64+0x89/0x2b0
 ? page_fault+0x8/0x30
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

Cc: stable@vger.kernel.org
Reported-by: 秦世松 <qinshisong1205@gmail.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Tested-by: Shisong Qin <qinshisong1205@gmail.com>
Link: https://lore.kernel.org/r/20201110183541.fzgnlwhjpgqzjeth@function
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-24 13:29:20 +01:00
..
DefaultKeyAssignments
Kconfig
Makefile
TODO
buffers.c
devsynth.c
fakekey.c
i18n.c
i18n.h
keyhelp.c
kobjects.c
main.c staging/speakup: fix get_word non-space look-ahead 2020-03-25 08:25:55 +01:00
selection.c vt: selection, push console lock down 2020-03-12 13:00:21 +01:00
serialio.c
serialio.h staging: speakup: serialio: fix warning linux/serial.h is included more than once 2019-05-30 13:59:16 -07:00
speakup.h staging: speakup: refactor to use existing code in vt 2019-04-19 15:09:10 +02:00
speakup_acnt.h
speakup_acntpc.c
speakup_acntsa.c
speakup_apollo.c
speakup_audptr.c
speakup_bns.c
speakup_decext.c
speakup_decpc.c
speakup_dectlk.c
speakup_dtlk.c
speakup_dtlk.h
speakup_dummy.c
speakup_keypc.c
speakup_ltlk.c
speakup_soft.c
speakup_spkout.c
speakup_txprt.c
speakupmap.h
speakupmap.map
spk_priv.h
spk_priv_keyinfo.h
spk_ttyio.c speakup: Do not let the line discipline be used several times 2020-11-24 13:29:20 +01:00
spk_types.h
spkguide.txt
synth.c
sysfs-driver-speakup staging: speakup: document sysfs attributes 2019-10-04 10:06:05 +02:00
thread.c
varhandlers.c