linux/arch/mips/net
Daniel Borkmann b4e76f7e6d bpf, mips: fix off-by-one in ctx offset allocation
Dan Carpenter reported [1] a static checker warning that ctx->offsets[]
may be accessed off by one from build_body(), since it's allocated with
fp->len * sizeof(*ctx.offsets) as length. The cBPF arm and ppc code
doesn't have this issue as claimed, so only mips seems to be affected and
should like most other JITs allocate with fp->len + 1. A few number of
JITs (x86, sparc, arm64) handle this differently, where they only require
fp->len array elements.

  [1] http://www.spinics.net/lists/mips/msg64193.html

Fixes: c6610de353 ("MIPS: net: Add BPF JIT")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: ast@kernel.org
Cc: linux-mips@linux-mips.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/13814/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2016-07-21 11:12:34 +02:00
..
bpf_jit_asm.S MIPS: BPF: Fix load delay slots. 2015-10-02 09:48:57 +02:00
bpf_jit.c bpf, mips: fix off-by-one in ctx offset allocation 2016-07-21 11:12:34 +02:00
bpf_jit.h MIPS: BPF: Introduce BPF ASM helpers 2015-06-21 21:54:25 +02:00
Makefile MIPS: BPF: Introduce BPF ASM helpers 2015-06-21 21:54:25 +02:00