]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: bpf: Return error code if the offset is a negative number
authorMarkos Chandras <markos.chandras@imgtec.com>
Mon, 23 Jun 2014 09:38:48 +0000 (10:38 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 26 Jun 2014 09:48:20 +0000 (10:48 +0100)
commit173fb47145d019d9b0b65e8d92f43c11056ea763
tree92efeccf3e43e6caf9f11a87576d9fb21b7f5d1b
parenta752fb706c7268fd890e24d9b0467831e45c501a
MIPS: bpf: Return error code if the offset is a negative number

Previously, the negative offset was not checked leading to failures
due to trying to load data beyond the skb struct boundaries. Until we
have proper asm helpers in place, it's best if we return ENOSUPP if K
is negative when trying to JIT the filter or 0 during runtime if we
do an indirect load where the value of X is unknown during build time.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Daniel Borkmann <dborkman@redhat.com>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: netdev@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7123/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/net/bpf_jit.c