stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "arm64: bpf: fix signedness bug in loading 64-bit immediate" has been added to the 4.0-stable tree
@ 2015-06-03  2:42 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-06-03  2:42 UTC (permalink / raw)
  To: xi.wang, ast, catalin.marinas, gregkh, will.deacon, zlim.lnx
  Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    arm64: bpf: fix signedness bug in loading 64-bit immediate

to the 4.0-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     arm64-bpf-fix-signedness-bug-in-loading-64-bit-immediate.patch
and it can be found in the queue-4.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 1e4df6b7208140f3c49f316d33a409d3a161f350 Mon Sep 17 00:00:00 2001
From: Xi Wang <xi.wang@gmail.com>
Date: Fri, 8 May 2015 06:39:51 +0100
Subject: arm64: bpf: fix signedness bug in loading 64-bit immediate

From: Xi Wang <xi.wang@gmail.com>

commit 1e4df6b7208140f3c49f316d33a409d3a161f350 upstream.

Consider "(u64)insn1.imm << 32 | imm" in the arm64 JIT.  Since imm is
signed 32-bit, it is sign-extended to 64-bit, losing the high 32 bits.
The fix is to convert imm to u32 first, which will be zero-extended to
u64 implicitly.

Cc: Zi Shen Lim <zlim.lnx@gmail.com>
Cc: Alexei Starovoitov <ast@plumgrid.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Fixes: 30d3d94cc3d5 ("arm64: bpf: add 'load 64-bit immediate' instruction")
Signed-off-by: Xi Wang <xi.wang@gmail.com>
[will: removed non-arm64 bits and redundant casting]
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/arm64/net/bpf_jit_comp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/arm64/net/bpf_jit_comp.c
+++ b/arch/arm64/net/bpf_jit_comp.c
@@ -487,7 +487,7 @@ emit_cond_jmp:
 			return -EINVAL;
 		}
 
-		imm64 = (u64)insn1.imm << 32 | imm;
+		imm64 = (u64)insn1.imm << 32 | (u32)imm;
 		emit_a64_mov_i64(dst, imm64, ctx);
 
 		return 1;


Patches currently in stable-queue which might be from xi.wang@gmail.com are

queue-4.0/arm64-bpf-fix-signedness-bug-in-loading-64-bit-immediate.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-06-03  2:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-03  2:42 Patch "arm64: bpf: fix signedness bug in loading 64-bit immediate" has been added to the 4.0-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).