From: Jakub Kicinski <kuba@kernel.org>
To: davem@davemloft.net
Cc: pabeni@redhat.com, netdev@vger.kernel.org, gustavoars@kernel.org,
kurt@linutronix.de, keescook@chromium.org,
Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net] flow_dissector: fix false-positive __read_overflow2_field() warning
Date: Wed, 6 Apr 2022 14:15:21 -0700 [thread overview]
Message-ID: <20220406211521.723357-1-kuba@kernel.org> (raw)
Bounds checking is unhappy that we try to copy both Ethernet
addresses but pass pointer to the first one. Luckily destination
address is the first field so pass the pointer to the entire header,
whatever.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
I feel like we talked about this one.
I wonder if my position now is consistent with what I said
in the past :)
net/core/flow_dissector.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 03b6e649c428..912bda212db2 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -1032,7 +1032,7 @@ bool __skb_flow_dissect(const struct net *net,
key_eth_addrs = skb_flow_dissector_target(flow_dissector,
FLOW_DISSECTOR_KEY_ETH_ADDRS,
target_container);
- memcpy(key_eth_addrs, ð->h_dest, sizeof(*key_eth_addrs));
+ memcpy(key_eth_addrs, eth, sizeof(*key_eth_addrs));
}
proto_again:
--
2.34.1
next reply other threads:[~2022-04-06 21:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-06 21:15 Jakub Kicinski [this message]
2022-04-06 21:36 ` [PATCH net] flow_dissector: fix false-positive __read_overflow2_field() warning Kees Cook
2022-04-08 11:20 ` patchwork-bot+netdevbpf
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=20220406211521.723357-1-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=gustavoars@kernel.org \
--cc=keescook@chromium.org \
--cc=kurt@linutronix.de \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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