MIPS: BPF: Fix stack pointer allocation

Fix stack pointer offset which could potentially corrupt
argument registers in the previous frame. The calculated offset
reflects the size of all the registers we need to preserve so there
is no need for this erroneous subtraction.

[ralf@linux-mips.org: Fixed conflict due to only applying this fix part
of the entire series as part of 4.1 fixes.]

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Cc: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: Daniel Borkmann <dborkman@redhat.com>
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>
Cc: linux-kernel@vger.kernel.org
Cc: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/10527/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by Markos Chandras and committed by Ralf Baechle 8833bc30 e1fb96e0

Changed files
+1 -5
arch
mips
net
+1 -5
arch/mips/net/bpf_jit.c
··· 681 681 sp_off += config_enabled(CONFIG_64BIT) ? 682 682 (ARGS_USED_BY_JIT + 1) * RSIZE : RSIZE; 683 683 684 - /* 685 - * Subtract the bytes for the last registers since we only care about 686 - * the location on the stack pointer. 687 - */ 688 - return sp_off - RSIZE; 684 + return sp_off; 689 685 } 690 686 691 687 static void build_prologue(struct jit_ctx *ctx)