Skip to content

Commit 8bc251e

Browse files
committed
Merge tag 'nf-25-04-03' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf
Pablo Neira Ayuso says: ==================== Netfilter fixes for net The following batch contains Netfilter fixes for net: 1) conncount incorrectly removes element for non-dynamic sets, these elements represent a static control plane configuration, leave them in place. 2) syzbot found a way to unregister a basechain that has been never registered from the chain update path, fix from Florian Westphal. 3) Fix incorrect pointer arithmetics in geneve support for tunnel, from Lin Ma. * tag 'nf-25-04-03' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf: netfilter: nft_tunnel: fix geneve_opt type confusion addition netfilter: nf_tables: don't unregister hook when table is dormant netfilter: nft_set_hash: GC reaps elements with conncount for dynamic sets only ==================== Link: https://patch.msgid.link/20250403115752.19608-1-pablo@netfilter.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 9158737 + 1b755d8 commit 8bc251e

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

net/netfilter/nf_tables_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2839,11 +2839,11 @@ static int nf_tables_updchain(struct nft_ctx *ctx, u8 genmask, u8 policy,
28392839
err = nft_netdev_register_hooks(ctx->net, &hook.list);
28402840
if (err < 0)
28412841
goto err_hooks;
2842+
2843+
unregister = true;
28422844
}
28432845
}
28442846

2845-
unregister = true;
2846-
28472847
if (nla[NFTA_CHAIN_COUNTERS]) {
28482848
if (!nft_is_base_chain(chain)) {
28492849
err = -EOPNOTSUPP;

net/netfilter/nft_set_hash.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ static bool nft_rhash_expr_needs_gc_run(const struct nft_set *set,
309309

310310
nft_setelem_expr_foreach(expr, elem_expr, size) {
311311
if (expr->ops->gc &&
312-
expr->ops->gc(read_pnet(&set->net), expr))
312+
expr->ops->gc(read_pnet(&set->net), expr) &&
313+
set->flags & NFT_SET_EVAL)
313314
return true;
314315
}
315316

net/netfilter/nft_tunnel.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ static const struct nla_policy nft_tunnel_opts_geneve_policy[NFTA_TUNNEL_KEY_GEN
341341
static int nft_tunnel_obj_geneve_init(const struct nlattr *attr,
342342
struct nft_tunnel_opts *opts)
343343
{
344-
struct geneve_opt *opt = (struct geneve_opt *)opts->u.data + opts->len;
344+
struct geneve_opt *opt = (struct geneve_opt *)(opts->u.data + opts->len);
345345
struct nlattr *tb[NFTA_TUNNEL_KEY_GENEVE_MAX + 1];
346346
int err, data_len;
347347

@@ -625,7 +625,7 @@ static int nft_tunnel_opts_dump(struct sk_buff *skb,
625625
if (!inner)
626626
goto failure;
627627
while (opts->len > offset) {
628-
opt = (struct geneve_opt *)opts->u.data + offset;
628+
opt = (struct geneve_opt *)(opts->u.data + offset);
629629
if (nla_put_be16(skb, NFTA_TUNNEL_KEY_GENEVE_CLASS,
630630
opt->opt_class) ||
631631
nla_put_u8(skb, NFTA_TUNNEL_KEY_GENEVE_TYPE,

0 commit comments

Comments
 (0)