diff --git a/backport-iproute2-bond-fix-stack-smash-in-xstats.patch b/backport-iproute2-bond-fix-stack-smash-in-xstats.patch new file mode 100644 index 0000000000000000000000000000000000000000..85fec8cb6ee5d3866eefb195e597d7fccd757d6e --- /dev/null +++ b/backport-iproute2-bond-fix-stack-smash-in-xstats.patch @@ -0,0 +1,50 @@ +From ede5e0b67c13d6d8fb51891d7d4be330733862cd Mon Sep 17 00:00:00 2001 +From: Stephen Hemminger +Date: Thu, 26 Jun 2025 06:50:17 -0700 +Subject: [PATCH] bond: fix stack smash in xstats + +Building with stack smashing detection finds an off by one +in the bond xstats attribute parsing. + +$ ip link xstats type bond dev bond0 +[Thread debugging using libthread_db enabled] +Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". +bond0 + LACPDU Rx 0 + LACPDU Tx 0 + LACPDU Unknown type Rx 0 + LACPDU Illegal Rx 0 + Marker Rx 0 + Marker Tx 0 + Marker response Rx 0 + Marker response Tx 0 + Marker unknown type Rx 0 +*** stack smashing detected ***: terminated + +Program received signal SIGABRT, Aborted. + +Reported-by: z30015464 +Fixes: 440c5075d662 ("ip: bond: add xstats support") +Signed-off-by: Stephen Hemminger +Acked-by: Nikolay Aleksandrov + +Reference:https://github.com/iproute2/iproute2/commit/ede5e0b67c13d6d8fb51891d7d4be330733862cd.patch +Conflict:NA + +--- + ip/iplink_bond.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ip/iplink_bond.c b/ip/iplink_bond.c +index 19af67d00..62dd907c7 100644 +--- a/ip/iplink_bond.c ++++ b/ip/iplink_bond.c +@@ -852,7 +852,7 @@ static void bond_print_stats_attr(struct rtattr *attr, int ifindex) + const char *ifname = ""; + int rem; + +- parse_rtattr(bondtb, LINK_XSTATS_TYPE_MAX+1, RTA_DATA(attr), ++ parse_rtattr(bondtb, LINK_XSTATS_TYPE_MAX, RTA_DATA(attr), + RTA_PAYLOAD(attr)); + if (!bondtb[LINK_XSTATS_TYPE_BOND]) + return; diff --git a/iproute.spec b/iproute.spec index a778c5961737f4c08b046693cc9a83f3c8d0212b..c123e47da97ae2d5ccf8a1523d236b20324aea85 100644 --- a/iproute.spec +++ b/iproute.spec @@ -2,7 +2,7 @@ Name: iproute Version: 6.6.0 Epoch: 1 -Release: 7 +Release: 8 Summary: Linux network configuration utilities License: GPLv2+ and Public Domain URL: https://kernel.org/pub/linux/utils/net/iproute2/ @@ -25,6 +25,7 @@ Patch6007: backport-fix-fd-leak-when-playing-with-netns.patch Patch9000: feature-iproute-add-support-for-ipvlan-l2e-mode.patch Patch9001: bugfix-iproute2-cancel-some-test-cases.patch Patch9002: revert-ip-vrf-make-ipvrf_exec-SELinux-aware.patch +Patch9003: backport-iproute2-bond-fix-stack-smash-in-xstats.patch BuildRequires: gcc bison elfutils-libelf-devel flex iptables-devel BuildRequires: libmnl-devel libselinux-devel pkgconfig libbpf-devel sudo make @@ -99,6 +100,12 @@ install -m 0644 lib/libnetlink.a %{buildroot}%{_libdir}/libnetlink.a %{_mandir}/* %changelog +* Wed Sep 10 2025 tangce - 1:6.6.0-8 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix stack smash in xstats + * Tue Sep 09 2025 tangce - 1:6.6.0-7 - Type:bugfix - ID:NA