From: Denis Kirjanov <dkirjanov@suse.de>
To: Anastasia Belova <abelova@astralinux.ru>,
"David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Jiri Pirko <jiri@resnulli.us>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
lvc-project@linuxtesting.org
Subject: Re: [PATCH v2] flow_dissector: prevent NULL pointer dereference in __skb_flow_dissect
Date: Thu, 21 Mar 2024 15:52:10 +0300 [thread overview]
Message-ID: <a8174c07-00c9-4a8e-9c2e-c2d759379f09@suse.de> (raw)
In-Reply-To: <20240321123446.7012-1-abelova@astralinux.ru>
On 3/21/24 15:34, Anastasia Belova wrote:
> skb is an optional parameter, so it may be NULL.
> Add check defore dereference in eth_hdr.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Fixes: 690e36e726d0 ("net: Allow raw buffers to be passed into the flow dissector.")
> Signed-off-by: Anastasia Belova <abelova@astralinux.ru>
As request in the previous email please show the actual data flow that leads to a null pointer
dereference.
Also please read function description:
...
* @skb: sk_buff to extract the flow from, can be NULL if the rest are specified
...
> ---
> net/core/flow_dissector.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
> index 272f09251343..68a8228ffae3 100644
> --- a/net/core/flow_dissector.c
> +++ b/net/core/flow_dissector.c
> @@ -1139,6 +1139,8 @@ bool __skb_flow_dissect(const struct net *net,
>
> if (dissector_uses_key(flow_dissector,
> FLOW_DISSECTOR_KEY_ETH_ADDRS)) {
> + if (!skb)
> + goto out_bad;
> struct ethhdr *eth = eth_hdr(skb);
> struct flow_dissector_key_eth_addrs *key_eth_addrs;
>
next prev parent reply other threads:[~2024-03-21 12:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-20 12:56 [PATCH] " Anastasia Belova
2024-03-20 13:38 ` Jiri Pirko
2024-03-20 13:43 ` Eric Dumazet
2024-03-20 13:54 ` Jiri Pirko
2024-03-21 9:36 ` Anastasia Belova
2024-03-21 10:57 ` Jiri Pirko
2024-03-21 11:39 ` Denis Kirjanov
2024-03-21 12:04 ` Anastasia Belova
2024-03-21 12:42 ` Jiri Pirko
2024-03-21 12:34 ` [PATCH v2] " Anastasia Belova
2024-03-21 12:52 ` Denis Kirjanov [this message]
2024-03-21 13:09 ` Jiri Pirko
2024-03-21 17:16 ` Eric Dumazet
2024-03-22 11:41 ` Simon Horman
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=a8174c07-00c9-4a8e-9c2e-c2d759379f09@suse.de \
--to=dkirjanov@suse.de \
--cc=abelova@astralinux.ru \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=netdev@vger.kernel.org \
/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
all inboxes | Powered by JetHome®