Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751035AbbEGNAZ (ORCPT ); Thu, 7 May 2015 09:00:25 -0400 Received: from smtp3-g21.free.fr ([212.27.42.3]:51698 "EHLO smtp3-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750924AbbEGNAV (ORCPT ); Thu, 7 May 2015 09:00:21 -0400 From: Nicolas Schichan To: Russell King , "David S. Miller" , Daniel Borkmann , Alexei Starovoitov , Nicolas Schichan , Mircea Gherzan , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v2] ARM: net: add JIT support for loads from struct seccomp_data. Date: Thu, 7 May 2015 15:00:13 +0200 Message-Id: <1431003613-16554-1-git-send-email-nschichan@freebox.fr> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1407 Lines: 43 Signed-off-by: Nicolas Schichan --- This patch was first sent as part of a serie modifying the core seccomp code to allow the use of the classic BPF JIT. As the core changes have been submitted to netdev by Daniel Borkmann, it is now time to re-submit this patch separately. While not physically dependent of the core seccomp changes they are needed for the code added in this patch to be triggered. arch/arm/net/bpf_jit_32.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index f412b53..6bda637 100644 --- a/arch/arm/net/bpf_jit_32.c +++ b/arch/arm/net/bpf_jit_32.c @@ -863,6 +863,16 @@ b_epilogue: off = offsetof(struct sk_buff, queue_mapping); emit(ARM_LDRH_I(r_A, r_skb, off), ctx); break; + case BPF_LDX | BPF_W | BPF_ABS: + /* + * load a 32bit word from struct seccomp_data. + * seccomp_check_filter() will already have checked + * that k is 32bit aligned and lies within the + * struct seccomp_data. + */ + ctx->seen |= SEEN_SKB; + emit(ARM_LDR_I(r_A, r_skb, k), ctx); + break; default: return -1; } -- 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/