lkml.org 
[lkml]   [2023]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH bpf-next v2 3/6] netfilter: bpf: Prevent defrag module unload while link active
Daniel Xu <dxu@dxuuu.xyz> wrote:
> + /* Prevent defrag module from going away while in use */
> + if (!try_module_get(v4_hook->owner)) {
> + err = -ENOENT;
> + goto out_v4;
> + }
> +
> err = v4_hook->enable(link->net);
> out_v4:
> rcu_read_unlock();
> @@ -79,6 +86,12 @@ static int bpf_nf_enable_defrag(struct bpf_nf_link *link)
> }
> }
>
> + /* Prevent defrag module from going away while in use */
> + if (!try_module_get(v6_hook->owner)) {
> + err = -ENOENT;
> + goto out_v6;
> + }
> +
> err = v6_hook->enable(link->net);
> out_v6:
> rcu_read_unlock();

This needs module_put() calls in case ->enable() returns an error, no?

Other than this this series LGTM, thanks!

\
 
 \ /
  Last update: 2023-07-07 12:10    [W:6.405 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site