From: Vladimir Oltean <olteanv@gmail.com>
To: Artem Chernyshev <artem.chernyshev@red-soft.ru>
Cc: Woojung Huh <woojung.huh@microchip.com>,
Andrew Lunn <andrew@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>,
"David S . Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
lvc-project@linuxtesting.org,
Arun Ramadoss <arun.ramadoss@microchip.com>
Subject: Re: [PATCH] net: dsa: ksz: Check proper trim in ksz_common_rcv()
Date: Tue, 29 Nov 2022 18:55:31 +0200 [thread overview]
Message-ID: <20221129165531.wgeyxgo5el2x43mj@skbuf> (raw)
In-Reply-To: <20221129140809.2755960-1-artem.chernyshev@red-soft.ru>
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@red-soft.ru>
> ---
Reviewed-by: Vladimir Oltean <olteanv@gmail.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
>
next prev parent reply other threads:[~2022-11-29 17:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-29 14:08 [PATCH] net: dsa: ksz: Check proper trim in ksz_common_rcv() Artem Chernyshev
2022-11-29 16:55 ` Vladimir Oltean [this message]
2022-11-29 19:43 ` [PATCH v2] net: dsa: Check return value from skb_trim_rcsum() Artem Chernyshev
2022-11-30 22:46 ` Vladimir Oltean
2022-11-30 22:53 ` Vladimir Oltean
2022-12-01 5:46 ` Artem Chernyshev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221129165531.wgeyxgo5el2x43mj@skbuf \
--to=olteanv@gmail.com \
--cc=andrew@lunn.ch \
--cc=artem.chernyshev@red-soft.ru \
--cc=arun.ramadoss@microchip.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=netdev@vger.kernel.org \
--cc=woojung.huh@microchip.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox