2013-05-21 04:25:48

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: manual merge of the akpm tree with the net-next tree

Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in
arch/arm/net/bpf_jit_32.c between commit aafc787e41fd ("arm: bpf_jit: can
call module_free() from any context") from the net-next tree and commit
"ARM: net: bpf_jit: make code generation less dependent on struct
sk_filter" from the akpm tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

--
Cheers,
Stephen Rothwell [email protected]

diff --cc arch/arm/net/bpf_jit_32.c
index f50d223,2dab3e6..0000000
--- a/arch/arm/net/bpf_jit_32.c
+++ b/arch/arm/net/bpf_jit_32.c
@@@ -926,8 -926,32 +925,21 @@@ out
return;
}

+ void bpf_jit_compile(struct sk_filter *fp)
+ {
+ struct jit_ctx ctx;
+
+ memset(&ctx, 0, sizeof(ctx));
+ ctx.prog_len = fp->len;
+ ctx.prog_insns = fp->insns;
+
+ __bpf_jit_compile(&ctx);
+ if (ctx.target)
+ fp->bpf_func = (void *)ctx.target;
+ }
+
-static void bpf_jit_free_worker(struct work_struct *work)
-{
- module_free(NULL, work);
-}
-
void bpf_jit_free(struct sk_filter *fp)
{
- struct work_struct *work;
-
- if (fp->bpf_func != sk_run_filter) {
- work = (struct work_struct *)fp->bpf_func;
-
- INIT_WORK(work, bpf_jit_free_worker);
- schedule_work(work);
- }
+ if (fp->bpf_func != sk_run_filter)
+ module_free(NULL, fp->bpf_func);
}


Attachments:
(No filename) (1.31 kB)
(No filename) (836.00 B)
Download all attachments

2013-05-21 07:44:32

by Daniel Borkmann

[permalink] [raw]
Subject: Re: linux-next: manual merge of the akpm tree with the net-next tree

Hi Stephen,

On 05/21/2013 06:25 AM, Stephen Rothwell wrote:
> Hi Andrew,
>
> Today's linux-next merge of the akpm tree got a conflict in
> arch/arm/net/bpf_jit_32.c between commit aafc787e41fd ("arm: bpf_jit: can
> call module_free() from any context") from the net-next tree and commit
> "ARM: net: bpf_jit: make code generation less dependent on struct
> sk_filter" from the akpm tree.
>
> I fixed it up (see below) and can carry the fix as necessary (no action
> is required).

Also seccomp_jit_free() needs a change otherwise the kernel won't build
with CONFIG_SECCOMP_FILTER_JIT enabled since the work_struct is initialized
with the bpf_jit_free_worker() callback, which is no longer existent.

Do you want me to send you a patch?

Quite frankly, I don't like so much that {seccomp,bpf}_jit_compile() and
{seccomp,bpf}_jit_free() are almost idential functions and now both need
to be maintained with the same changes, but that's off-topic here.

Cheers,

Daniel

2013-05-21 23:54:50

by Stephen Rothwell

[permalink] [raw]
Subject: Re: linux-next: manual merge of the akpm tree with the net-next tree

Hi Daniel,

On Tue, 21 May 2013 09:44:13 +0200 Daniel Borkmann <[email protected]> wrote:
>
> Also seccomp_jit_free() needs a change otherwise the kernel won't build
> with CONFIG_SECCOMP_FILTER_JIT enabled since the work_struct is initialized
> with the bpf_jit_free_worker() callback, which is no longer existent.
>
> Do you want me to send you a patch?

Yes, please.

--
Cheers,
Stephen Rothwell [email protected]


Attachments:
(No filename) (443.00 B)
(No filename) (836.00 B)
Download all attachments

2013-05-22 09:21:07

by Daniel Borkmann

[permalink] [raw]
Subject: Re: linux-next: manual merge of the akpm tree with the net-next tree

On 05/22/2013 01:54 AM, Stephen Rothwell wrote:
> Hi Daniel,
>
> On Tue, 21 May 2013 09:44:13 +0200 Daniel Borkmann <[email protected]> wrote:
>>
>> Also seccomp_jit_free() needs a change otherwise the kernel won't build
>> with CONFIG_SECCOMP_FILTER_JIT enabled since the work_struct is initialized
>> with the bpf_jit_free_worker() callback, which is no longer existent.
>>
>> Do you want me to send you a patch?
>
> Yes, please.

In case this is still needed, patch attached. That should fix it.


Attachments:
0001-arm-bpf_jit-fixup-build-error-in-seccomp_jit_free.patch (1.36 kB)