linux-stable/drivers/tty
daniel.starke@siemens.com 8838b2af23 tty: n_gsm: fix SW flow control encoding/handling
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.2.7.3 states that DC1 (XON) and DC3 (XOFF)
are the control characters defined in ISO/IEC 646. These shall be quoted if
seen in the data stream to avoid interpretation as flow control characters.

ISO/IEC 646 refers to the set of ISO standards described as the ISO
7-bit coded character set for information interchange. Its final version
is also known as ITU T.50.
See https://www.itu.int/rec/T-REC-T.50-199209-I/en

To abide the standard it is needed to quote DC1 and DC3 correctly if these
are seen as data bytes and not as control characters. The current
implementation already tries to enforce this but fails to catch all
defined cases. 3GPP 27.010 chapter 5.2.7.3 clearly states that the most
significant bit shall be ignored for DC1 and DC3 handling. The current
implementation handles only the case with the most significant bit set 0.
Cases in which DC1 and DC3 have the most significant bit set 1 are left
unhandled.

This patch fixes this by masking the data bytes with ISO_IEC_646_MASK (only
the 7 least significant bits set 1) before comparing them with XON
(a.k.a. DC1) and XOFF (a.k.a. DC3) when testing which byte values need
quotation via byte stuffing.

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/20220120101857.2509-1-daniel.starke@siemens.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-26 14:51:42 +01:00
..
hvc xen/console: harden hvc_xen against event channel storms 2021-12-16 08:24:08 +01:00
ipwireless tty: drop put_tty_driver 2021-07-27 12:17:21 +02:00
serdev Revert "serdev: BREAK/FRAME/PARITY/OVERRUN notification prototype V2" 2021-12-31 13:42:30 +01:00
serial serial: 8250: of: Fix mapped region size when using reg-offset property 2022-01-26 14:50:52 +01:00
vt tty: Fix the keyboard led light display problem 2021-12-21 09:19:14 +01:00
amiserial.c tty: drop put_tty_driver 2021-07-27 12:17:21 +02:00
ehv_bytechan.c tty: drop put_tty_driver 2021-07-27 12:17:21 +02:00
goldfish.c tty: goldfish: Use platform_get_irq() to get the interrupt 2021-12-30 13:50:05 +01:00
Kconfig tty: add rpmsg driver 2021-10-21 12:35:35 +02:00
Makefile tty: add rpmsg driver 2021-10-21 12:35:35 +02:00
mips_ejtag_fdc.c tty: mips_ejtag_fdc: Make use of the helper function kthread_run_on_cpu() 2021-12-03 16:00:41 +01:00
moxa.c tty: drivers/tty/, stop using tty_schedule_flip() 2021-11-25 18:35:23 +01:00
mxser.c mxser: use PCI_DEVICE_DATA 2021-11-25 18:33:22 +01:00
n_gsm.c tty: n_gsm: fix SW flow control encoding/handling 2022-01-26 14:51:42 +01:00
n_hdlc.c Linux 5.16-rc6 2021-12-20 10:00:30 +01:00
n_null.c
n_tty.c bitmap patches for 5.17-rc1 2022-01-23 06:20:44 +02:00
nozomi.c tty: drop put_tty_driver 2021-07-27 12:17:21 +02:00
pty.c
rpmsg_tty.c tty: rpmsg: Fix race condition releasing tty port 2022-01-26 14:50:26 +01:00
synclink_gt.c tty: synclink_gt: rename a conflicting function name 2021-09-14 10:51:37 +02:00
sysrq.c TTY / Serial driver update for 5.16-rc1 2021-11-04 09:09:37 -07:00
tty.h
tty_audit.c
tty_baudrate.c tty: baudrate: Explicit usage of B0 for encoding input baudrate 2021-10-05 15:00:56 +02:00
tty_buffer.c tty: reformat kernel-doc in tty_buffer.c 2021-11-26 16:27:43 +01:00
tty_io.c tty: tty_io: Switch to vmalloc() fallback in case of TTY_NO_WRITE_SPLIT 2021-12-21 09:18:44 +01:00
tty_ioctl.c tty: remove file from n_tty_ioctl_helper 2021-09-22 16:59:13 +02:00
tty_jobctrl.c
tty_ldisc.c tty: reformat kernel-doc in tty_ldisc.c 2021-11-26 16:27:43 +01:00
tty_ldsem.c tty/ldsem: Fix syntax errors in comments 2021-12-21 09:15:49 +01:00
tty_mutex.c
tty_port.c tty: add kernel-doc for more tty_port functions 2021-11-26 16:27:43 +01:00
ttynull.c tty: drop put_tty_driver 2021-07-27 12:17:21 +02:00
vcc.c tty: drop put_tty_driver 2021-07-27 12:17:21 +02:00