Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8833bc30 authored by Markos Chandras's avatar Markos Chandras Committed by Ralf Baechle
Browse files

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: default avatarMarkos 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: default avatarRalf Baechle <ralf@linux-mips.org>
parent e1fb96e0
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -681,11 +681,7 @@ static unsigned int get_stack_depth(struct jit_ctx *ctx)
		sp_off += config_enabled(CONFIG_64BIT) ?
			(ARGS_USED_BY_JIT + 1) * RSIZE : RSIZE;

	/*
	 * Subtract the bytes for the last registers since we only care about
	 * the location on the stack pointer.
	 */
	return sp_off - RSIZE;
	return sp_off;
}

static void build_prologue(struct jit_ctx *ctx)