]> git.kernelconcepts.de Git - karo-tx-linux.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)
commit95782bf434437b3292f5cb9ce21b53bdbc1beda1
treedf217b9e4d2a4ec7ded37d7d3aea6c34d547e8e9
parente5bb48b0553d75918094c5a6f7b60a4359887218
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