]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 May 2022 23:19:27 +0000 (01:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 May 2022 23:19:27 +0000 (01:19 +0200)
added patches:
tty-n_gsm-fix-malformed-counter-for-out-of-frame-data.patch
tty-n_gsm-fix-wrong-signal-octet-encoding-in-convergence-layer-type-2.patch

queue-5.4/series
queue-5.4/tty-n_gsm-fix-malformed-counter-for-out-of-frame-data.patch [new file with mode: 0644]
queue-5.4/tty-n_gsm-fix-wrong-signal-octet-encoding-in-convergence-layer-type-2.patch [new file with mode: 0644]

index 1fe9940fab09be52ed217a9916fe91d1573ba45a..7ea7c1afecec8e58692f21b3e0d7fb190b0173b7 100644 (file)
@@ -72,3 +72,5 @@ cifs-destage-any-unwritten-data-to-the-server-before.patch
 drivers-net-hippi-fix-deadlock-in-rr_close.patch
 net-ethernet-stmmac-fix-write-to-sgmii_adapter_base.patch
 x86-cpu-load-microcode-during-restore_processor_state.patch
+tty-n_gsm-fix-wrong-signal-octet-encoding-in-convergence-layer-type-2.patch
+tty-n_gsm-fix-malformed-counter-for-out-of-frame-data.patch
diff --git a/queue-5.4/tty-n_gsm-fix-malformed-counter-for-out-of-frame-data.patch b/queue-5.4/tty-n_gsm-fix-malformed-counter-for-out-of-frame-data.patch
new file mode 100644 (file)
index 0000000..9abb1e2
--- /dev/null
@@ -0,0 +1,35 @@
+From a24b4b2f660b7ddf3f484b37600bba382cb28a9d Mon Sep 17 00:00:00 2001
+From: Daniel Starke <daniel.starke@siemens.com>
+Date: Thu, 14 Apr 2022 02:42:12 -0700
+Subject: tty: n_gsm: fix malformed counter for out of frame data
+
+From: Daniel Starke <daniel.starke@siemens.com>
+
+commit a24b4b2f660b7ddf3f484b37600bba382cb28a9d upstream.
+
+The gsm_mux field 'malformed' represents the number of malformed frames
+received. However, gsm1_receive() also increases this counter for any out
+of frame byte.
+Fix this by ignoring out of frame data for the malformed counter.
+
+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-7-daniel.starke@siemens.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/tty/n_gsm.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/tty/n_gsm.c
++++ b/drivers/tty/n_gsm.c
+@@ -1961,7 +1961,8 @@ static void gsm1_receive(struct gsm_mux
+               }
+               /* Any partial frame was a runt so go back to start */
+               if (gsm->state != GSM_START) {
+-                      gsm->malformed++;
++                      if (gsm->state != GSM_SEARCH)
++                              gsm->malformed++;
+                       gsm->state = GSM_START;
+               }
+               /* A SOF in GSM_START means we are still reading idling or
diff --git a/queue-5.4/tty-n_gsm-fix-wrong-signal-octet-encoding-in-convergence-layer-type-2.patch b/queue-5.4/tty-n_gsm-fix-wrong-signal-octet-encoding-in-convergence-layer-type-2.patch
new file mode 100644 (file)
index 0000000..18f75e6
--- /dev/null
@@ -0,0 +1,40 @@
+From 06d5afd4d640eea67f5623e76cd5fc03359b7f3c Mon Sep 17 00:00:00 2001
+From: Daniel Starke <daniel.starke@siemens.com>
+Date: Thu, 14 Apr 2022 02:42:10 -0700
+Subject: tty: n_gsm: fix wrong signal octet encoding in convergence layer type 2
+
+From: Daniel Starke <daniel.starke@siemens.com>
+
+commit 06d5afd4d640eea67f5623e76cd5fc03359b7f3c 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.5.2 describes that the signal octet in
+convergence layer type 2 can be either one or two bytes. The length is
+encoded in the EA bit. This is set 1 for the last byte in the sequence.
+gsmtty_modem_update() handles this correctly but gsm_dlci_data_output()
+fails to set EA to 1. There is no case in which we encode two signal octets
+as there is no case in which we send out a break signal.
+Therefore, always set the EA bit to 1 for the signal octet to fix this.
+
+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-5-daniel.starke@siemens.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/tty/n_gsm.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/tty/n_gsm.c
++++ b/drivers/tty/n_gsm.c
+@@ -823,7 +823,7 @@ static int gsm_dlci_data_output(struct g
+                       break;
+               case 2: /* Unstructed with modem bits.
+               Always one byte as we never send inline break data */
+-                      *dp++ = gsm_encode_modem(dlci);
++                      *dp++ = (gsm_encode_modem(dlci) << 1) | EA;
+                       break;
+               }
+               WARN_ON(kfifo_out_locked(dlci->fifo, dp , len, &dlci->lock) != len);