Messages in this thread | | | Date | Mon, 22 May 2017 09:51:37 -0500 | From | "Gustavo A. R. Silva" <> | Subject | Re: [PATCH] kernel: bpf: remove dead code |
| |
Hi David,
Quoting David Miller <davem@davemloft.net>:
> From: "Gustavo A. R. Silva" <garsilva@embeddedor.com> > Date: Mon, 22 May 2017 09:07:46 -0500 > >> 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. > > Incorrect. > > Some platforms define NET_IP_ALIGN to zero, so the code must remain > as is.
The following piece of code at kernel/bpf/verifier.c:798 is preventing value NET_IP_ALIGN to be stored in variable ip_align when _strict_ is false:
798 if (!strict || size == 1) 799 return 0;
Thanks -- Gustavo A. R. Silva
| |