From: "Gustavo A. R. Silva" <garsilva@embeddedor.com>
To: Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
"Gustavo A. R. Silva" <garsilva@embeddedor.com>
Subject: [PATCH] kernel: bpf: remove dead code
Date: Mon, 22 May 2017 09:07:46 -0500 [thread overview]
Message-ID: <20170522140746.GA10113@embeddedgus> (raw)
Execution cannot reach NET_IP_ALIGN inside the following statement:
ip_align = strict ? 2 : NET_IP_ALIGN
Addresses-Coverity-ID: 1409762
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
NOTE: variable ip_align could also be removed and use value 2 directly.
kernel/bpf/verifier.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 1eddb71..94f6e46 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -812,7 +812,7 @@ static int check_pkt_ptr_alignment(const struct bpf_reg_state *reg,
* we force this to 2 which is universally what architectures use
* when they don't set CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS.
*/
- ip_align = strict ? 2 : NET_IP_ALIGN;
+ ip_align = 2;
if ((ip_align + reg_off + off) % size != 0) {
verbose("misaligned packet access off %d+%d+%d size %d\n",
ip_align, reg_off, off, size);
--
2.5.0
next reply other threads:[~2017-05-22 14:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-22 14:07 Gustavo A. R. Silva [this message]
2017-05-22 14:38 ` [PATCH] kernel: bpf: remove dead code David Miller
2017-05-22 14:51 ` Gustavo A. R. Silva
2017-05-22 14:51 ` Gustavo A. R. Silva
2017-05-22 14:52 ` Daniel Borkmann
2017-05-22 16:27 ` David Miller
2017-05-22 17:00 ` Daniel Borkmann
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=20170522140746.GA10113@embeddedgus \
--to=garsilva@embeddedor.com \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.