From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nft] src: netlink: fix crash when ops doesn't support udata
Date: Sat, 10 May 2025 00:27:37 +0200 [thread overview]
Message-ID: <aB6BWUCRyp2NlyjI@calendula> (raw)
In-Reply-To: <20250508142907.4871-1-fw@strlen.de>
On Thu, May 08, 2025 at 04:29:04PM +0200, Florian Westphal wrote:
> Whenever a new version adds udata support to an expression, then old
> versions of nft will crash when trying to list such a ruleset generated
> by a more recent version of nftables.
>
> Fix this by falling back to 'type' format.
Fixes: 6e48df5329ea ('src: add "typeof" build/parse/print support')
> Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Pablo Neira Ayuso <pablo@netfilter.org>
Thanks.
> ---
> src/netlink.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/netlink.c b/src/netlink.c
> index 25ee3419772b..5825a68d03bc 100644
> --- a/src/netlink.c
> +++ b/src/netlink.c
> @@ -913,7 +913,7 @@ static struct expr *set_make_key(const struct nftnl_udata *attr)
>
> etype = nftnl_udata_get_u32(ud[NFTNL_UDATA_SET_TYPEOF_EXPR]);
> ops = expr_ops_by_type_u32(etype);
> - if (!ops)
> + if (!ops || !ops->parse_udata)
> return NULL;
>
> expr = ops->parse_udata(ud[NFTNL_UDATA_SET_TYPEOF_DATA]);
> --
> 2.49.0
>
>
prev parent reply other threads:[~2025-05-09 22:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-08 14:29 [PATCH nft] src: netlink: fix crash when ops doesn't support udata Florian Westphal
2025-05-09 22:27 ` Pablo Neira Ayuso [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=aB6BWUCRyp2NlyjI@calendula \
--to=pablo@netfilter.org \
--cc=fw@strlen.de \
--cc=netfilter-devel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.