Skip to content

Commit 8833bc3

Browse files
Markos Chandrasralfbaechle
authored andcommitted
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. [[email protected]: Fixed conflict due to only applying this fix part of the entire series as part of 4.1 fixes.] Signed-off-by: Markos Chandras <[email protected]> Cc: [email protected] Cc: "David S. Miller" <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: Hannes Frederic Sowa <[email protected]> Cc: [email protected] Cc: [email protected] Patchwork: http://patchwork.linux-mips.org/patch/10527/ Signed-off-by: Ralf Baechle <[email protected]>
1 parent e1fb96e commit 8833bc3

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

arch/mips/net/bpf_jit.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -681,11 +681,7 @@ static unsigned int get_stack_depth(struct jit_ctx *ctx)
681681
sp_off += config_enabled(CONFIG_64BIT) ?
682682
(ARGS_USED_BY_JIT + 1) * RSIZE : RSIZE;
683683

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;
689685
}
690686

691687
static void build_prologue(struct jit_ctx *ctx)

0 commit comments

Comments
 (0)