Re: [PATCH] bpf, powerpc: fix jit for seccomp_data access

5 messages, 3 authors, 2018-02-22 · open the first message on its own page

Re: [PATCH] bpf, powerpc: fix jit for seccomp_data access

From: Naveen N. Rao <hidden>
Date: 2018-02-21 08:35:33

Mark Lord wrote:
quoted hunk
I am using SECCOMP to filter syscalls on a ppc32 platform,
and noticed that the JIT compiler was failing on the BPF
even though the interpreter was working fine.
=20
The issue was that the compiler was missing one of the instructions
used by SECCOMP, so here is a patch to enable JIT for that instruction.
=20
Signed-Off-By:  Mark Lord <redacted>
=20
--- old/arch/powerpc/net/bpf_jit_comp.c 2018-02-16 14:07:01.000000000 -05=
00
quoted hunk
+++ linux/arch/powerpc/net/bpf_jit_comp.c       2018-02-20 14:41:20.80522=
7494 -0500
quoted hunk
@@ -329,6 +329,9 @@ static int bpf_jit_build_body(struct bpf
                        BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, len) !=
=3D 4);
                        PPC_LWZ_OFFS(r_A, r_skb, offsetof(struct sk_buff,=
 len));
                        break;
+               case BPF_LDX | BPF_W | BPF_ABS: /* A =3D *((u32 *)(seccom=
p_data + K)); */
+                       PPC_LWZ_OFFS(r_A, r_skb, K);
+                       break;
Looks good to me, but I am not able to apply this patch. There seems to=20
be whitespace damage. Please resend the patch considering the steps=20
here:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Doc=
umentation/process/email-clients.rst

Thanks,
Naveen

=

Re: [PATCH] bpf, powerpc: fix jit for seccomp_data access

From: Mark Lord <hidden>
Date: 2018-02-21 12:52:37

On 18-02-21 03:35 AM, Naveen N. Rao wrote:
Mark Lord wrote:
quoted
I am using SECCOMP to filter syscalls on a ppc32 platform,
and noticed that the JIT compiler was failing on the BPF
even though the interpreter was working fine.

The issue was that the compiler was missing one of the instructions
used by SECCOMP, so here is a patch to enable JIT for that instruction.

Signed-Off-By:  Mark Lord <redacted>
--- old/arch/powerpc/net/bpf_jit_comp.c 2018-02-16 14:07:01.000000000 -0500
+++ linux/arch/powerpc/net/bpf_jit_comp.c       2018-02-20 14:41:20.805227494 -0500
@@ -329,6 +329,9 @@ static int bpf_jit_build_body(struct bpf
                        BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, len) != 4);
                        PPC_LWZ_OFFS(r_A, r_skb, offsetof(struct sk_buff, len));
                        break;
+               case BPF_LDX | BPF_W | BPF_ABS: /* A = *((u32 *)(seccomp_data + K)); */
+                       PPC_LWZ_OFFS(r_A, r_skb, K);
+                       break;
Looks good to me, but I am not able to apply this patch. There seems to be whitespace damage.
Here (attached) is a clean copy.

-- 
Mark Lord
Real-Time Remedies Inc.
mlord@pobox.com

Re: [PATCH] bpf, powerpc: fix jit for seccomp_data access

From: Mark Lord <hidden>
Date: 2018-02-21 13:41:35

On 18-02-21 07:52 AM, Mark Lord wrote:
On 18-02-21 03:35 AM, Naveen N. Rao wrote:
..
quoted
Looks good to me, but I am not able to apply this patch. There seems to be whitespace damage.
Here (attached) is a clean copy.
Again, this time with the commit message included!

I am using SECCOMP to filter syscalls on a ppc32 platform,
and noticed that the JIT compiler was failing on the BPF
even though the interpreter was working fine.

The issue was that the compiler was missing one of the instructions
used by SECCOMP, so here is a patch to enable JIT for that instruction.

Signed-Off-By:  Mark Lord <redacted>
--- old/arch/powerpc/net/bpf_jit_comp.c 2018-02-16 14:07:01.000000000 -0500
+++ linux/arch/powerpc/net/bpf_jit_comp.c       2018-02-20 14:41:20.805227494 -0500
@@ -329,6 +329,9 @@ static int bpf_jit_build_body(struct bpf
                        BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, len) != 4);
                        PPC_LWZ_OFFS(r_A, r_skb, offsetof(struct sk_buff, len));
                        break;
