2015-05-07 13:00:25

by Nicolas Schichan

[permalink] [raw]
Subject: [PATCH v2] ARM: net: add JIT support for loads from struct seccomp_data.

Signed-off-by: Nicolas Schichan <[email protected]>
---

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


2015-05-10 02:29:04

by David Miller

[permalink] [raw]
Subject: Re: [PATCH v2] ARM: net: add JIT support for loads from struct seccomp_data.

From: Nicolas Schichan <[email protected]>
Date: Thu, 7 May 2015 15:00:13 +0200

> Signed-off-by: Nicolas Schichan <[email protected]>
> ---
>
> 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.

Where would you like this to be applied, my tree?

This is an ongoing situation, where people have traditionally not
consistently wanted bpf JIT patches to go into the networking tree.

So I beg everyone posting such things to netdev to be _clear_
and _explicit_ about whether you expect me to integrate the patch
or not.

Thanks.

2015-05-10 19:40:50

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH v2] ARM: net: add JIT support for loads from struct seccomp_data.

On Sat, May 09, 2015 at 10:28:58PM -0400, David Miller wrote:
> From: Nicolas Schichan <[email protected]>
> Date: Thu, 7 May 2015 15:00:13 +0200
>
> > Signed-off-by: Nicolas Schichan <[email protected]>
> > ---
> >
> > 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.
>
> Where would you like this to be applied, my tree?
>
> This is an ongoing situation, where people have traditionally not
> consistently wanted bpf JIT patches to go into the networking tree.
>
> So I beg everyone posting such things to netdev to be _clear_
> and _explicit_ about whether you expect me to integrate the patch
> or not.

I think you have taken previous ARM net JIT patches, so I think it
makes sense if you continue to do so. I'm not knowledgable of the
JIT interface myself, all I can say about many of these patches is
that they look okay to me on a superficial basis.

I suspect you're doing more or less the same, but from a slightly
different perspective (presumably through not knowing ARM assembly.)

--
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

2015-05-10 23:20:18

by David Miller

[permalink] [raw]
Subject: Re: [PATCH v2] ARM: net: add JIT support for loads from struct seccomp_data.

From: Russell King - ARM Linux <[email protected]>
Date: Sun, 10 May 2015 20:40:28 +0100

> I think you have taken previous ARM net JIT patches, so I think it
> makes sense if you continue to do so. I'm not knowledgable of the
> JIT interface myself, all I can say about many of these patches is
> that they look okay to me on a superficial basis.
>
> I suspect you're doing more or less the same, but from a slightly
> different perspective (presumably through not knowing ARM assembly.)

Ok, I'll flow the ARM JIT patches through my tree then.

Thanks Russell.

2015-05-12 22:21:01

by David Miller

[permalink] [raw]
Subject: Re: [PATCH v2] ARM: net: add JIT support for loads from struct seccomp_data.

From: Nicolas Schichan <[email protected]>
Date: Thu, 7 May 2015 15:00:13 +0200

> Signed-off-by: Nicolas Schichan <[email protected]>

Applied, thanks.