diff --git a/.gitignore b/.gitignore index 034d22d..f4d5d9f 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/skge-5.7.tar.xz +SOURCES/skge-4.18.0-211.el8.tar.xz diff --git a/.kmod-skge.metadata b/.kmod-skge.metadata index 3f49197..42410ae 100644 --- a/.kmod-skge.metadata +++ b/.kmod-skge.metadata @@ -1 +1 @@ -6d58ece30d0e89ac11afe6aa1a6dc33a8b682281 SOURCES/skge-5.7.tar.xz +9b0791d9db32d31233f246c749cee5428060ea29 SOURCES/skge-4.18.0-211.el8.tar.xz diff --git a/SOURCES/0001-skge-potential-memory-corruption-in-skge_get_regs.patch b/SOURCES/0001-skge-potential-memory-corruption-in-skge_get_regs.patch new file mode 100644 index 0000000..fea95bd --- /dev/null +++ b/SOURCES/0001-skge-potential-memory-corruption-in-skge_get_regs.patch @@ -0,0 +1,38 @@ +From 294c149a209c6196c2de85f512b52ef50f519949 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Fri, 1 Feb 2019 11:28:16 +0300 +Subject: [Backport 294c149a209c] skge: potential memory corruption in + skge_get_regs() + +The "p" buffer is 0x4000 bytes long. B3_RI_WTO_R1 is 0x190. The value +of "regs->len" is in the 1-0x4000 range. The bug here is that +"regs->len - B3_RI_WTO_R1" can be a negative value which would lead to +memory corruption and an abrupt crash. + +Fixes: c3f8be961808 ("[PATCH] skge: expand ethtool debug register dump") +Signed-off-by: Dan Carpenter +Signed-off-by: David S. Miller +--- + src/skge.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/skge.c b/src/skge.c +index 04fd1f135011f1a068bbc79991af0d05a7c56583..654ac534b10e3e8e04911b618d5fd1cb6fb5c8c8 100644 +--- a/src/skge.c ++++ b/src/skge.c +@@ -152,8 +152,10 @@ static void skge_get_regs(struct net_device *dev, struct ethtool_regs *regs, + memset(p, 0, regs->len); + memcpy_fromio(p, io, B3_RAM_ADDR); + +- memcpy_fromio(p + B3_RI_WTO_R1, io + B3_RI_WTO_R1, +- regs->len - B3_RI_WTO_R1); ++ if (regs->len > B3_RI_WTO_R1) { ++ memcpy_fromio(p + B3_RI_WTO_R1, io + B3_RI_WTO_R1, ++ regs->len - B3_RI_WTO_R1); ++ } + } + + /* Wake on Lan only supported on Yukon chips with rev 1 or above */ +-- +2.31.1 + diff --git a/SOURCES/0002-skge-fix-checksum-byte-order.patch b/SOURCES/0002-skge-fix-checksum-byte-order.patch new file mode 100644 index 0000000..ed85ffc --- /dev/null +++ b/SOURCES/0002-skge-fix-checksum-byte-order.patch @@ -0,0 +1,32 @@ +From 5aafeb74b5bb65b34cc87c7623f9fa163a34fa3b Mon Sep 17 00:00:00 2001 +From: Stephen Hemminger +Date: Fri, 20 Sep 2019 18:18:26 +0200 +Subject: [Backport 5aafeb74b5bb] skge: fix checksum byte order + +Running old skge driver on PowerPC causes checksum errors +because hardware reported 1's complement checksum is in little-endian +byte order. + +Reported-by: Benoit +Signed-off-by: Stephen Hemminger +Signed-off-by: David S. Miller +--- + src/skge.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/skge.c b/src/skge.c +index 0a2ec387a482f66df3ecd61ce3daba829a53a8bc..095f6c71b4fa1dc61476be81f49c1b5c11a5c19b 100644 +--- a/src/skge.c ++++ b/src/skge.c +@@ -3108,7 +3108,7 @@ static struct sk_buff *skge_rx_get(struct net_device *dev, + skb_put(skb, len); + + if (dev->features & NETIF_F_RXCSUM) { +- skb->csum = csum; ++ skb->csum = le16_to_cpu(csum); + skb->ip_summed = CHECKSUM_COMPLETE; + } + +-- +2.31.1 + diff --git a/SPECS/kmod-skge.spec b/SPECS/kmod-skge.spec index d918507..0b2dd92 100644 --- a/SPECS/kmod-skge.spec +++ b/SPECS/kmod-skge.spec @@ -1,6 +1,8 @@ %global pkg skge -%global kernel_version 4.18.0-358.el8 +%global driver_version 4.18.0-211.el8 + +%global kernel_version 4.18.0-348.el8 %global _use_internal_dependency_generator 0 %global __find_requires /usr/lib/rpm/redhat/find-requires @@ -18,14 +20,16 @@ Name: kmod-%{pkg} -Version: 5.7 -Release: 9%{?dist} +Version: 4.18.0.211 +Release: 1%{?dist} Summary: SysKonnect/Marvell Yukon Gigabit Ethernet (%{pkg}) driver License: GPLv2 URL: https://www.kernel.org/ -Source0: %{pkg}-%{version}.tar.xz +Source0: %{pkg}-%{driver_version}.tar.xz +Patch1: 0001-skge-potential-memory-corruption-in-skge_get_regs.patch +Patch2: 0002-skge-fix-checksum-byte-order.patch ExclusiveArch: x86_64 aarch64 @@ -75,7 +79,7 @@ chipset: %prep -%autosetup -p1 -n %{pkg}-%{version} +%autosetup -p1 -n %{pkg}-%{driver_version} %build @@ -137,17 +141,6 @@ fi %changelog -* Tue Jan 11 2022 Kmods SIG - 5.7-9 -- Bump release v5.7 to c5a837a7974e - -* Mon Jan 10 2022 Kmods SIG - 5.7-8 -- Rebuild for 4.18.0-358.el8 - -* Thu Oct 21 2021 Peter Georg - 5.7-7 -- Rebuild for 4.18.0-348.el8 - -* Wed Sep 29 2021 Peter Georg - 5.7-6 -- Rebuild for 4.18.0-338.el8 - -* Tue Sep 28 2021 Peter Georg - 5.7-5 -- Convert to kABI tracking kmod package (kernel >= 4.18.0-315.el8) +* Wed Jan 12 2022 Kmods SIG - 4.18.0.211-1 +- Switch to EL kernel source and versioning +- kABI tracking kmod package (kernel >= 4.18.0-348.el8)