Skip to contentSkip to conversation

arm-bsp/fvp-base: Get 6.10 kernel working

PATCH New Jon Mason 1 participant 2 messages Oct 21, 2024

lore
Share & tools
lore

Jon Mason

author
#0 lore raw

PATCH 1/2 arm-bsp/fvp-base: Get 6.10 kernel working

Apply upstream patch to get virtio networking functioning again and switch to the 6.10 kernel.

---
 ...gso-csum-offset-check-in-virtio_net_.patch | 59 +++++++++++++++++++
 .../linux/linux-arm-platforms.inc             |  1 +
 2 files changed, 60 insertions(+)
 create mode 100644 meta-arm-bsp/recipes-kernel/linux/files/fvp-base/0001-net-tighten-bad-gso-csum-offset-check-in-virtio_net_.patch
meta-arm-bsp/recipes-kernel/linux/files/fvp-base/0001-net-tighten-bad-gso-csum-offset-check-in-virtio_net_.patch new file +59 -0
new file mode 100644
index 000000000000..9985d57966f4
@@ -0,0 +1,59 @@
+From 6513eb3d3191574b58859ef2d6dc26c0277c6f81 Mon Sep 17 00:00:00 2001
+From: Willem de Bruijn <[email protected]>
+Date: Tue, 10 Sep 2024 17:35:35 -0400
+Subject: [PATCH] net: tighten bad gso csum offset check in virtio_net_hdr
+
+The referenced commit drops bad input, but has false positives.
+Tighten the check to avoid these.
+
+The check detects illegal checksum offload requests, which produce
+csum_start/csum_off beyond end of packet after segmentation.
+
+But it is based on two incorrect assumptions:
+
+1. virtio_net_hdr_to_skb with VIRTIO_NET_HDR_GSO_TCP[46] implies GSO.
+True in callers that inject into the tx path, such as tap.
+But false in callers that inject into rx, like virtio-net.
+Here, the flags indicate GRO, and CHECKSUM_UNNECESSARY or
+CHECKSUM_NONE without VIRTIO_NET_HDR_F_NEEDS_CSUM is normal.
+
+2. TSO requires checksum offload, i.e., ip_summed == CHECKSUM_PARTIAL.
+False, as tcp[46]_gso_segment will fix up csum_start and offset for
+all other ip_summed by calling __tcp_v4_send_check.
+
+Because of 2, we can limit the scope of the fix to virtio_net_hdr
+that do try to set these fields, with a bogus value.
+
+Link: https://lore.kernel.org/netdev/[email protected]/
+Fixes: 89add40066f9 ("net: drop bad gso csum_start and offset in virtio_net_hdr")
+Signed-off-by: Willem de Bruijn <[email protected]>
+Acked-by: Jason Wang <[email protected]>
+Acked-by: Michael S. Tsirkin <[email protected]>
+Cc: [email protected]
+Link: https://patch.msgid.link/[email protected]
+Signed-off-by: Jakub Kicinski <[email protected]>
+
+Upstream-Status: Backport
+Signed-off-by: Jon Mason <[email protected]>
+
+---
+ include/linux/virtio_net.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
+index 6c395a2600e8..276ca543ef44 100644
+--- a/include/linux/virtio_net.h
++++ b/include/linux/virtio_net.h
+@@ -173,7 +173,8 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb,
+ 			break;
+ 		case SKB_GSO_TCPV4:
+ 		case SKB_GSO_TCPV6:
+-			if (skb->csum_offset != offsetof(struct tcphdr, check))
++			if (skb->ip_summed == CHECKSUM_PARTIAL &&
++			    skb->csum_offset != offsetof(struct tcphdr, check))
+ 				return -EINVAL;
+ 			break;
+ 		}
+-- 
+2.39.2
+
meta-arm-bsp/recipes-kernel/linux/linux-arm-platforms.inc +1 -0
index db565e780101..e2b261f515ff 100644
@@ -66,6 +66,7 @@ KMACHINE:fvp-base = "fvp"
 FILESEXTRAPATHS:prepend:fvp-base := "${ARMBSPFILESPATHS}:${ARMFILESPATHS}"
 SRC_URI:append:fvp-base = " \
     file://0001-arm64-dts-fvp-Enable-virtio-rng-support.patch \
+    file://0001-net-tighten-bad-gso-csum-offset-check-in-virtio_net_.patch \
     file://tee.cfg \
     ${@bb.utils.contains('MACHINE_FEATURES', 'ts-smm-gateway', \
                          'file://no-strict-devmem.cfg', '' , d)} \
Signature · 1 line
2.39.5 (Apple Git-154)
author
#1 lore raw

PATCH 2/2 arm/linux-yocto: disable CONFIG_MTD_NAND_FSL_IFC

Linux stable kernel v6.6.44 added commit c22649e217457d732a51112aaa8721a0e79e2c30, which modifies the depends for the Freescale IFC NAND controller. See
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.6.y&id=c22649e217457d732a51112aaa8721a0e79e2c30

Because of this change, do_kernel_configcheck is logging an warning about values not matching. To address this issue, disable it manually in a config fragment, but only for the affected machines in meta-arm.

---
 meta-arm-bsp/recipes-kernel/linux/files/no-fsl-ifc-nand.cfg | 1 +
 meta-arm-bsp/recipes-kernel/linux/linux-arm-platforms.inc   | 4 ++++
 2 files changed, 5 insertions(+)
 create mode 100644 meta-arm-bsp/recipes-kernel/linux/files/no-fsl-ifc-nand.cfg
meta-arm-bsp/recipes-kernel/linux/files/no-fsl-ifc-nand.cfg new file +1 -0
new file mode 100644
index 000000000000..85f956a12e71
@@ -0,0 +1 @@
+CONFIG_MTD_NAND_FSL_IFC=n
meta-arm-bsp/recipes-kernel/linux/linux-arm-platforms.inc +4 -0
index e2b261f515ff..82966db761bd 100644
@@ -78,6 +78,9 @@ SRC_URI:append:fvp-base = " \
 #
 COMPATIBLE_MACHINE:juno = "juno"
 FILESEXTRAPATHS:prepend:juno := "${ARMBSPFILESPATHS}"
+SRC_URI:append:juno = " \
+    file://no-fsl-ifc-nand.cfg \
+    "
 
 #
 # Musca B1/S2 can't run Linux
@@ -104,6 +107,7 @@ SRC_URI:append:n1sdp = " \
     file://enable-realtek-R8169.cfg \
     file://enable-usb_conn_gpio.cfg \
     file://usb_xhci_pci_renesas.cfg \
+    file://no-fsl-ifc-nand.cfg \
     "
 # Since we use the intree defconfig and the preempt-rt turns off some configs
 # do_kernel_configcheck will display warnings. So, lets disable it.
Signature · 1 line
2.39.5 (Apple Git-154)