From: <gregkh@linuxfoundation.org>
To: daniel@iogearbox.net, ast@kernel.org, gregkh@linuxfoundation.org,
naveen.n.rao@linux.vnet.ibm.com
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "bpf, ppc64: fix out of bounds access in tail call" has been added to the 4.9-stable tree
Date: Fri, 09 Mar 2018 14:21:43 -0800 [thread overview]
Message-ID: <1520634103235242@kroah.com> (raw)
In-Reply-To: <08bc9e5902de0e9e9b26194ba4ea219f053b7206.1520521792.git.daniel@iogearbox.net>
This is a note to let you know that I've just added the patch titled
bpf, ppc64: fix out of bounds access in tail call
to the 4.9-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:
bpf-ppc64-fix-out-of-bounds-access-in-tail-call.patch
and it can be found in the queue-4.9 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 foo@baz Fri Mar 9 14:20:51 PST 2018
From: Daniel Borkmann <daniel@iogearbox.net>
Date: Thu, 8 Mar 2018 16:17:37 +0100
Subject: bpf, ppc64: fix out of bounds access in tail call
To: gregkh@linuxfoundation.org
Cc: ast@kernel.org, daniel@iogearbox.net, stable@vger.kernel.org
Message-ID: <08bc9e5902de0e9e9b26194ba4ea219f053b7206.1520521792.git.daniel@iogearbox.net>
From: Daniel Borkmann <daniel@iogearbox.net>
[ upstream commit d269176e766c71c998cb75b4ea8cbc321cc0019d ]
While working on 16338a9b3ac3 ("bpf, arm64: fix out of bounds access in
tail call") I noticed that ppc64 JIT is partially affected as well. While
the bound checking is correctly performed as unsigned comparison, the
register with the index value however, is never truncated into 32 bit
space, so e.g. a index value of 0x100000000ULL with a map of 1 element
would pass with PPC_CMPLW() whereas we later on continue with the full
64 bit register value. Therefore, as we do in interpreter and other JITs
truncate the value to 32 bit initially in order to fix access.
Fixes: ce0761419fae ("powerpc/bpf: Implement support for tail calls")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/powerpc/net/bpf_jit_comp64.c | 1 +
1 file changed, 1 insertion(+)
--- a/arch/powerpc/net/bpf_jit_comp64.c
+++ b/arch/powerpc/net/bpf_jit_comp64.c
@@ -245,6 +245,7 @@ static void bpf_jit_emit_tail_call(u32 *
* goto out;
*/
PPC_LWZ(b2p[TMP_REG_1], b2p_bpf_array, offsetof(struct bpf_array, map.max_entries));
+ PPC_RLWINM(b2p_index, b2p_index, 0, 0, 31);
PPC_CMPLW(b2p_index, b2p[TMP_REG_1]);
PPC_BCC(COND_GE, out);
Patches currently in stable-queue which might be from daniel@iogearbox.net are
queue-4.9/bpf-fix-mlock-precharge-on-arraymaps.patch
queue-4.9/bpf-x64-implement-retpoline-for-tail-call.patch
queue-4.9/bpf-arm64-fix-out-of-bounds-access-in-tail-call.patch
queue-4.9/bpf-fix-wrong-exposure-of-map_flags-into-fdinfo-for-lpm.patch
queue-4.9/bpf-ppc64-fix-out-of-bounds-access-in-tail-call.patch
queue-4.9/bpf-add-schedule-points-in-percpu-arrays-management.patch
next prev parent reply other threads:[~2018-03-09 22:21 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-08 15:17 [PATCH stable 4.9 0/6] BPF stable patches Daniel Borkmann
2018-03-08 15:17 ` [PATCH stable 4.9 1/6] bpf: fix wrong exposure of map_flags into fdinfo for lpm Daniel Borkmann
2018-03-09 22:21 ` Patch "bpf: fix wrong exposure of map_flags into fdinfo for lpm" has been added to the 4.9-stable tree gregkh
2018-03-08 15:17 ` [PATCH stable 4.9 2/6] bpf: fix mlock precharge on arraymaps Daniel Borkmann
2018-03-09 22:21 ` Patch "bpf: fix mlock precharge on arraymaps" has been added to the 4.9-stable tree gregkh
2018-03-08 15:17 ` [PATCH stable 4.9 3/6] bpf, x64: implement retpoline for tail call Daniel Borkmann
2018-03-09 22:21 ` Patch "bpf, x64: implement retpoline for tail call" has been added to the 4.9-stable tree gregkh
2018-03-10 0:05 ` Patch "bpf, x64: implement retpoline for tail call" has been added to the 4.4-stable tree gregkh
2018-03-08 15:17 ` [PATCH stable 4.9 4/6] bpf, arm64: fix out of bounds access in tail call Daniel Borkmann
2018-03-09 22:21 ` Patch "bpf, arm64: fix out of bounds access in tail call" has been added to the 4.9-stable tree gregkh
2018-03-08 15:17 ` [PATCH stable 4.9 5/6] bpf: add schedule points in percpu arrays management Daniel Borkmann
2018-03-09 22:21 ` Patch "bpf: add schedule points in percpu arrays management" has been added to the 4.9-stable tree gregkh
2018-03-08 15:17 ` [PATCH stable 4.9 6/6] bpf, ppc64: fix out of bounds access in tail call Daniel Borkmann
2018-03-09 22:21 ` gregkh [this message]
2018-03-09 22:22 ` [PATCH stable 4.9 0/6] BPF stable patches Greg KH
2018-03-09 22:36 ` Daniel Borkmann
2018-03-10 0:03 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1520634103235242@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=ast@kernel.org \
--cc=daniel@iogearbox.net \
--cc=naveen.n.rao@linux.vnet.ibm.com \
--cc=stable-commits@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.