From: Amy Fong <Amy_Fong@mentor.com>
To: <cip-dev@lists.cip-project.org>
Cc: <nobuhiro1.iwamatsu@toshiba.co.jp>, <pavel@denx.de>
Subject: Re: [cip-dev] [PATCH 4.19.y-cip 2/6] Backport netfilter: nf_tables: autoload modules from the abort path
Date: Mon, 10 Jan 2022 09:12:08 -0500 [thread overview]
Message-ID: <Ydw+uPNGD/6ms6qi@cat> (raw)
In-Reply-To: <16C8EE09FDEB733D.27414@lists.cip-project.org>
From 185a61df95c18e5111df5ba439b0e60a8a6e40cb Mon Sep 17 00:00:00 2001
From: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Fri, 5 Jul 2019 23:38:46 +0200
Subject: [PATCH 2/5] netfilter: nf_tables: add nft_expr_type_request_module()
This helper function makes sure the family specific extension is loaded.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
(cherry picked from commit b9c04ae7907f09c5e873e7c9a8feea2ce41e15b3)
---
net/netfilter/nf_tables_api.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index 02e577e8fb8a..8ec38de1f7a1 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -2009,6 +2009,19 @@ static const struct nft_expr_type *__nft_expr_type_get(u8 family,
return NULL;
}
+#ifdef CONFIG_MODULES
+static int nft_expr_type_request_module(struct net *net, u8 family,
+ struct nlattr *nla)
+{
+ nft_request_module(net, "nft-expr-%u-%.*s", family,
+ nla_len(nla), (char *)nla_data(nla));
+ if (__nft_expr_type_get(family, nla))
+ return -EAGAIN;
+
+ return 0;
+}
+#endif
+
static const struct nft_expr_type *nft_expr_type_get(struct net *net,
u8 family,
struct nlattr *nla)
@@ -2025,9 +2038,7 @@ static const struct nft_expr_type *nft_expr_type_get(struct net *net,
lockdep_nfnl_nft_mutex_not_held();
#ifdef CONFIG_MODULES
if (type == NULL) {
- nft_request_module(net, "nft-expr-%u-%.*s", family,
- nla_len(nla), (char *)nla_data(nla));
- if (__nft_expr_type_get(family, nla))
+ if (nft_expr_type_request_module(net, family, nla) == -EAGAIN)
return ERR_PTR(-EAGAIN);
nft_request_module(net, "nft-expr-%.*s",
--
2.34.1
next prev parent reply other threads:[~2022-01-10 14:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <16C8EE09FDEB733D.27414@lists.cip-project.org>
2022-01-10 14:10 ` [cip-dev] [PATCH 4.19.y-cip 1/6] Backport netfilter: nf_tables: autoload modules from the abort path Amy Fong
2022-01-10 17:55 ` Pavel Machek
2022-01-10 18:06 ` Pavel Machek
2022-01-10 20:12 ` Amy Fong
2022-01-11 9:02 ` Pavel Machek
2022-01-11 14:43 ` Amy Fong
2022-01-11 17:53 ` Pavel Machek
2023-03-10 11:43 ` Jan Kiszka
2023-03-10 14:20 ` Fong, Amy
2022-01-10 14:12 ` Amy Fong [this message]
2022-01-10 14:12 ` [cip-dev] [PATCH 4.19.y-cip 3/6] " Amy Fong
2022-01-10 14:13 ` [cip-dev] [PATCH 4.19.y-cip 4/6] " Amy Fong
2022-01-10 14:14 ` [cip-dev] [PATCH 4.19.y-cip 5/6] " Amy Fong
2022-01-10 14:21 ` [cip-dev] [PATCH 4.19.y-cip 6/6] " Amy Fong
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=Ydw+uPNGD/6ms6qi@cat \
--to=amy_fong@mentor.com \
--cc=cip-dev@lists.cip-project.org \
--cc=nobuhiro1.iwamatsu@toshiba.co.jp \
--cc=pavel@denx.de \
/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