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);
}
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
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]
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.