[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <58f65a46-1f3f-4d1a-965d-6c0457e93d58@blackwall.org>
Date: Thu, 26 Jun 2025 17:13:16 +0300
From: Nikolay Aleksandrov <razor@...ckwall.org>
To: Stephen Hemminger <stephen@...workplumber.org>, netdev@...r.kernel.org
Cc: z30015464 <zhongxuan2@...wei.com>, nikolay@...ulusnetworks.com
Subject: Re: [PATCH iproute2] bond: fix stack smash in xstats
On 6/26/25 17:01, Stephen Hemminger wrote:
> 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 <zhongxuan2@...wei.com>
> Fixes: 440c5075d662 ("ip: bond: add xstats support")
> Cc: nikolay@...ulusnetworks.com
> Signed-off-by: Stephen Hemminger <stephen@...workplumber.org>
> ---
> 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 19af67d0..62dd907c 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;
Oops :)
Acked-by: Nikolay Aleksandrov <razor@...ckwall.org>
Powered by blists - more mailing lists