Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1158459

[PATCH 3/6] MIPS: net: BPF: Fix stack pointer allocation

From Markos Chandras <markos.chandras@imgtec.com>
Newsgroups linux.kernel
Subject [PATCH 3/6] MIPS: net: BPF: Fix stack pointer allocation
Date 2015-06-04 13:00 +0200
Message-ID <pxB2q-6YZ-19@gated-at.bofh.it> (permalink)
References <pxB2p-6YZ-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

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
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
---
 arch/mips/net/bpf_jit.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/arch/mips/net/bpf_jit.c b/arch/mips/net/bpf_jit.c
index 56e0e8e9674d..84cd09ba230a 100644
--- a/arch/mips/net/bpf_jit.c
+++ b/arch/mips/net/bpf_jit.c
@@ -676,11 +676,7 @@ static unsigned int get_stack_depth(struct jit_ctx *ctx)
 		sp_off += config_enabled(CONFIG_64BIT) ?
 			(ARGS_USED_BY_JIT + 1) * SZREG : SZREG;
 
-	/*
-	 * Subtract the bytes for the last registers since we only care about
-	 * the location on the stack pointer.
-	 */
-	return sp_off - SZREG;
+	return sp_off;
 }
 
 static void build_prologue(struct jit_ctx *ctx)
-- 
2.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/6] MIPS/BPF fixes for 4.3 Markos Chandras <markos.chandras@imgtec.com> - 2015-06-04 13:00 +0200
  [PATCH 3/6] MIPS: net: BPF: Fix stack pointer allocation Markos Chandras <markos.chandras@imgtec.com> - 2015-06-04 13:00 +0200
  [PATCH 4/6] MIPS: net: BPF: Move register definition to the BPF header Markos Chandras <markos.chandras@imgtec.com> - 2015-06-04 13:00 +0200
  [PATCH 6/6] MIPS: net: BPF: Introduce BPF ASM helpers Markos Chandras <markos.chandras@imgtec.com> - 2015-06-04 13:00 +0200

csiph-web