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


Groups > linux.kernel > #1238241

[PATCH net] ARM: net: make BPF_LD | BPF_IND instruction trigger r_X initialisation to 0.

Path csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!news.mixmin.net!aioe.org!news.servidellagleba.it!bofh.it!news.nic.it!robomod
From Nicolas Schichan <nschichan@freebox.fr>
Newsgroups linux.kernel
Subject [PATCH net] ARM: net: make BPF_LD | BPF_IND instruction trigger r_X initialisation to 0.
Date Fri, 02 Oct 2015 15:40:05 +0200
Message-ID <qf8J7-4MS-87@gated-at.bofh.it> (permalink)
X-Original-To Russell King <linux@arm.linux.org.uk>, Nicolas Schichan <nschichan@freebox.fr>, "David S. Miller" <davem@davemloft.net>, Mircea Gherzan <mgherzan@gmail.com>, Daniel Borkmann <daniel@iogearbox.net>, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org
X-Mailer git-send-email 1.9.1
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 34
Organization linux.* mail to news gateway
X-Original-Date Fri, 2 Oct 2015 15:39:12 +0200
X-Original-Message-ID <1443793152-8661-1-git-send-email-nschichan@freebox.fr>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1238241

Show key headers only | View raw


Without this patch, if the only instructions using r_X are of the
BPF_LD | BPF_IND type, r_X would not be reset to 0, using whatever
value was there when entering the jited code. With this patch, r_X
will be correctly marked as used so it will be reset to 0 in the
prologue code.

This fix also makes the test "LD_IND byte default X" pass in the
test_bpf module when the ARM JIT is enabled.

Signed-off-by: Nicolas Schichan <nschichan@freebox.fr>
---
 arch/arm/net/bpf_jit_32.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c
index 876060b..b8efb8c 100644
--- a/arch/arm/net/bpf_jit_32.c
+++ b/arch/arm/net/bpf_jit_32.c
@@ -614,6 +614,7 @@ load_common:
 		case BPF_LD | BPF_B | BPF_IND:
 			load_order = 0;
 load_ind:
+			update_on_xread(ctx);
 			OP_IMM3(ARM_ADD, r_off, r_X, k, ctx);
 			goto load_common;
 		case BPF_LDX | BPF_IMM:
-- 
1.9.1

--
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 | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH net] ARM: net: make BPF_LD | BPF_IND instruction trigger r_X initialisation to 0. Nicolas Schichan <nschichan@freebox.fr> - 2015-10-02 15:40 +0200
  Re: [PATCH net] ARM: net: make BPF_LD | BPF_IND instruction  trigger r_X initialisation to 0. David Miller <davem@davemloft.net> - 2015-10-05 15:50 +0200

csiph-web