diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2014-09-08 02:04:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-09 19:58:56 -0400 |
commit | 286aad3c4014ca825c447e07e24f8929e6d266d2 (patch) | |
tree | 50f1a085ddd7923b2b3c2764c850d0c02447d32a /arch/s390/net | |
parent | 55309dd3d4cd7420376a3de0526d6ed24ff8fa76 (diff) |
net: bpf: be friendly to kmemcheck
Reported by Mikulas Patocka, kmemcheck currently barks out a
false positive since we don't have special kmemcheck annotation
for bitfields used in bpf_prog structure.
We currently have jited:1, len:31 and thus when accessing len
while CONFIG_KMEMCHECK enabled, kmemcheck throws a warning that
we're reading uninitialized memory.
As we don't need the whole bit universe for pages member, we
can just split it to u16 and use a bool flag for jited instead
of a bitfield.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/s390/net')
-rw-r--r-- | arch/s390/net/bpf_jit_comp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c index b734f975c22e..555f5c7e83ab 100644 --- a/arch/s390/net/bpf_jit_comp.c +++ b/arch/s390/net/bpf_jit_comp.c | |||
@@ -842,7 +842,7 @@ void bpf_jit_compile(struct bpf_prog *fp) | |||
842 | if (jit.start) { | 842 | if (jit.start) { |
843 | set_memory_ro((unsigned long)header, header->pages); | 843 | set_memory_ro((unsigned long)header, header->pages); |
844 | fp->bpf_func = (void *) jit.start; | 844 | fp->bpf_func = (void *) jit.start; |
845 | fp->jited = 1; | 845 | fp->jited = true; |
846 | } | 846 | } |
847 | out: | 847 | out: |
848 | kfree(addrs); | 848 | kfree(addrs); |