]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: BPF: Prevent kernel fall over for >=32bit shifts
authorMarkos Chandras <markos.chandras@imgtec.com>
Wed, 25 Jun 2014 08:37:21 +0000 (09:37 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 26 Jun 2014 09:48:22 +0000 (10:48 +0100)
commitdf49bc11fa0b49add18078fb2c0a090152ddc5fb
treedf217b9e4d2a4ec7ded37d7d3aea6c34d547e8e9
parent70009ebec257c0926e685f7889c04416375db42d
MIPS: BPF: Prevent kernel fall over for >=32bit shifts

Remove BUG_ON() if the shift immediate is >=32 to avoid kernel crashes
due to malicious user input. If the shift immediate is >= 32,
we simply load the destination register with 0 since only
32-bit instructions are used by JIT so this will do the
correct thing even on MIPS64.

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/7179/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/net/bpf_jit.c