From: Florian Westphal <fw@strlen.de>
To: Daniel Xu <dxu@dxuuu.xyz>
Cc: pabeni@redhat.com, edumazet@google.com, kuba@kernel.org,
fw@strlen.de, davem@davemloft.net, pablo@netfilter.org,
kadlec@netfilter.org, dsahern@kernel.org, daniel@iogearbox.net,
netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v2 3/6] netfilter: bpf: Prevent defrag module unload while link active
Date: Fri, 7 Jul 2023 12:09:28 +0200 [thread overview]
Message-ID: <20230707100928.GA11622@breakpoint.cc> (raw)
In-Reply-To: <81ede90e3f1468763ea5b0b6ec2971b7b1b870c1.1688685338.git.dxu@dxuuu.xyz>
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!
prev parent reply other threads:[~2023-07-07 10:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-06 23:25 [PATCH bpf-next v2 0/6] Support defragmenting IPv(4|6) packets in BPF Daniel Xu
2023-07-06 23:25 ` [PATCH bpf-next v2 1/6] netfilter: defrag: Add glue hooks for enabling/disabling defrag Daniel Xu
2023-07-06 23:25 ` [PATCH bpf-next v2 2/6] netfilter: bpf: Support BPF_F_NETFILTER_IP_DEFRAG in netfilter link Daniel Xu
2023-07-06 23:25 ` [PATCH bpf-next v2 3/6] netfilter: bpf: Prevent defrag module unload while link active Daniel Xu
2023-07-07 10:09 ` Florian Westphal [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230707100928.GA11622@breakpoint.cc \
--to=fw@strlen.de \
--cc=bpf@vger.kernel.org \
--cc=coreteam@netfilter.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=dxu@dxuuu.xyz \
--cc=edumazet@google.com \
--cc=kadlec@netfilter.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pablo@netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).