linux-stable/drivers/tty
Daniel Starke 0a7fe1a47c tty: n_gsm: fix insufficient txframe size
commit 535bf600de upstream.

n_gsm is based on the 3GPP 07.010 and its newer version is the 3GPP 27.010.
See https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1516
The changes from 07.010 to 27.010 are non-functional. Therefore, I refer to
the newer 27.010 here. Chapter 5.7.2 states that the maximum frame size
(N1) refers to the length of the information field (i.e. user payload).
However, 'txframe' stores the whole frame including frame header, checksum
and start/end flags. We also need to consider the byte stuffing overhead.
Define constant for the protocol overhead and adjust the 'txframe' size
calculation accordingly to reserve enough space for a complete mux frame
including byte stuffing for advanced option mode. Note that no byte
stuffing is applied to the start and end flag.
Also use MAX_MTU instead of MAX_MRU as this buffer is used for data
transmission.

Fixes: e1eaea46bb ("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-8-daniel.starke@siemens.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-05-09 09:14:43 +02:00
..
hvc tty: hvc: fix return value of __setup handler 2022-04-08 14:23:50 +02:00
ipwireless
serdev
serial serial: 8250: Correct the clock for EndRun PTP/1588 PCIe device 2022-05-09 09:14:30 +02:00
vt vt_ioctl: add array_index_nospec to VT_ACTIVATE 2022-02-16 12:56:33 +01:00
amiserial.c
ehv_bytechan.c
goldfish.c
Kconfig
Makefile
mips_ejtag_fdc.c
moxa.c
moxa.h
mxser.c mxser: fix xmit_buf leak in activate when LSR == 0xff 2022-04-08 14:23:43 +02:00
n_gsm.c tty: n_gsm: fix insufficient txframe size 2022-05-09 09:14:43 +02:00
n_hdlc.c tty: n_hdlc: make n_hdlc_tty_wakeup() asynchronous 2021-12-22 09:32:45 +01:00
n_null.c
n_tty.c tty: n_tty: do not look ahead for EOL character past the end of the buffer 2022-02-23 12:03:15 +01:00
nozomi.c
pty.c
synclink_gt.c
sysrq.c
tty.h
tty_audit.c
tty_baudrate.c
tty_buffer.c tty: tty_buffer: Fix the softlockup issue in flush_to_ldisc 2021-11-25 09:48:28 +01:00
tty_io.c
tty_ioctl.c
tty_jobctrl.c
tty_ldisc.c
tty_ldsem.c
tty_mutex.c
tty_port.c
ttynull.c
vcc.c