]> www.infradead.org Git - users/dwmw2/linux.git/commit
tty: n_gsm: fix reset fifo race condition
authorDaniel Starke <daniel.starke@siemens.com>
Thu, 14 Apr 2022 09:42:22 +0000 (02:42 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 May 2022 07:05:08 +0000 (09:05 +0200)
commit70b045d9ae4fc59cb93dd43c5f87abd435f12b54
tree4b0e4ad9cb8c52502ee8f94e97ffc4c0bfad58f1
parent320a24c4ef447091a7d6c84c2c2c2d176b42f8ac
tty: n_gsm: fix reset fifo race condition

commit 73029a4d7161f8b6c0934553145ef574d2d0c645 upstream.

gsmtty_write() and gsm_dlci_data_output() properly guard the fifo access.
However, gsm_dlci_close() and gsmtty_flush_buffer() modifies the fifo but
do not guard this.
Add a guard here to prevent race conditions on parallel writes to the fifo.

Fixes: e1eaea46bb40 ("tty: n_gsm line discipline")
Cc: stable@vger.kernel.org
Signed-off-by: Daniel Starke <daniel.starke@siemens.com>
Link: https://lore.kernel.org/r/20220414094225.4527-17-daniel.starke@siemens.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/n_gsm.c