Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756040Ab3D0G1y (ORCPT ); Sat, 27 Apr 2013 02:27:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37299 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754092Ab3D0G1x (ORCPT ); Sat, 27 Apr 2013 02:27:53 -0400 Message-ID: <517B6FC5.7070003@redhat.com> Date: Sat, 27 Apr 2013 08:27:17 +0200 From: Daniel Borkmann User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Xi Wang CC: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Heiko Carstens , Will Drewry , Eric Dumazet , Russell King , David Laight , "David S. Miller" , Andrew Morton , Nicolas Schichan Subject: Re: [PATCH v2 net-next 3/3] ARM: net: bpf_jit_32: support BPF_S_ANC_SECCOMP_LD_W instruction References: <1367029047-14830-1-git-send-email-xi.wang@gmail.com> <1367029047-14830-4-git-send-email-xi.wang@gmail.com> In-Reply-To: <1367029047-14830-4-git-send-email-xi.wang@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2284 Lines: 67 On 04/27/2013 04:17 AM, Xi Wang wrote: > This patch implements the seccomp BPF_S_ANC_SECCOMP_LD_W instruction > in ARM JIT. > > Signed-off-by: Xi Wang > Cc: Daniel Borkmann > Cc: Heiko Carstens > Cc: Will Drewry > Cc: Eric Dumazet > Cc: Russell King > Cc: David Laight > Cc: "David S. Miller" > Cc: Andrew Morton > Cc: Nicolas Schichan > --- > arch/arm/net/bpf_jit_32.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c > index 073b085..9bfce464 100644 > --- a/arch/arm/net/bpf_jit_32.c > +++ b/arch/arm/net/bpf_jit_32.c > @@ -19,6 +19,7 @@ > #include > #include > #include > +#include > > #include "bpf_jit_32.h" > > @@ -845,6 +846,19 @@ b_epilogue: > off = offsetof(struct sk_buff, queue_mapping); > emit(ARM_LDRH_I(r_A, r_skb, off), ctx); > break; > +#ifdef CONFIG_SECCOMP_FILTER > + case BPF_S_ANC_SECCOMP_LD_W: > + if (k == offsetof(struct seccomp_data, arch)) { > + emit_mov_i(r_A, AUDIT_ARCH_ARM, ctx); > + break; > + } Not an expert in ARM, but ... Arent't you doing here a similar thing in terms of getting arch as Eric criticized (Nicolas' implementation does not use that part btw.)? Also, even if it would be possible here, now your 2 JIT implementations differ in behaviour. I think this is unintended. Besides all that, I think I also pointed you to a patch that already made it in for ARM, not sure why you keep posting the ARM JIT implementation? > + ctx->seen |= SEEN_CALL; > + emit_mov_i(ARM_R3, (u32)seccomp_bpf_load, ctx); > + emit_mov_i(ARM_R0, k, ctx); > + emit_blx_r(ARM_R3, ctx); > + emit(ARM_MOV_R(r_A, ARM_R0), ctx); > + break; > +#endif > default: > return -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/