提交 aafc787e 编写于 作者: D Daniel Borkmann 提交者: David S. Miller

arm: bpf_jit: can call module_free() from any context

Follow-up on module_free()/vfree() that takes care of the rest, so no
longer this workaround with work_struct needed.
Signed-off-by: NDaniel Borkmann <dborkman@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Mircea Gherzan <mgherzan@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 ed900ffb
...@@ -900,8 +900,7 @@ void bpf_jit_compile(struct sk_filter *fp) ...@@ -900,8 +900,7 @@ void bpf_jit_compile(struct sk_filter *fp)
#endif #endif
alloc_size = 4 * ctx.idx; alloc_size = 4 * ctx.idx;
ctx.target = module_alloc(max(sizeof(struct work_struct), ctx.target = module_alloc(alloc_size);
alloc_size));
if (unlikely(ctx.target == NULL)) if (unlikely(ctx.target == NULL))
goto out; goto out;
...@@ -927,19 +926,8 @@ void bpf_jit_compile(struct sk_filter *fp) ...@@ -927,19 +926,8 @@ void bpf_jit_compile(struct sk_filter *fp)
return; return;
} }
static void bpf_jit_free_worker(struct work_struct *work)
{
module_free(NULL, work);
}
void bpf_jit_free(struct sk_filter *fp) void bpf_jit_free(struct sk_filter *fp)
{ {
struct work_struct *work; if (fp->bpf_func != sk_run_filter)
module_free(NULL, fp->bpf_func);
if (fp->bpf_func != sk_run_filter) {
work = (struct work_struct *)fp->bpf_func;
INIT_WORK(work, bpf_jit_free_worker);
schedule_work(work);
}
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册