diff options
author | Markos Chandras <markos.chandras@imgtec.com> | 2015-06-04 06:56:13 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2015-06-06 04:21:10 -0400 |
commit | 8833bc308ba5d31e0a872346c0f63e9bb02dc611 (patch) | |
tree | 1afc23ceae920df191b2828c06a6ebab6341aa95 /arch | |
parent | e1fb96e064e7157920f043f40ae801a5c18e57da (diff) |
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/net/bpf_jit.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/arch/mips/net/bpf_jit.c b/arch/mips/net/bpf_jit.c index 5d6139390bf8..e23fdf2a9c80 100644 --- a/arch/mips/net/bpf_jit.c +++ b/arch/mips/net/bpf_jit.c | |||
@@ -681,11 +681,7 @@ static unsigned int get_stack_depth(struct jit_ctx *ctx) | |||
681 | sp_off += config_enabled(CONFIG_64BIT) ? | 681 | sp_off += config_enabled(CONFIG_64BIT) ? |
682 | (ARGS_USED_BY_JIT + 1) * RSIZE : RSIZE; | 682 | (ARGS_USED_BY_JIT + 1) * RSIZE : RSIZE; |
683 | 683 | ||
684 | /* | 684 | return sp_off; |
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; | ||
689 | } | 685 | } |
690 | 686 | ||
691 | static void build_prologue(struct jit_ctx *ctx) | 687 | static void build_prologue(struct jit_ctx *ctx) |