Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1646953

[PATCH] kernel: bpf: remove dead code

From "Gustavo A. R. Silva" <garsilva@embeddedor.com>
Newsgroups linux.kernel
Subject [PATCH] kernel: bpf: remove dead code
Date 2017-05-22 16:10 +0200
Message-ID <tJWc4-6Hl-67@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View 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

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] kernel: bpf: remove dead code "Gustavo A. R. Silva" <garsilva@embeddedor.com> - 2017-05-22 16:10 +0200
  Re: [PATCH] kernel: bpf: remove dead code David Miller <davem@davemloft.net> - 2017-05-22 16:40 +0200
    Re: [PATCH] kernel: bpf: remove dead code Daniel Borkmann <daniel@iogearbox.net> - 2017-05-22 17:00 +0200
      Re: [PATCH] kernel: bpf: remove dead code David Miller <davem@davemloft.net> - 2017-05-22 18:30 +0200
        Re: [PATCH] kernel: bpf: remove dead code Daniel Borkmann <daniel@iogearbox.net> - 2017-05-22 19:10 +0200
    Re: [PATCH] kernel: bpf: remove dead code "Gustavo A. R. Silva" <garsilva@embeddedor.com> - 2017-05-22 17:00 +0200

csiph-web