From b1726fb37b73e15f57fa37b59849c5691bbf00a5 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Sun, 7 Feb 2021 22:55:10 -0500 Subject: [PATCH] Fixes for 4.9 Signed-off-by: Sasha Levin --- .../input-i8042-unbreak-pegatron-c15b.patch | 45 ++++++++++++++++ ...copy-the-skb-before-sending-a-packet.patch | 51 +++++++++++++++++++ queue-4.9/series | 2 + 3 files changed, 98 insertions(+) create mode 100644 queue-4.9/input-i8042-unbreak-pegatron-c15b.patch create mode 100644 queue-4.9/net-lapb-copy-the-skb-before-sending-a-packet.patch diff --git a/queue-4.9/input-i8042-unbreak-pegatron-c15b.patch b/queue-4.9/input-i8042-unbreak-pegatron-c15b.patch new file mode 100644 index 00000000000..d23d23a6a8b --- /dev/null +++ b/queue-4.9/input-i8042-unbreak-pegatron-c15b.patch @@ -0,0 +1,45 @@ +From d35b81f6fbf62954e53ed8e79535669cdca1b8dc Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 3 Jan 2021 17:59:51 -0800 +Subject: Input: i8042 - unbreak Pegatron C15B +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Alexey Dobriyan + +[ Upstream commit a3a9060ecad030e2c7903b2b258383d2c716b56c ] + +g++ reports + + drivers/input/serio/i8042-x86ia64io.h:225:3: error: ‘.matches’ designator used multiple times in the same initializer list + +C99 semantics is that last duplicated initialiser wins, +so DMI entry gets overwritten. + +Fixes: a48491c65b51 ("Input: i8042 - add ByteSpeed touchpad to noloop table") +Signed-off-by: Alexey Dobriyan +Acked-by: Po-Hsu Lin +Link: https://lore.kernel.org/r/20201228072335.GA27766@localhost.localdomain +Signed-off-by: Dmitry Torokhov +Signed-off-by: Sasha Levin +--- + drivers/input/serio/i8042-x86ia64io.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h +index fa07be0b4500e..2317f8d3fef6f 100644 +--- a/drivers/input/serio/i8042-x86ia64io.h ++++ b/drivers/input/serio/i8042-x86ia64io.h +@@ -223,6 +223,8 @@ static const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = { + DMI_MATCH(DMI_SYS_VENDOR, "PEGATRON CORPORATION"), + DMI_MATCH(DMI_PRODUCT_NAME, "C15B"), + }, ++ }, ++ { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "ByteSpeed LLC"), + DMI_MATCH(DMI_PRODUCT_NAME, "ByteSpeed Laptop C15B"), +-- +2.27.0 + diff --git a/queue-4.9/net-lapb-copy-the-skb-before-sending-a-packet.patch b/queue-4.9/net-lapb-copy-the-skb-before-sending-a-packet.patch new file mode 100644 index 00000000000..caa8ca05c2e --- /dev/null +++ b/queue-4.9/net-lapb-copy-the-skb-before-sending-a-packet.patch @@ -0,0 +1,51 @@ +From cf18067a8b26dccb6cebe0c31577b7ad61979d3d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 31 Jan 2021 21:57:06 -0800 +Subject: net: lapb: Copy the skb before sending a packet + +From: Xie He + +[ Upstream commit 88c7a9fd9bdd3e453f04018920964c6f848a591a ] + +When sending a packet, we will prepend it with an LAPB header. +This modifies the shared parts of a cloned skb, so we should copy the +skb rather than just clone it, before we prepend the header. + +In "Documentation/networking/driver.rst" (the 2nd point), it states +that drivers shouldn't modify the shared parts of a cloned skb when +transmitting. + +The "dev_queue_xmit_nit" function in "net/core/dev.c", which is called +when an skb is being sent, clones the skb and sents the clone to +AF_PACKET sockets. Because the LAPB drivers first remove a 1-byte +pseudo-header before handing over the skb to us, if we don't copy the +skb before prepending the LAPB header, the first byte of the packets +received on AF_PACKET sockets can be corrupted. + +Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") +Signed-off-by: Xie He +Acked-by: Martin Schiller +Link: https://lore.kernel.org/r/20210201055706.415842-1-xie.he.0141@gmail.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + net/lapb/lapb_out.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/net/lapb/lapb_out.c b/net/lapb/lapb_out.c +index 482c94d9d958a..d1c7dcc234486 100644 +--- a/net/lapb/lapb_out.c ++++ b/net/lapb/lapb_out.c +@@ -87,7 +87,8 @@ void lapb_kick(struct lapb_cb *lapb) + skb = skb_dequeue(&lapb->write_queue); + + do { +- if ((skbn = skb_clone(skb, GFP_ATOMIC)) == NULL) { ++ skbn = skb_copy(skb, GFP_ATOMIC); ++ if (!skbn) { + skb_queue_head(&lapb->write_queue, skb); + break; + } +-- +2.27.0 + diff --git a/queue-4.9/series b/queue-4.9/series index bba5d77b824..74f1e08db5e 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -19,3 +19,5 @@ stable-clamp-sublevel-in-4.4-and-4.9.patch usb-serial-cp210x-add-pid-vid-for-wsda-200-usb.patch usb-serial-cp210x-add-new-vid-pid-for-supporting-teraoka-ad2000.patch usb-serial-option-adding-support-for-cinterion-mv31.patch +input-i8042-unbreak-pegatron-c15b.patch +net-lapb-copy-the-skb-before-sending-a-packet.patch -- 2.47.3