+               case BPF_LDX | BPF_W | BPF_ABS: /* A = *((u32 *)(seccomp_data + K)); */
+                       PPC_LWZ_OFFS(r_A, r_skb, K);
+                       break;
                case BPF_LDX | BPF_W | BPF_LEN: /* X = skb->len; */
                        PPC_LWZ_OFFS(r_X, r_skb, offsetof(struct sk_buff, len));
                        break;
-- 
Mark Lord
Real-Time Remedies Inc.
mlord@pobox.com

Re: [PATCH] bpf, powerpc: fix jit for seccomp_data access

From: Naveen N. Rao <hidden>
Date: 2018-02-21 14:09:02

Mark Lord wrote:
On 18-02-21 07:52 AM, Mark Lord wrote:
quoted
On 18-02-21 03:35 AM, Naveen N. Rao wrote:
..
quoted
quoted
Looks good to me, but I am not able to apply this patch. There seems to=
 be whitespace damage.
quoted
=20
Here (attached) is a clean copy.
=20
Again, this time with the commit message included!
Thanks. However...
I am able to apply this using 'patch', but not with 'git am' since the=20
headers are missing. FWIW, the usual workflow is to make the changes and=20
commit it into your repository using 'git commit' and then use 'git=20
format-patch' to generate a patch file that you can then post.

I'll defer to Michael on whether he is ok to process this as it is.
=20
I am using SECCOMP to filter syscalls on a ppc32 platform,
and noticed that the JIT compiler was failing on the BPF
even though the interpreter was working fine.
=20
The issue was that the compiler was missing one of the instructions
used by SECCOMP, so here is a patch to enable JIT for that instruction.
=20
Signed-Off-By:  Mark Lord <redacted>
Minot nit: The correct (TM) tag to use is:
Signed-off-by:
(note the case)
quoted hunk
=20
--- old/arch/powerpc/net/bpf_jit_comp.c 2018-02-16 14:07:01.000000000 -05=
00
quoted hunk
+++ linux/arch/powerpc/net/bpf_jit_comp.c       2018-02-20 14:41:20.80522=
7494 -0500
quoted hunk
@@ -329,6 +329,9 @@ static int bpf_jit_build_body(struct bpf
                        BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, len) !=
=3D 4);
                        PPC_LWZ_OFFS(r_A, r_skb, offsetof(struct sk_buff,=
 len));
                        break;
+               case BPF_LDX | BPF_W | BPF_ABS: /* A =3D *((u32 *)(seccom=
p_data + K)); */
+                       PPC_LWZ_OFFS(r_A, r_skb, K);
+                       break;
                case BPF_LDX | BPF_W | BPF_LEN: /* X =3D skb->len; */
                        PPC_LWZ_OFFS(r_X, r_skb, offsetof(struct sk_buff,=
 len));
                        break;
Apart from those aspects, for this patch:
Acked-by: Naveen N. Rao <redacted>


- Naveen

=

Re: [PATCH] bpf, powerpc: fix jit for seccomp_data access

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2018-02-22 03:38:57

"Naveen N. Rao" [off-list ref] writes:
Mark Lord wrote:
quoted
On 18-02-21 07:52 AM, Mark Lord wrote:
quoted
On 18-02-21 03:35 AM, Naveen N. Rao wrote:
..
quoted
quoted
Looks good to me, but I am not able to apply this patch. There seems to be whitespace damage.
Here (attached) is a clean copy.
Again, this time with the commit message included!
Thanks. However...
I am able to apply this using 'patch', but not with 'git am' since the 
headers are missing. FWIW, the usual workflow is to make the changes and 
commit it into your repository using 'git commit' and then use 'git 
format-patch' to generate a patch file that you can then post.

I'll defer to Michael on whether he is ok to process this as it is.
The main thing is that it's caught by patchwork[1], otherwise I tend to
miss it. In this case the initial patch was caught by patchwork, so
that's fine.

I fixed up the white space and other issues before applying.

In general I'm happy to do that for new/infrequent committers, not so
much for people who send lots of patches and/or are paid to do so :)

cheers

1: http://patchwork.ozlabs.org/patch/875890/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help