[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221129165531.wgeyxgo5el2x43mj@skbuf>
Date: Tue, 29 Nov 2022 18:55:31 +0200
From: Vladimir Oltean <olteanv@...il.com>
To: Artem Chernyshev <artem.chernyshev@...-soft.ru>
Cc: Woojung Huh <woojung.huh@...rochip.com>,
Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
"David S . Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, lvc-project@...uxtesting.org,
Arun Ramadoss <arun.ramadoss@...rochip.com>
Subject: Re: [PATCH] net: dsa: ksz: Check proper trim in ksz_common_rcv()
Hi Artyom,
On Tue, Nov 29, 2022 at 05:08:09PM +0300, Artem Chernyshev wrote:
> Return NULL if we got unexpected value from skb_trim_rcsum()
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Fixes: bafe9ba7d908 ("net: dsa: ksz: Factor out common tag code")
> Signed-off-by: Artem Chernyshev <artem.chernyshev@...-soft.ru>
> ---
Reviewed-by: Vladimir Oltean <olteanv@...il.com>
It looks like the same pattern exists in tag_hellcreek.c and in
tag_sja1105.c. Do you intend to patch those as well?
> net/dsa/tag_ksz.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/net/dsa/tag_ksz.c b/net/dsa/tag_ksz.c
> index 38fa19c1e2d5..429250298ac4 100644
> --- a/net/dsa/tag_ksz.c
> +++ b/net/dsa/tag_ksz.c
> @@ -21,7 +21,8 @@ static struct sk_buff *ksz_common_rcv(struct sk_buff *skb,
> if (!skb->dev)
> return NULL;
>
> - pskb_trim_rcsum(skb, skb->len - len);
> + if (pskb_trim_rcsum(skb, skb->len - len))
> + return NULL;
>
> dsa_default_offload_fwd_mark(skb);
>
> --
> 2.30.3
>
Powered by blists - more mailing lists