| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/08/21 16:38 | flow | patch-triage |
2mArgs:null Results: {
"EnableConfigs": [
"NF_TABLES"
],
"FocusSymbols": [
"nf_tables_newsetelem",
"nf_tables_commit",
"nft_dynset_init",
"nft_pipapo_avx2_lookup",
"pipapo_get_avx2"
],
"KMSANReasoning": "The patch series primarily consists of:\n1. Removal of `pr_debug` statements and conversion of some to `pr_info_ratelimited` across various netfilter modules.\n2. Conversion of `WARN_ON` to `DEBUG_NET_WARN_ON_ONCE`.\n3. Refactoring of expression cloning (`nft_set_elem_expr_clone`) in `nf_tables_api.c` and `nft_dynset.c` to manage expression ownership using an `override_exprs` flag, likely addressing memory leaks or use-after-free issues.\n4. A logic fix in `nft_hook_list_find` for interface name string comparison.\n5. A fix in `pipapo_get_avx2` to ensure `vzeroupper` is called on all return paths.\n6. Reordering of `nft_flow_rule_offload_commit` in `nf_tables_commit`.\n\nNone of these changes introduce new allocations of complex data structures sent to userspace without initialization, nor do they introduce conditional logic based on potentially uninitialized memory. The `override_exprs` bitfield added to `struct nft_dynset` is part of a zero-allocated structure (via `nft_expr_init`). Any memory safety issues related to the modified expression management (such as use-after-free or double free) will be effectively caught by standard KASAN. Therefore, a dedicated KMSAN fuzzing session is not required.",
"NeedsKMSAN": false,
"Reasoning": "The patch modifies core netfilter tables (nf_tables) logic, including set element addition, commit phase, dynamic set initialization, and AVX2 pipapo set lookup. These are functional changes in reachable core network filtering paths.",
"WorthFuzzing": true
} |
| 1/1 | 2026/08/21 16:38 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 52c1637fa25dc4634685f2566eba4bcc60afa332\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Fri Aug 21 16:38:19 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h\nindex 238f6ecb90e99..9d597482363d9 100644\n--- a/include/net/netfilter/nf_tables.h\n+++ b/include/net/netfilter/nf_tables.h\n@@ -870,8 +870,6 @@ struct nft_elem_priv *nft_set_elem_init(const struct nft_set *set,\n \t\t\t\t\tconst u32 *key, const u32 *key_end,\n \t\t\t\t\tconst u32 *data,\n \t\t\t\t\tu64 timeout, u64 expiration, gfp_t gfp);\n-int nft_set_elem_expr_clone(const struct nft_ctx *ctx, struct nft_set *set,\n-\t\t\t struct nft_expr *expr_array[]);\n void nft_set_elem_expr_destroy(const struct nft_ctx *ctx,\n \t\t\t struct nft_set_elem_expr *elem_expr);\n void nft_set_elem_destroy(const struct nft_set *set,\ndiff --git a/net/ipv4/netfilter/ipt_ah.c b/net/ipv4/netfilter/ipt_ah.c\nindex 161ba412cb08b..7131f297ada2e 100644\n--- a/net/ipv4/netfilter/ipt_ah.c\n+++ b/net/ipv4/netfilter/ipt_ah.c\n@@ -19,12 +19,7 @@ MODULE_DESCRIPTION(\"Xtables: IPv4 IPsec-AH SPI match\");\n static inline bool\n spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, bool invert)\n {\n-\tbool r;\n-\tpr_debug(\"spi_match:%c 0x%x \u003c= 0x%x \u003c= 0x%x\\n\",\n-\t\t invert ? '!' : ' ', min, spi, max);\n-\tr = (spi \u003e= min \u0026\u0026 spi \u003c= max) ^ invert;\n-\tpr_debug(\" result %s\\n\", r ? \"PASS\" : \"FAILED\");\n-\treturn r;\n+\treturn (spi \u003e= min \u0026\u0026 spi \u003c= max) ^ invert;\n }\n \n static bool ah_mt(const struct sk_buff *skb, struct xt_action_param *par)\n@@ -42,7 +37,6 @@ static bool ah_mt(const struct sk_buff *skb, struct xt_action_param *par)\n \t\t/* We've been asked to examine this packet, and we\n \t\t * can't. Hence, no choice but to drop.\n \t\t */\n-\t\tpr_debug(\"Dropping evil AH tinygram.\\n\");\n \t\tpar-\u003ehotdrop = true;\n \t\treturn false;\n \t}\n@@ -58,7 +52,7 @@ static int ah_mt_check(const struct xt_mtchk_param *par)\n \n \t/* Must specify no unknown invflags */\n \tif (ahinfo-\u003einvflags \u0026 ~IPT_AH_INV_MASK) {\n-\t\tpr_debug(\"unknown flags %X\\n\", ahinfo-\u003einvflags);\n+\t\tpr_info_ratelimited(\"unknown flags %X\\n\", ahinfo-\u003einvflags);\n \t\treturn -EINVAL;\n \t}\n \treturn 0;\ndiff --git a/net/ipv4/netfilter/nf_tproxy_ipv4.c b/net/ipv4/netfilter/nf_tproxy_ipv4.c\nindex 041c3f37f237b..5eab7a2dc8ef2 100644\n--- a/net/ipv4/netfilter/nf_tproxy_ipv4.c\n+++ b/net/ipv4/netfilter/nf_tproxy_ipv4.c\n@@ -137,7 +137,7 @@ nf_tproxy_get_sock_v4(struct net *net, struct sk_buff *skb,\n \t\t}\n \t\tbreak;\n \tdefault:\n-\t\tWARN_ON(1);\n+\t\tDEBUG_NET_WARN_ON_ONCE(1);\n \t\tsk = NULL;\n \t}\n \ndiff --git a/net/ipv6/netfilter/ip6t_ah.c b/net/ipv6/netfilter/ip6t_ah.c\nindex 1258783ed8762..dab7dbc6a675c 100644\n--- a/net/ipv6/netfilter/ip6t_ah.c\n+++ b/net/ipv6/netfilter/ip6t_ah.c\n@@ -24,13 +24,7 @@ MODULE_AUTHOR(\"Andras Kis-Szabo \u003ckisza@sch.bme.hu\u003e\");\n static inline bool\n spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, bool invert)\n {\n-\tbool r;\n-\n-\tpr_debug(\"spi_match:%c 0x%x \u003c= 0x%x \u003c= 0x%x\\n\",\n-\t\t invert ? '!' : ' ', min, spi, max);\n-\tr = (spi \u003e= min \u0026\u0026 spi \u003c= max) ^ invert;\n-\tpr_debug(\" result %s\\n\", r ? \"PASS\" : \"FAILED\");\n-\treturn r;\n+\treturn (spi \u003e= min \u0026\u0026 spi \u003c= max) ^ invert;\n }\n \n static bool ah_mt6(const struct sk_buff *skb, struct xt_action_param *par)\n@@ -62,23 +56,6 @@ static bool ah_mt6(const struct sk_buff *skb, struct xt_action_param *par)\n \t\treturn false;\n \t}\n \n-\tpr_debug(\"IPv6 AH LEN %u %u \", hdrlen, ah-\u003ehdrlen);\n-\tpr_debug(\"RES %04X \", ah-\u003ereserved);\n-\tpr_debug(\"SPI %u %08X\\n\", ntohl(ah-\u003espi), ntohl(ah-\u003espi));\n-\n-\tpr_debug(\"IPv6 AH spi %02X \",\n-\t\t spi_match(ahinfo-\u003espis[0], ahinfo-\u003espis[1],\n-\t\t\t ntohl(ah-\u003espi),\n-\t\t\t !!(ahinfo-\u003einvflags \u0026 IP6T_AH_INV_SPI)));\n-\tpr_debug(\"len %02X %04X %02X \",\n-\t\t ahinfo-\u003ehdrlen, hdrlen,\n-\t\t (!ahinfo-\u003ehdrlen ||\n-\t\t (ahinfo-\u003ehdrlen == hdrlen) ^\n-\t\t !!(ahinfo-\u003einvflags \u0026 IP6T_AH_INV_LEN)));\n-\tpr_debug(\"res %02X %04X %02X\\n\",\n-\t\t ahinfo-\u003ehdrres, ah-\u003ereserved,\n-\t\t !(ahinfo-\u003ehdrres \u0026\u0026 ah-\u003ereserved));\n-\n \treturn spi_match(ahinfo-\u003espis[0], ahinfo-\u003espis[1],\n \t\t\t ntohl(ah-\u003espi),\n \t\t\t !!(ahinfo-\u003einvflags \u0026 IP6T_AH_INV_SPI)) \u0026\u0026\n@@ -93,7 +70,7 @@ static int ah_mt6_check(const struct xt_mtchk_param *par)\n \tconst struct ip6t_ah *ahinfo = par-\u003ematchinfo;\n \n \tif (ahinfo-\u003einvflags \u0026 ~IP6T_AH_INV_MASK) {\n-\t\tpr_debug(\"unknown flags %X\\n\", ahinfo-\u003einvflags);\n+\t\tpr_info_ratelimited(\"unknown flags %X\\n\", ahinfo-\u003einvflags);\n \t\treturn -EINVAL;\n \t}\n \treturn 0;\ndiff --git a/net/ipv6/netfilter/ip6t_frag.c b/net/ipv6/netfilter/ip6t_frag.c\nindex 3aad6439386b1..f5f3cfb8704cf 100644\n--- a/net/ipv6/netfilter/ip6t_frag.c\n+++ b/net/ipv6/netfilter/ip6t_frag.c\n@@ -23,12 +23,7 @@ MODULE_AUTHOR(\"Andras Kis-Szabo \u003ckisza@sch.bme.hu\u003e\");\n static inline bool\n id_match(u_int32_t min, u_int32_t max, u_int32_t id, bool invert)\n {\n-\tbool r;\n-\tpr_debug(\"id_match:%c 0x%x \u003c= 0x%x \u003c= 0x%x\\n\", invert ? '!' : ' ',\n-\t\t min, id, max);\n-\tr = (id \u003e= min \u0026\u0026 id \u003c= max) ^ invert;\n-\tpr_debug(\" result %s\\n\", r ? \"PASS\" : \"FAILED\");\n-\treturn r;\n+\treturn (id \u003e= min \u0026\u0026 id \u003c= max) ^ invert;\n }\n \n static bool\n@@ -53,38 +48,6 @@ frag_mt6(const struct sk_buff *skb, struct xt_action_param *par)\n \t\treturn false;\n \t}\n \n-\tpr_debug(\"INFO %04X \", fh-\u003efrag_off);\n-\tpr_debug(\"OFFSET %04X \", ntohs(fh-\u003efrag_off) \u0026 ~0x7);\n-\tpr_debug(\"RES %02X %04X\", fh-\u003ereserved, ntohs(fh-\u003efrag_off) \u0026 0x6);\n-\tpr_debug(\"MF %04X \", fh-\u003efrag_off \u0026 htons(IP6_MF));\n-\tpr_debug(\"ID %u %08X\\n\", ntohl(fh-\u003eidentification),\n-\t\t ntohl(fh-\u003eidentification));\n-\n-\tpr_debug(\"IPv6 FRAG id %02X \",\n-\t\t id_match(fraginfo-\u003eids[0], fraginfo-\u003eids[1],\n-\t\t\t ntohl(fh-\u003eidentification),\n-\t\t\t !!(fraginfo-\u003einvflags \u0026 IP6T_FRAG_INV_IDS)));\n-\tpr_debug(\"res %02X %02X%04X %02X \",\n-\t\t fraginfo-\u003eflags \u0026 IP6T_FRAG_RES, fh-\u003ereserved,\n-\t\t ntohs(fh-\u003efrag_off) \u0026 0x6,\n-\t\t !((fraginfo-\u003eflags \u0026 IP6T_FRAG_RES) \u0026\u0026\n-\t\t (fh-\u003ereserved || (ntohs(fh-\u003efrag_off) \u0026 0x06))));\n-\tpr_debug(\"first %02X %02X %02X \",\n-\t\t fraginfo-\u003eflags \u0026 IP6T_FRAG_FST,\n-\t\t ntohs(fh-\u003efrag_off) \u0026 ~0x7,\n-\t\t !((fraginfo-\u003eflags \u0026 IP6T_FRAG_FST) \u0026\u0026\n-\t\t (ntohs(fh-\u003efrag_off) \u0026 ~0x7)));\n-\tpr_debug(\"mf %02X %02X %02X \",\n-\t\t fraginfo-\u003eflags \u0026 IP6T_FRAG_MF,\n-\t\t ntohs(fh-\u003efrag_off) \u0026 IP6_MF,\n-\t\t !((fraginfo-\u003eflags \u0026 IP6T_FRAG_MF) \u0026\u0026\n-\t\t !((ntohs(fh-\u003efrag_off) \u0026 IP6_MF))));\n-\tpr_debug(\"last %02X %02X %02X\\n\",\n-\t\t fraginfo-\u003eflags \u0026 IP6T_FRAG_NMF,\n-\t\t ntohs(fh-\u003efrag_off) \u0026 IP6_MF,\n-\t\t !((fraginfo-\u003eflags \u0026 IP6T_FRAG_NMF) \u0026\u0026\n-\t\t (ntohs(fh-\u003efrag_off) \u0026 IP6_MF)));\n-\n \treturn id_match(fraginfo-\u003eids[0], fraginfo-\u003eids[1],\n \t\t\t ntohl(fh-\u003eidentification),\n \t\t\t !!(fraginfo-\u003einvflags \u0026 IP6T_FRAG_INV_IDS)) \u0026\u0026\n@@ -103,7 +66,7 @@ static int frag_mt6_check(const struct xt_mtchk_param *par)\n \tconst struct ip6t_frag *fraginfo = par-\u003ematchinfo;\n \n \tif (fraginfo-\u003einvflags \u0026 ~IP6T_FRAG_INV_MASK) {\n-\t\tpr_debug(\"unknown flags %X\\n\", fraginfo-\u003einvflags);\n+\t\tpr_info_ratelimited(\"unknown flags %X\\n\", fraginfo-\u003einvflags);\n \t\treturn -EINVAL;\n \t}\n \treturn 0;\ndiff --git a/net/ipv6/netfilter/ip6t_hbh.c b/net/ipv6/netfilter/ip6t_hbh.c\nindex 6d1a5d2026a67..37c207d3152a4 100644\n--- a/net/ipv6/netfilter/ip6t_hbh.c\n+++ b/net/ipv6/netfilter/ip6t_hbh.c\n@@ -79,14 +79,6 @@ hbh_mt6(const struct sk_buff *skb, struct xt_action_param *par)\n \t\treturn false;\n \t}\n \n-\tpr_debug(\"IPv6 OPTS LEN %u %u \", hdrlen, oh-\u003ehdrlen);\n-\n-\tpr_debug(\"len %02X %04X %02X \",\n-\t\t optinfo-\u003ehdrlen, hdrlen,\n-\t\t (!(optinfo-\u003eflags \u0026 IP6T_OPTS_LEN) ||\n-\t\t ((optinfo-\u003ehdrlen == hdrlen) ^\n-\t\t !!(optinfo-\u003einvflags \u0026 IP6T_OPTS_INV_LEN))));\n-\n \tret = (!(optinfo-\u003eflags \u0026 IP6T_OPTS_LEN) ||\n \t ((optinfo-\u003ehdrlen == hdrlen) ^\n \t\t!!(optinfo-\u003einvflags \u0026 IP6T_OPTS_INV_LEN)));\n@@ -96,8 +88,6 @@ hbh_mt6(const struct sk_buff *skb, struct xt_action_param *par)\n \tif (!(optinfo-\u003eflags \u0026 IP6T_OPTS_OPTS)) {\n \t\treturn ret;\n \t} else {\n-\t\tpr_debug(\"Strict \");\n-\t\tpr_debug(\"#%d \", optinfo-\u003eoptsnr);\n \t\tfor (temp = 0; temp \u003c optinfo-\u003eoptsnr; temp++) {\n \t\t\t/* type field exists ? */\n \t\t\tif (hdrlen \u003c 1)\n@@ -108,13 +98,9 @@ hbh_mt6(const struct sk_buff *skb, struct xt_action_param *par)\n \t\t\t\tbreak;\n \n \t\t\t/* Type check */\n-\t\t\tif (*tp != (optinfo-\u003eopts[temp] \u0026 0xFF00) \u003e\u003e 8) {\n-\t\t\t\tpr_debug(\"Tbad %02X %02X\\n\", *tp,\n-\t\t\t\t\t (optinfo-\u003eopts[temp] \u0026 0xFF00) \u003e\u003e 8);\n+\t\t\tif (*tp != (optinfo-\u003eopts[temp] \u0026 0xFF00) \u003e\u003e 8)\n \t\t\t\treturn false;\n-\t\t\t} else {\n-\t\t\t\tpr_debug(\"Tok \");\n-\t\t\t}\n+\n \t\t\t/* Length check */\n \t\t\tif (*tp) {\n \t\t\t\tu16 spec_len;\n@@ -129,26 +115,18 @@ hbh_mt6(const struct sk_buff *skb, struct xt_action_param *par)\n \t\t\t\t\tbreak;\n \t\t\t\tspec_len = optinfo-\u003eopts[temp] \u0026 0x00FF;\n \n-\t\t\t\tif (spec_len != 0x00FF \u0026\u0026 spec_len != *lp) {\n-\t\t\t\t\tpr_debug(\"Lbad %02X %04X\\n\", *lp,\n-\t\t\t\t\t\t spec_len);\n+\t\t\t\tif (spec_len != 0x00FF \u0026\u0026 spec_len != *lp)\n \t\t\t\t\treturn false;\n-\t\t\t\t}\n-\t\t\t\tpr_debug(\"Lok \");\n+\n \t\t\t\toptlen = *lp + 2;\n \t\t\t} else {\n-\t\t\t\tpr_debug(\"Pad1\\n\");\n \t\t\t\toptlen = 1;\n \t\t\t}\n \n-\t\t\t/* Step to the next */\n-\t\t\tpr_debug(\"len%04X\\n\", optlen);\n-\n \t\t\tif ((ptr \u003e skb-\u003elen - optlen || hdrlen \u003c optlen) \u0026\u0026\n-\t\t\t temp \u003c optinfo-\u003eoptsnr - 1) {\n-\t\t\t\tpr_debug(\"new pointer is too large!\\n\");\n+\t\t\t temp \u003c optinfo-\u003eoptsnr - 1)\n \t\t\t\tbreak;\n-\t\t\t}\n+\n \t\t\tptr += optlen;\n \t\t\thdrlen -= optlen;\n \t\t}\n@@ -166,16 +144,16 @@ static int hbh_mt6_check(const struct xt_mtchk_param *par)\n \tconst struct ip6t_opts *optsinfo = par-\u003ematchinfo;\n \n \tif (optsinfo-\u003einvflags \u0026 ~IP6T_OPTS_INV_MASK) {\n-\t\tpr_debug(\"unknown flags %X\\n\", optsinfo-\u003einvflags);\n+\t\tpr_info_ratelimited(\"unknown flags %X\\n\", optsinfo-\u003einvflags);\n \t\treturn -EINVAL;\n \t}\n \tif (optsinfo-\u003eoptsnr \u003e IP6T_OPTS_OPTSNR) {\n-\t\tpr_debug(\"too many supported opts specified\\n\");\n+\t\tpr_info_ratelimited(\"too many supported opts specified\\n\");\n \t\treturn -EINVAL;\n \t}\n \n \tif (optsinfo-\u003eflags \u0026 IP6T_OPTS_NSTRICT) {\n-\t\tpr_debug(\"Not strict - not implemented\");\n+\t\tpr_info_ratelimited(\"Not strict - not implemented\");\n \t\treturn -EINVAL;\n \t}\n \ndiff --git a/net/ipv6/netfilter/ip6t_mh.c b/net/ipv6/netfilter/ip6t_mh.c\nindex fd492b69acbc0..ba6dcc7791a09 100644\n--- a/net/ipv6/netfilter/ip6t_mh.c\n+++ b/net/ipv6/netfilter/ip6t_mh.c\n@@ -42,14 +42,11 @@ static bool mh_mt6(const struct sk_buff *skb, struct xt_action_param *par)\n \tif (mh == NULL) {\n \t\t/* We've been asked to examine this packet, and we\n \t\t can't. Hence, no choice but to drop. */\n-\t\tpr_debug(\"Dropping evil MH tinygram.\\n\");\n \t\tpar-\u003ehotdrop = true;\n \t\treturn false;\n \t}\n \n \tif (mh-\u003eip6mh_proto != IPPROTO_NONE) {\n-\t\tpr_debug(\"Dropping invalid MH Payload Proto: %u\\n\",\n-\t\t\t mh-\u003eip6mh_proto);\n \t\tpar-\u003ehotdrop = true;\n \t\treturn false;\n \t}\ndiff --git a/net/ipv6/netfilter/ip6t_rt.c b/net/ipv6/netfilter/ip6t_rt.c\nindex 278b52752f364..0c01ac2746d1f 100644\n--- a/net/ipv6/netfilter/ip6t_rt.c\n+++ b/net/ipv6/netfilter/ip6t_rt.c\n@@ -155,18 +155,18 @@ static int rt_mt6_check(const struct xt_mtchk_param *par)\n \tconst struct ip6t_rt *rtinfo = par-\u003ematchinfo;\n \n \tif (rtinfo-\u003einvflags \u0026 ~IP6T_RT_INV_MASK) {\n-\t\tpr_debug(\"unknown flags %X\\n\", rtinfo-\u003einvflags);\n+\t\tpr_info_ratelimited(\"unknown flags %X\\n\", rtinfo-\u003einvflags);\n \t\treturn -EINVAL;\n \t}\n \tif (rtinfo-\u003eaddrnr \u003e IP6T_RT_HOPS) {\n-\t\tpr_debug(\"too many addresses specified\\n\");\n+\t\tpr_info_ratelimited(\"too many addresses specified\\n\");\n \t\treturn -EINVAL;\n \t}\n \tif ((rtinfo-\u003eflags \u0026 (IP6T_RT_RES | IP6T_RT_FST_MASK)) \u0026\u0026\n \t (!(rtinfo-\u003eflags \u0026 IP6T_RT_TYP) ||\n \t (rtinfo-\u003ert_type != 0) ||\n \t (rtinfo-\u003einvflags \u0026 IP6T_RT_INV_TYP))) {\n-\t\tpr_debug(\"`--rt-type 0' required before `--rt-0-*'\");\n+\t\tpr_info_ratelimited(\"`--rt-type 0' required before `--rt-0-*'\");\n \t\treturn -EINVAL;\n \t}\n \ndiff --git a/net/ipv6/netfilter/nf_tproxy_ipv6.c b/net/ipv6/netfilter/nf_tproxy_ipv6.c\nindex b2f59ed9d7cc0..12ec36a6be2e1 100644\n--- a/net/ipv6/netfilter/nf_tproxy_ipv6.c\n+++ b/net/ipv6/netfilter/nf_tproxy_ipv6.c\n@@ -136,7 +136,7 @@ nf_tproxy_get_sock_v6(struct net *net, struct sk_buff *skb, int thoff,\n \t\t}\n \t\tbreak;\n \tdefault:\n-\t\tWARN_ON(1);\n+\t\tDEBUG_NET_WARN_ON_ONCE(1);\n \t\tsk = NULL;\n \t}\n \ndiff --git a/net/netfilter/nf_conncount.c b/net/netfilter/nf_conncount.c\nindex 85487f92af506..4292c3d9addde 100644\n--- a/net/netfilter/nf_conncount.c\n+++ b/net/netfilter/nf_conncount.c\n@@ -251,7 +251,8 @@ static int __nf_conncount_add(struct net *net,\n \tlist-\u003elast_gc_count = list-\u003ecount;\n \n add_new_node:\n-\tif (WARN_ON_ONCE(list-\u003ecount \u003e INT_MAX)) {\n+\tif (unlikely(list-\u003ecount \u003e INT_MAX)) {\n+\t\tDEBUG_NET_WARN_ON_ONCE(1);\n \t\terr = -EOVERFLOW;\n \t\tgoto out_put;\n \t}\ndiff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c\nindex c112ecc4fca32..5cee9e46cca4b 100644\n--- a/net/netfilter/nf_tables_api.c\n+++ b/net/netfilter/nf_tables_api.c\n@@ -1978,7 +1978,7 @@ static int nft_dump_stats(struct sk_buff *skb, struct nft_stats __percpu *stats)\n \treturn -ENOSPC;\n }\n \n-static bool hook_is_prefix(struct nft_hook *hook)\n+static bool hook_is_prefix(const struct nft_hook *hook)\n {\n \treturn strlen(hook-\u003eifname) \u003e= hook-\u003eifnamelen;\n }\n@@ -2445,8 +2445,11 @@ static struct nft_hook *nft_hook_list_find(struct list_head *hook_list,\n \tstruct nft_hook *hook;\n \n \tlist_for_each_entry(hook, hook_list, list) {\n-\t\tif (!strncmp(hook-\u003eifname, this-\u003eifname,\n-\t\t\t min(hook-\u003eifnamelen, this-\u003eifnamelen))) {\n+\t\tif (hook_is_prefix(hook) != hook_is_prefix(this))\n+\t\t\tcontinue;\n+\t\tif (hook-\u003eifnamelen != this-\u003eifnamelen)\n+\t\t\tcontinue;\n+\t\tif (!strncmp(hook-\u003eifname, this-\u003eifname, hook-\u003eifnamelen)) {\n \t\t\tif (hook-\u003eflags \u0026 NFT_HOOK_REMOVE)\n \t\t\t\tcontinue;\n \n@@ -6921,39 +6924,11 @@ static void nft_trans_elems_destroy(const struct nft_ctx *ctx,\n \t\tnf_tables_set_elem_destroy(ctx, te-\u003eset, te-\u003eelems[i].priv);\n }\n \n-int nft_set_elem_expr_clone(const struct nft_ctx *ctx, struct nft_set *set,\n-\t\t\t struct nft_expr *expr_array[])\n-{\n-\tstruct nft_expr *expr;\n-\tint err, i, k;\n-\n-\tfor (i = 0; i \u003c set-\u003enum_exprs; i++) {\n-\t\texpr = kzalloc(set-\u003eexprs[i]-\u003eops-\u003esize, GFP_KERNEL_ACCOUNT);\n-\t\tif (!expr)\n-\t\t\tgoto err_expr;\n-\n-\t\terr = nft_expr_clone(expr, set-\u003eexprs[i], GFP_KERNEL_ACCOUNT);\n-\t\tif (err \u003c 0) {\n-\t\t\tkfree(expr);\n-\t\t\tgoto err_expr;\n-\t\t}\n-\t\texpr_array[i] = expr;\n-\t}\n-\n-\treturn 0;\n-\n-err_expr:\n-\tfor (k = i - 1; k \u003e= 0; k--)\n-\t\tnft_expr_destroy(ctx, expr_array[k]);\n-\n-\treturn -ENOMEM;\n-}\n-\n static int nft_set_elem_expr_setup(struct nft_ctx *ctx,\n \t\t\t\t const struct nft_set_ext_tmpl *tmpl,\n \t\t\t\t const struct nft_set_ext *ext,\n \t\t\t\t struct nft_expr *expr_array[],\n-\t\t\t\t u32 num_exprs)\n+\t\t\t\t u32 num_exprs, bool override_exprs)\n {\n \tstruct nft_set_elem_expr *elem_expr = nft_set_ext_expr(ext);\n \tu32 len = sizeof(struct nft_set_elem_expr);\n@@ -6976,7 +6951,8 @@ static int nft_set_elem_expr_setup(struct nft_ctx *ctx,\n \t\t\tgoto err_elem_expr_setup;\n \n \t\telem_expr-\u003esize += expr_array[i]-\u003eops-\u003esize;\n-\t\tnft_expr_destroy(ctx, expr_array[i]);\n+\t\tif (override_exprs)\n+\t\t\tnft_expr_destroy(ctx, expr_array[i]);\n \t\texpr_array[i] = NULL;\n \t}\n \n@@ -6984,7 +6960,9 @@ static int nft_set_elem_expr_setup(struct nft_ctx *ctx,\n \n err_elem_expr_setup:\n \tfor (; i \u003c num_exprs; i++) {\n-\t\tnft_expr_destroy(ctx, expr_array[i]);\n+\t\tif (override_exprs)\n+\t\t\tnft_expr_destroy(ctx, expr_array[i]);\n+\n \t\texpr_array[i] = NULL;\n \t}\n \n@@ -7280,6 +7258,7 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,\n \tstruct nft_set_binding *binding;\n \tstruct nft_elem_priv *elem_priv;\n \tstruct nft_object *obj = NULL;\n+\tbool override_exprs = false;\n \tstruct nft_userdata *udata;\n \tstruct nft_data_desc desc;\n \tenum nft_registers dreg;\n@@ -7385,6 +7364,7 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,\n \n \t\texpr_array[0] = expr;\n \t\tnum_exprs = 1;\n+\t\toverride_exprs = true;\n \n \t\tif (set-\u003enum_exprs \u0026\u0026 set-\u003eexprs[0]-\u003eops != expr-\u003eops) {\n \t\t\terr = -EOPNOTSUPP;\n@@ -7413,6 +7393,7 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,\n \t\t\t}\n \t\t\texpr_array[i] = expr;\n \t\t\tnum_exprs++;\n+\t\t\toverride_exprs = true;\n \n \t\t\tif (set-\u003enum_exprs \u0026\u0026 expr-\u003eops != set-\u003eexprs[i]-\u003eops) {\n \t\t\t\terr = -EOPNOTSUPP;\n@@ -7426,9 +7407,8 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,\n \t\t}\n \t} else if (set-\u003enum_exprs \u003e 0 \u0026\u0026\n \t\t !(flags \u0026 NFT_SET_ELEM_INTERVAL_END)) {\n-\t\terr = nft_set_elem_expr_clone(ctx, set, expr_array);\n-\t\tif (err \u003c 0)\n-\t\t\tgoto err_set_elem_expr_clone;\n+\t\tfor (i = 0; i \u003c set-\u003enum_exprs; i++)\n+\t\t\texpr_array[i] = set-\u003eexprs[i];\n \n \t\tnum_exprs = set-\u003enum_exprs;\n \t}\n@@ -7567,7 +7547,8 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,\n \t\tudata-\u003elen = ulen - 1;\n \t\tnla_memcpy(\u0026udata-\u003edata, nla[NFTA_SET_ELEM_USERDATA], ulen);\n \t}\n-\terr = nft_set_elem_expr_setup(ctx, \u0026tmpl, ext, expr_array, num_exprs);\n+\terr = nft_set_elem_expr_setup(ctx, \u0026tmpl, ext, expr_array, num_exprs,\n+\t\t\t\t override_exprs);\n \tif (err \u003c 0)\n \t\tgoto err_elem_free;\n \n@@ -7675,9 +7656,11 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,\n err_parse_key:\n \tnft_data_release(\u0026elem.key.val, NFT_DATA_VALUE);\n err_set_elem_expr:\n-\tfor (i = 0; i \u003c num_exprs \u0026\u0026 expr_array[i]; i++)\n-\t\tnft_expr_destroy(ctx, expr_array[i]);\n-err_set_elem_expr_clone:\n+\tif (override_exprs) {\n+\t\tfor (i = 0; i \u003c num_exprs \u0026\u0026 expr_array[i]; i++)\n+\t\t\tnft_expr_destroy(ctx, expr_array[i]);\n+\t}\n+\n \treturn err;\n }\n \n@@ -10894,6 +10877,10 @@ static void nft_set_commit_update(struct nft_ctx *ctx,\n \t\tnft_ctx_update(ctx, trans);\n \n \t\tswitch (trans-\u003emsg_type) {\n+\t\tcase NFT_MSG_DELSET:\n+\t\tcase NFT_MSG_DESTROYSET:\n+\t\t\tnft_trans_set(trans)-\u003edead = 1;\n+\t\t\tbreak;\n \t\tcase NFT_MSG_DELSETELEM:\n \t\t\tte = nft_trans_container_elem(trans);\n \t\t\tif (!te-\u003eset-\u003eops-\u003ecommit)\n@@ -10982,10 +10969,6 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb)\n \t\treturn -EAGAIN;\n \t}\n \n-\terr = nft_flow_rule_offload_commit(net);\n-\tif (err \u003c 0)\n-\t\treturn err;\n-\n \t/* 1. Allocate space for next generation rules_gen_X[] */\n \tlist_for_each_entry_safe(trans, next, \u0026nft_net-\u003ecommit_list, list) {\n \t\tstruct nft_table *table = trans-\u003etable;\n@@ -11010,6 +10993,16 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb)\n \t\t}\n \t}\n \n+\t/* must be last, so audit and chain blob set up does not leave hardware\n+\t * in consistent state.\n+\t */\n+\terr = nft_flow_rule_offload_commit(net);\n+\tif (err \u003c 0) {\n+\t\tnf_tables_commit_chain_prepare_cancel(net);\n+\t\tnf_tables_commit_audit_free(\u0026adl);\n+\t\treturn err;\n+\t}\n+\n \t/* step 2. Make rules_gen_X visible to packet path */\n \tnft_set_commit_update(\u0026ctx, nft_net);\n \n@@ -11305,7 +11298,6 @@ static int __nf_tables_abort(struct net *net, enum nfnl_abort_action action)\n {\n \tstruct nftables_pernet *nft_net = nft_pernet(net);\n \tstruct nft_trans *trans, *next;\n-\tLIST_HEAD(set_update_list);\n \tstruct nft_trans_elem *te;\n \tstruct nft_ctx ctx = {\n \t\t.net = net,\ndiff --git a/net/netfilter/nft_dynset.c b/net/netfilter/nft_dynset.c\nindex ee9d3e7b1ecf1..fa4da694e92d8 100644\n--- a/net/netfilter/nft_dynset.c\n+++ b/net/netfilter/nft_dynset.c\n@@ -19,7 +19,8 @@ struct nft_dynset {\n \tu8\t\t\t\tsreg_key;\n \tu8\t\t\t\tsreg_data;\n \tbool\t\t\t\tinvert;\n-\tbool\t\t\t\texpr;\n+\tbool\t\t\t\texpr:1,\n+\t\t\t\t\toverride_exprs:1;\n \tu8\t\t\t\tnum_exprs;\n \tu64\t\t\t\ttimeout;\n \tstruct nft_expr\t\t\t*expr_array[NFT_SET_EXPR_MAX];\n@@ -257,6 +258,7 @@ static int nft_dynset_init(const struct nft_ctx *ctx,\n \n \t\tpriv-\u003enum_exprs++;\n \t\tpriv-\u003eexpr_array[0] = dynset_expr;\n+\t\tpriv-\u003eoverride_exprs = true;\n \n \t\tif (set-\u003enum_exprs \u003e 1 ||\n \t\t (set-\u003enum_exprs == 1 \u0026\u0026\n@@ -289,6 +291,7 @@ static int nft_dynset_init(const struct nft_ctx *ctx,\n \t\t\t}\n \t\t\tpriv-\u003eexpr_array[i] = dynset_expr;\n \t\t\tpriv-\u003enum_exprs++;\n+\t\t\tpriv-\u003eoverride_exprs = true;\n \n \t\t\tif (set-\u003enum_exprs) {\n \t\t\t\tif (i \u003e= set-\u003enum_exprs) {\n@@ -307,9 +310,8 @@ static int nft_dynset_init(const struct nft_ctx *ctx,\n \t\t\tgoto err_expr_free;\n \t\t}\n \t} else if (set-\u003enum_exprs \u003e 0) {\n-\t\terr = nft_set_elem_expr_clone(ctx, set, priv-\u003eexpr_array);\n-\t\tif (err \u003c 0)\n-\t\t\treturn err;\n+\t\tfor (i = 0; i \u003c set-\u003enum_exprs; i++)\n+\t\t\tpriv-\u003eexpr_array[i] = set-\u003eexprs[i];\n \n \t\tpriv-\u003enum_exprs = set-\u003enum_exprs;\n \t}\n@@ -339,8 +341,10 @@ static int nft_dynset_init(const struct nft_ctx *ctx,\n \treturn 0;\n \n err_expr_free:\n-\tfor (i = 0; i \u003c priv-\u003enum_exprs; i++)\n-\t\tnft_expr_destroy(ctx, priv-\u003eexpr_array[i]);\n+\tif (priv-\u003eoverride_exprs) {\n+\t\tfor (i = 0; i \u003c priv-\u003enum_exprs; i++)\n+\t\t\tnft_expr_destroy(ctx, priv-\u003eexpr_array[i]);\n+\t}\n \treturn err;\n }\n \n@@ -367,9 +371,10 @@ static void nft_dynset_destroy(const struct nft_ctx *ctx,\n \tstruct nft_dynset *priv = nft_expr_priv(expr);\n \tint i;\n \n-\tfor (i = 0; i \u003c priv-\u003enum_exprs; i++)\n-\t\tnft_expr_destroy(ctx, priv-\u003eexpr_array[i]);\n-\n+\tif (priv-\u003eoverride_exprs) {\n+\t\tfor (i = 0; i \u003c priv-\u003enum_exprs; i++)\n+\t\t\tnft_expr_destroy(ctx, priv-\u003eexpr_array[i]);\n+\t}\n \tnf_tables_destroy_set(ctx, priv-\u003eset);\n }\n \n@@ -393,7 +398,7 @@ static int nft_dynset_dump(struct sk_buff *skb,\n \t\t\t nf_jiffies64_to_msecs(priv-\u003etimeout),\n \t\t\t NFTA_DYNSET_PAD))\n \t\tgoto nla_put_failure;\n-\tif (priv-\u003eset-\u003enum_exprs == 0) {\n+\tif (priv-\u003eset-\u003enum_exprs == 0 || priv-\u003eoverride_exprs) {\n \t\tif (priv-\u003enum_exprs == 1) {\n \t\t\tif (nft_expr_dump(skb, NFTA_DYNSET_EXPR,\n \t\t\t\t\t priv-\u003eexpr_array[0], reset))\ndiff --git a/net/netfilter/nft_set_pipapo_avx2.c b/net/netfilter/nft_set_pipapo_avx2.c\nindex b3f105520a85b..21f5be68c7036 100644\n--- a/net/netfilter/nft_set_pipapo_avx2.c\n+++ b/net/netfilter/nft_set_pipapo_avx2.c\n@@ -1134,6 +1134,7 @@ struct nft_pipapo_elem *pipapo_get_avx2(const struct nft_pipapo_match *m,\n \tstruct nft_pipapo_scratch *scratch;\n \tconst struct nft_pipapo_field *f;\n \tunsigned long *res, *fill, *map;\n+\tstruct nft_pipapo_elem *e;\n \tbool map_index;\n \tint ret = 0;\n \tint i;\n@@ -1207,14 +1208,11 @@ struct nft_pipapo_elem *pipapo_get_avx2(const struct nft_pipapo_match *m,\n next_match:\n \t\tif (ret \u003c 0) {\n \t\t\tscratch-\u003emap_index = map_index;\n-\t\t\tkernel_fpu_end();\n-\t\t\t__local_unlock_nested_bh(\u0026scratch-\u003ebh_lock);\n-\t\t\treturn NULL;\n+\t\t\te = NULL;\n+\t\t\tgoto out;\n \t\t}\n \n \t\tif (last) {\n-\t\t\tstruct nft_pipapo_elem *e;\n-\n \t\t\te = f-\u003emt[ret].e;\n \t\t\tif (unlikely(__nft_set_elem_expired(\u0026e-\u003eext, tstamp) ||\n \t\t\t\t !nft_set_elem_active(\u0026e-\u003eext, genmask))) {\n@@ -1224,9 +1222,7 @@ struct nft_pipapo_elem *pipapo_get_avx2(const struct nft_pipapo_match *m,\n \t\t\t}\n \n \t\t\tscratch-\u003emap_index = map_index;\n-\t\t\tkernel_fpu_end();\n-\t\t\t__local_unlock_nested_bh(\u0026scratch-\u003ebh_lock);\n-\t\t\treturn e;\n+\t\t\tgoto out;\n \t\t}\n \n \t\tmap_index = !map_index;\n@@ -1234,9 +1230,12 @@ struct nft_pipapo_elem *pipapo_get_avx2(const struct nft_pipapo_match *m,\n \t\tdata += NFT_PIPAPO_GROUPS_PADDED_SIZE(f);\n \t}\n \n+\te = NULL;\n+out:\n+\tasm volatile(\"vzeroupper\");\n \tkernel_fpu_end();\n \t__local_unlock_nested_bh(\u0026scratch-\u003ebh_lock);\n-\treturn NULL;\n+\treturn e;\n }\n \n /**\ndiff --git a/net/netfilter/xt_IDLETIMER.c b/net/netfilter/xt_IDLETIMER.c\nindex bfcf2d44e93db..15b698ea98aa6 100644\n--- a/net/netfilter/xt_IDLETIMER.c\n+++ b/net/netfilter/xt_IDLETIMER.c\n@@ -102,8 +102,6 @@ static void idletimer_tg_expired(struct timer_list *t)\n {\n \tstruct idletimer_tg *timer = timer_container_of(timer, t, timer);\n \n-\tpr_debug(\"timer %s expired\\n\", timer-\u003eattr.attr.name);\n-\n \tschedule_work(\u0026timer-\u003ework);\n }\n \n@@ -111,7 +109,6 @@ static void idletimer_tg_alarmproc(struct alarm *alarm, ktime_t now)\n {\n \tstruct idletimer_tg *timer = alarm-\u003edata;\n \n-\tpr_debug(\"alarm %s expired\\n\", timer-\u003eattr.attr.name);\n \tschedule_work(\u0026timer-\u003ework);\n }\n \n@@ -171,7 +168,7 @@ static int idletimer_tg_create(struct idletimer_tg_info *info)\n \n \tret = sysfs_create_file(idletimer_tg_kobj, \u0026info-\u003etimer-\u003eattr.attr);\n \tif (ret \u003c 0) {\n-\t\tpr_debug(\"couldn't add file to sysfs\");\n+\t\tpr_info_ratelimited(\"couldn't add file to sysfs\");\n \t\tgoto out_free_attr;\n \t}\n \n@@ -220,7 +217,7 @@ static int idletimer_tg_create_v1(struct idletimer_tg_info_v1 *info)\n \n \tret = sysfs_create_file(idletimer_tg_kobj, \u0026info-\u003etimer-\u003eattr.attr);\n \tif (ret \u003c 0) {\n-\t\tpr_debug(\"couldn't add file to sysfs\");\n+\t\tpr_info_ratelimited(\"couldn't add file to sysfs\");\n \t\tgoto out_free_attr;\n \t}\n \n@@ -228,7 +225,6 @@ static int idletimer_tg_create_v1(struct idletimer_tg_info_v1 *info)\n \tkobject_uevent(idletimer_tg_kobj,KOBJ_ADD);\n \n \tlist_add(\u0026info-\u003etimer-\u003eentry, \u0026idletimer_tg_list);\n-\tpr_debug(\"timer type value is %u\", info-\u003etimer_type);\n \tinfo-\u003etimer-\u003etimer_type = info-\u003etimer_type;\n \tinfo-\u003etimer-\u003erefcnt = 1;\n \n@@ -263,9 +259,6 @@ static unsigned int idletimer_tg_target(struct sk_buff *skb,\n {\n \tconst struct idletimer_tg_info *info = par-\u003etarginfo;\n \n-\tpr_debug(\"resetting timer %s, timeout period %u\\n\",\n-\t\t info-\u003elabel, info-\u003etimeout);\n-\n \tmod_timer(\u0026info-\u003etimer-\u003etimer,\n \t\t secs_to_jiffies(info-\u003etimeout) + jiffies);\n \n@@ -280,9 +273,6 @@ static unsigned int idletimer_tg_target_v1(struct sk_buff *skb,\n {\n \tconst struct idletimer_tg_info_v1 *info = par-\u003etarginfo;\n \n-\tpr_debug(\"resetting timer %s, timeout period %u\\n\",\n-\t\t info-\u003elabel, info-\u003etimeout);\n-\n \tif (info-\u003etimer-\u003etimer_type \u0026 XT_IDLETIMER_ALARM) {\n \t\tidletimer_start_alarm_sec(info-\u003etimer, info-\u003etimeout);\n \t} else {\n@@ -296,17 +286,17 @@ static unsigned int idletimer_tg_target_v1(struct sk_buff *skb,\n static int idletimer_tg_helper(struct idletimer_tg_info *info)\n {\n \tif (info-\u003etimeout == 0) {\n-\t\tpr_debug(\"timeout value is zero\\n\");\n+\t\tpr_info_ratelimited(\"timeout value is zero\\n\");\n \t\treturn -EINVAL;\n \t}\n \tif (info-\u003etimeout \u003e= INT_MAX / 1000) {\n-\t\tpr_debug(\"timeout value is too big\\n\");\n+\t\tpr_info_ratelimited(\"timeout value is too big\\n\");\n \t\treturn -EINVAL;\n \t}\n \tif (info-\u003elabel[0] == '\\0' ||\n \t strnlen(info-\u003elabel,\n \t\t MAX_IDLETIMER_LABEL_SIZE) == MAX_IDLETIMER_LABEL_SIZE) {\n-\t\tpr_debug(\"label is empty or not nul-terminated\\n\");\n+\t\tpr_info_ratelimited(\"label is empty or not nul-terminated\\n\");\n \t\treturn -EINVAL;\n \t}\n \treturn 0;\n@@ -318,34 +308,25 @@ static int idletimer_tg_checkentry(const struct xt_tgchk_param *par)\n \tstruct idletimer_tg_info *info = par-\u003etarginfo;\n \tint ret;\n \n-\tpr_debug(\"checkentry targinfo%s\\n\", info-\u003elabel);\n-\n \tret = idletimer_tg_helper(info);\n \tif(ret \u003c 0)\n-\t{\n-\t\tpr_debug(\"checkentry helper return invalid\\n\");\n \t\treturn -EINVAL;\n-\t}\n \tmutex_lock(\u0026list_mutex);\n \n \tinfo-\u003etimer = __idletimer_tg_find_by_label(info-\u003elabel);\n \tif (info-\u003etimer) {\n \t\tif (info-\u003etimer-\u003etimer_type \u0026 XT_IDLETIMER_ALARM) {\n-\t\t\tpr_debug(\"Adding/Replacing rule with same label and different timer type is not allowed\\n\");\n \t\t\tmutex_unlock(\u0026list_mutex);\n+\t\t\tpr_info_ratelimited(\"Adding/Replacing rule with same label and different timer type is not allowed\\n\");\n \t\t\treturn -EINVAL;\n \t\t}\n \n \t\tinfo-\u003etimer-\u003erefcnt++;\n \t\tmod_timer(\u0026info-\u003etimer-\u003etimer,\n \t\t\t secs_to_jiffies(info-\u003etimeout) + jiffies);\n-\n-\t\tpr_debug(\"increased refcnt of timer %s to %u\\n\",\n-\t\t\t info-\u003elabel, info-\u003etimer-\u003erefcnt);\n \t} else {\n \t\tret = idletimer_tg_create(info);\n \t\tif (ret \u003c 0) {\n-\t\t\tpr_debug(\"failed to create timer\\n\");\n \t\t\tmutex_unlock(\u0026list_mutex);\n \t\t\treturn ret;\n \t\t}\n@@ -360,30 +341,23 @@ static int idletimer_tg_checkentry_v1(const struct xt_tgchk_param *par)\n \tstruct idletimer_tg_info_v1 *info = par-\u003etarginfo;\n \tint ret;\n \n-\tpr_debug(\"checkentry targinfo%s\\n\", info-\u003elabel);\n-\n \tif (info-\u003esend_nl_msg)\n \t\treturn -EOPNOTSUPP;\n \n \tret = idletimer_tg_helper((struct idletimer_tg_info *)info);\n \tif(ret \u003c 0)\n-\t{\n-\t\tpr_debug(\"checkentry helper return invalid\\n\");\n \t\treturn -EINVAL;\n-\t}\n \n-\tif (info-\u003etimer_type \u003e XT_IDLETIMER_ALARM) {\n-\t\tpr_debug(\"invalid value for timer type\\n\");\n+\tif (info-\u003etimer_type \u003e XT_IDLETIMER_ALARM)\n \t\treturn -EINVAL;\n-\t}\n \n \tmutex_lock(\u0026list_mutex);\n \n \tinfo-\u003etimer = __idletimer_tg_find_by_label(info-\u003elabel);\n \tif (info-\u003etimer) {\n \t\tif (info-\u003etimer-\u003etimer_type != info-\u003etimer_type) {\n-\t\t\tpr_debug(\"Adding/Replacing rule with same label and different timer type is not allowed\\n\");\n \t\t\tmutex_unlock(\u0026list_mutex);\n+\t\t\tpr_info_ratelimited(\"Adding/Replacing rule with same label and different timer type is not allowed\\n\");\n \t\t\treturn -EINVAL;\n \t\t}\n \n@@ -393,21 +367,15 @@ static int idletimer_tg_checkentry_v1(const struct xt_tgchk_param *par)\n \t\t\tktime_t tout = alarm_expires_remaining(\u0026info-\u003etimer-\u003ealarm);\n \t\t\tstruct timespec64 ktimespec = ktime_to_timespec64(tout);\n \n-\t\t\tif (ktimespec.tv_sec \u003e 0) {\n-\t\t\t\tpr_debug(\"time_expiry_remaining %lld\\n\",\n-\t\t\t\t\t ktimespec.tv_sec);\n+\t\t\tif (ktimespec.tv_sec \u003e 0)\n \t\t\t\tidletimer_start_alarm_ktime(info-\u003etimer, tout);\n-\t\t\t}\n \t\t} else {\n \t\t\t\tmod_timer(\u0026info-\u003etimer-\u003etimer,\n \t\t\t\t\tsecs_to_jiffies(info-\u003etimeout) + jiffies);\n \t\t}\n-\t\tpr_debug(\"increased refcnt of timer %s to %u\\n\",\n-\t\t\t info-\u003elabel, info-\u003etimer-\u003erefcnt);\n \t} else {\n \t\tret = idletimer_tg_create_v1(info);\n \t\tif (ret \u003c 0) {\n-\t\t\tpr_debug(\"failed to create timer\\n\");\n \t\t\tmutex_unlock(\u0026list_mutex);\n \t\t\treturn ret;\n \t\t}\n@@ -421,19 +389,13 @@ static void idletimer_tg_destroy(const struct xt_tgdtor_param *par)\n {\n \tconst struct idletimer_tg_info *info = par-\u003etarginfo;\n \n-\tpr_debug(\"destroy targinfo %s\\n\", info-\u003elabel);\n-\n \tmutex_lock(\u0026list_mutex);\n \n \tif (--info-\u003etimer-\u003erefcnt \u003e 0) {\n-\t\tpr_debug(\"decreased refcnt of timer %s to %u\\n\",\n-\t\t\t info-\u003elabel, info-\u003etimer-\u003erefcnt);\n \t\tmutex_unlock(\u0026list_mutex);\n \t\treturn;\n \t}\n \n-\tpr_debug(\"deleting timer %s\\n\", info-\u003elabel);\n-\n \tlist_del(\u0026info-\u003etimer-\u003eentry);\n \tmutex_unlock(\u0026list_mutex);\n \n@@ -448,19 +410,13 @@ static void idletimer_tg_destroy_v1(const struct xt_tgdtor_param *par)\n {\n \tconst struct idletimer_tg_info_v1 *info = par-\u003etarginfo;\n \n-\tpr_debug(\"destroy targinfo %s\\n\", info-\u003elabel);\n-\n \tmutex_lock(\u0026list_mutex);\n \n \tif (--info-\u003etimer-\u003erefcnt \u003e 0) {\n-\t\tpr_debug(\"decreased refcnt of timer %s to %u\\n\",\n-\t\t\t info-\u003elabel, info-\u003etimer-\u003erefcnt);\n \t\tmutex_unlock(\u0026list_mutex);\n \t\treturn;\n \t}\n \n-\tpr_debug(\"deleting timer %s\\n\", info-\u003elabel);\n-\n \tlist_del(\u0026info-\u003etimer-\u003eentry);\n \tmutex_unlock(\u0026list_mutex);\n \n@@ -534,7 +490,7 @@ static int __init idletimer_tg_init(void)\n \tidletimer_tg_class = class_create(\"xt_idletimer\");\n \terr = PTR_ERR(idletimer_tg_class);\n \tif (IS_ERR(idletimer_tg_class)) {\n-\t\tpr_debug(\"couldn't register device class\\n\");\n+\t\tpr_info_ratelimited(\"couldn't register device class\\n\");\n \t\tgoto out;\n \t}\n \n@@ -542,7 +498,7 @@ static int __init idletimer_tg_init(void)\n \t\t\t\t\t MKDEV(0, 0), NULL, \"timers\");\n \terr = PTR_ERR(idletimer_tg_device);\n \tif (IS_ERR(idletimer_tg_device)) {\n-\t\tpr_debug(\"couldn't register system device\\n\");\n+\t\tpr_info_ratelimited(\"couldn't register system device\\n\");\n \t\tgoto out_class;\n \t}\n \n@@ -551,7 +507,7 @@ static int __init idletimer_tg_init(void)\n \terr = xt_register_targets(idletimer_tg, ARRAY_SIZE(idletimer_tg));\n \n \tif (err \u003c 0) {\n-\t\tpr_debug(\"couldn't register xt target\\n\");\n+\t\tpr_info_ratelimited(\"couldn't register xt target\\n\");\n \t\tgoto out_dev;\n \t}\n \ndiff --git a/net/netfilter/xt_LOG.c b/net/netfilter/xt_LOG.c\nindex f39244f9c0ed9..de3f176792a07 100644\n--- a/net/netfilter/xt_LOG.c\n+++ b/net/netfilter/xt_LOG.c\n@@ -50,12 +50,12 @@ static int log_tg_check(const struct xt_tgchk_param *par)\n \t\treturn -EINVAL;\n \n \tif (loginfo-\u003elevel \u003e= 8) {\n-\t\tpr_debug(\"level %u \u003e= 8\\n\", loginfo-\u003elevel);\n+\t\tpr_info_ratelimited(\"level %u \u003e= 8\\n\", loginfo-\u003elevel);\n \t\treturn -EINVAL;\n \t}\n \n \tif (loginfo-\u003eprefix[sizeof(loginfo-\u003eprefix)-1] != '\\0') {\n-\t\tpr_debug(\"prefix is not null-terminated\\n\");\n+\t\tpr_info_ratelimited(\"prefix is not null-terminated\\n\");\n \t\treturn -EINVAL;\n \t}\n \ndiff --git a/net/netfilter/xt_MASQUERADE.c b/net/netfilter/xt_MASQUERADE.c\nindex eae05c1783367..cea488cec5445 100644\n--- a/net/netfilter/xt_MASQUERADE.c\n+++ b/net/netfilter/xt_MASQUERADE.c\n@@ -21,11 +21,11 @@ static int masquerade_tg_check(const struct xt_tgchk_param *par)\n \tconst struct nf_nat_ipv4_multi_range_compat *mr = par-\u003etarginfo;\n \n \tif (mr-\u003erange[0].flags \u0026 NF_NAT_RANGE_MAP_IPS) {\n-\t\tpr_debug(\"bad MAP_IPS.\\n\");\n+\t\tpr_info_ratelimited(\"bad MAP_IPS.\\n\");\n \t\treturn -EINVAL;\n \t}\n \tif (mr-\u003erangesize != 1) {\n-\t\tpr_debug(\"bad rangesize %u\\n\", mr-\u003erangesize);\n+\t\tpr_info_ratelimited(\"bad rangesize %u\\n\", mr-\u003erangesize);\n \t\treturn -EINVAL;\n \t}\n \treturn nf_ct_netns_get(par-\u003enet, par-\u003efamily);\ndiff --git a/net/netfilter/xt_NETMAP.c b/net/netfilter/xt_NETMAP.c\nindex cb2ee80d84fa8..8c86d9a43373a 100644\n--- a/net/netfilter/xt_NETMAP.c\n+++ b/net/netfilter/xt_NETMAP.c\n@@ -106,11 +106,11 @@ static int netmap_tg4_check(const struct xt_tgchk_param *par)\n \tconst struct nf_nat_ipv4_multi_range_compat *mr = par-\u003etarginfo;\n \n \tif (!(mr-\u003erange[0].flags \u0026 NF_NAT_RANGE_MAP_IPS)) {\n-\t\tpr_debug(\"bad MAP_IPS.\\n\");\n+\t\tpr_info_ratelimited(\"bad MAP_IPS.\\n\");\n \t\treturn -EINVAL;\n \t}\n \tif (mr-\u003erangesize != 1) {\n-\t\tpr_debug(\"bad rangesize %u.\\n\", mr-\u003erangesize);\n+\t\tpr_info_ratelimited(\"bad rangesize %u.\\n\", mr-\u003erangesize);\n \t\treturn -EINVAL;\n \t}\n \treturn nf_ct_netns_get(par-\u003enet, par-\u003efamily);\ndiff --git a/net/netfilter/xt_REDIRECT.c b/net/netfilter/xt_REDIRECT.c\nindex ff66b56a3f97d..27bc0545c4f74 100644\n--- a/net/netfilter/xt_REDIRECT.c\n+++ b/net/netfilter/xt_REDIRECT.c\n@@ -51,11 +51,11 @@ static int redirect_tg4_check(const struct xt_tgchk_param *par)\n \tconst struct nf_nat_ipv4_multi_range_compat *mr = par-\u003etarginfo;\n \n \tif (mr-\u003erange[0].flags \u0026 NF_NAT_RANGE_MAP_IPS) {\n-\t\tpr_debug(\"bad MAP_IPS.\\n\");\n+\t\tpr_info_ratelimited(\"bad MAP_IPS.\\n\");\n \t\treturn -EINVAL;\n \t}\n \tif (mr-\u003erangesize != 1) {\n-\t\tpr_debug(\"bad rangesize %u.\\n\", mr-\u003erangesize);\n+\t\tpr_info_ratelimited(\"bad rangesize %u.\\n\", mr-\u003erangesize);\n \t\treturn -EINVAL;\n \t}\n \treturn nf_ct_netns_get(par-\u003enet, par-\u003efamily);\ndiff --git a/net/netfilter/xt_cgroup.c b/net/netfilter/xt_cgroup.c\nindex 43d2ae2be628d..ac1b7e71cd7f5 100644\n--- a/net/netfilter/xt_cgroup.c\n+++ b/net/netfilter/xt_cgroup.c\n@@ -33,7 +33,7 @@ static int cgroup_mt_check_v0(const struct xt_mtchk_param *par)\n \t\treturn -EINVAL;\n \n \tif (!IS_ENABLED(CONFIG_CGROUP_NET_CLASSID)) {\n-\t\tpr_info(NET_CLS_CLASSID_INVALID_MSG);\n+\t\tpr_info_ratelimited(NET_CLS_CLASSID_INVALID_MSG);\n \t\treturn -EINVAL;\n \t}\n \n@@ -49,7 +49,7 @@ static int cgroup_mt_check_v1(const struct xt_mtchk_param *par)\n \t\treturn -EINVAL;\n \n \tif (!info-\u003ehas_path \u0026\u0026 !info-\u003ehas_classid) {\n-\t\tpr_info(\"xt_cgroup: no path or classid specified\\n\");\n+\t\tpr_info_ratelimited(\"xt_cgroup: no path or classid specified\\n\");\n \t\treturn -EINVAL;\n \t}\n \n@@ -59,7 +59,7 @@ static int cgroup_mt_check_v1(const struct xt_mtchk_param *par)\n \t}\n \n \tif (info-\u003ehas_classid \u0026\u0026 !IS_ENABLED(CONFIG_CGROUP_NET_CLASSID)) {\n-\t\tpr_info(NET_CLS_CLASSID_INVALID_MSG);\n+\t\tpr_info_ratelimited(NET_CLS_CLASSID_INVALID_MSG);\n \t\treturn -EINVAL;\n \t}\n \n@@ -89,7 +89,7 @@ static int cgroup_mt_check_v2(const struct xt_mtchk_param *par)\n \t\treturn -EINVAL;\n \n \tif (!info-\u003ehas_path \u0026\u0026 !info-\u003ehas_classid) {\n-\t\tpr_info(\"xt_cgroup: no path or classid specified\\n\");\n+\t\tpr_info_ratelimited(\"xt_cgroup: no path or classid specified\\n\");\n \t\treturn -EINVAL;\n \t}\n \n@@ -99,7 +99,7 @@ static int cgroup_mt_check_v2(const struct xt_mtchk_param *par)\n \t}\n \n \tif (info-\u003ehas_classid \u0026\u0026 !IS_ENABLED(CONFIG_CGROUP_NET_CLASSID)) {\n-\t\tpr_info(NET_CLS_CLASSID_INVALID_MSG);\n+\t\tpr_info_ratelimited(NET_CLS_CLASSID_INVALID_MSG);\n \t\treturn -EINVAL;\n \t}\n \ndiff --git a/net/netfilter/xt_esp.c b/net/netfilter/xt_esp.c\nindex 2a1c0ad0ff079..68fd75884268a 100644\n--- a/net/netfilter/xt_esp.c\n+++ b/net/netfilter/xt_esp.c\n@@ -25,12 +25,7 @@ MODULE_ALIAS(\"ip6t_esp\");\n static inline bool\n spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, bool invert)\n {\n-\tbool r;\n-\tpr_debug(\"spi_match:%c 0x%x \u003c= 0x%x \u003c= 0x%x\\n\",\n-\t\t invert ? '!' : ' ', min, spi, max);\n-\tr = (spi \u003e= min \u0026\u0026 spi \u003c= max) ^ invert;\n-\tpr_debug(\" result %s\\n\", r ? \"PASS\" : \"FAILED\");\n-\treturn r;\n+\treturn (spi \u003e= min \u0026\u0026 spi \u003c= max) ^ invert;\n }\n \n static bool esp_mt(const struct sk_buff *skb, struct xt_action_param *par)\n@@ -48,7 +43,6 @@ static bool esp_mt(const struct sk_buff *skb, struct xt_action_param *par)\n \t\t/* We've been asked to examine this packet, and we\n \t\t * can't. Hence, no choice but to drop.\n \t\t */\n-\t\tpr_debug(\"Dropping evil ESP tinygram.\\n\");\n \t\tpar-\u003ehotdrop = true;\n \t\treturn false;\n \t}\n@@ -62,7 +56,7 @@ static int esp_mt_check(const struct xt_mtchk_param *par)\n \tconst struct xt_esp *espinfo = par-\u003ematchinfo;\n \n \tif (espinfo-\u003einvflags \u0026 ~XT_ESP_INV_MASK) {\n-\t\tpr_debug(\"unknown flags %X\\n\", espinfo-\u003einvflags);\n+\t\tpr_info_ratelimited(\"unknown flags %X\\n\", espinfo-\u003einvflags);\n \t\treturn -EINVAL;\n \t}\n \ndiff --git a/net/netfilter/xt_ipcomp.c b/net/netfilter/xt_ipcomp.c\nindex 472da639a32e2..3299c1ea60f9e 100644\n--- a/net/netfilter/xt_ipcomp.c\n+++ b/net/netfilter/xt_ipcomp.c\n@@ -29,12 +29,7 @@ MODULE_ALIAS(\"ip6t_ipcomp\");\n static inline bool\n spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, bool invert)\n {\n-\tbool r;\n-\tpr_debug(\"spi_match:%c 0x%x \u003c= 0x%x \u003c= 0x%x\\n\",\n-\t\t invert ? '!' : ' ', min, spi, max);\n-\tr = (spi \u003e= min \u0026\u0026 spi \u003c= max) ^ invert;\n-\tpr_debug(\" result %s\\n\", r ? \"PASS\" : \"FAILED\");\n-\treturn r;\n+\treturn (spi \u003e= min \u0026\u0026 spi \u003c= max) ^ invert;\n }\n \n static bool comp_mt(const struct sk_buff *skb, struct xt_action_param *par)\n@@ -52,7 +47,6 @@ static bool comp_mt(const struct sk_buff *skb, struct xt_action_param *par)\n \t\t/* We've been asked to examine this packet, and we\n \t\t * can't. Hence, no choice but to drop.\n \t\t */\n-\t\tpr_debug(\"Dropping evil IPComp tinygram.\\n\");\n \t\tpar-\u003ehotdrop = true;\n \t\treturn false;\n \t}\ndiff --git a/net/netfilter/xt_iprange.c b/net/netfilter/xt_iprange.c\nindex 0c9e014e30b49..bf61141fb7850 100644\n--- a/net/netfilter/xt_iprange.c\n+++ b/net/netfilter/xt_iprange.c\n@@ -24,27 +24,15 @@ iprange_mt4(const struct sk_buff *skb, struct xt_action_param *par)\n \t\tm = ntohl(iph-\u003esaddr) \u003c ntohl(info-\u003esrc_min.ip);\n \t\tm |= ntohl(iph-\u003esaddr) \u003e ntohl(info-\u003esrc_max.ip);\n \t\tm ^= !!(info-\u003eflags \u0026 IPRANGE_SRC_INV);\n-\t\tif (m) {\n-\t\t\tpr_debug(\"src IP %pI4 NOT in range %s%pI4-%pI4\\n\",\n-\t\t\t \u0026iph-\u003esaddr,\n-\t\t\t (info-\u003eflags \u0026 IPRANGE_SRC_INV) ? \"(INV) \" : \"\",\n-\t\t\t \u0026info-\u003esrc_min.ip,\n-\t\t\t \u0026info-\u003esrc_max.ip);\n+\t\tif (m)\n \t\t\treturn false;\n-\t\t}\n \t}\n \tif (info-\u003eflags \u0026 IPRANGE_DST) {\n \t\tm = ntohl(iph-\u003edaddr) \u003c ntohl(info-\u003edst_min.ip);\n \t\tm |= ntohl(iph-\u003edaddr) \u003e ntohl(info-\u003edst_max.ip);\n \t\tm ^= !!(info-\u003eflags \u0026 IPRANGE_DST_INV);\n-\t\tif (m) {\n-\t\t\tpr_debug(\"dst IP %pI4 NOT in range %s%pI4-%pI4\\n\",\n-\t\t\t \u0026iph-\u003edaddr,\n-\t\t\t (info-\u003eflags \u0026 IPRANGE_DST_INV) ? \"(INV) \" : \"\",\n-\t\t\t \u0026info-\u003edst_min.ip,\n-\t\t\t \u0026info-\u003edst_max.ip);\n+\t\tif (m)\n \t\t\treturn false;\n-\t\t}\n \t}\n \treturn true;\n }\n@@ -73,27 +61,15 @@ iprange_mt6(const struct sk_buff *skb, struct xt_action_param *par)\n \t\tm = iprange_ipv6_lt(\u0026iph-\u003esaddr, \u0026info-\u003esrc_min.in6);\n \t\tm |= iprange_ipv6_lt(\u0026info-\u003esrc_max.in6, \u0026iph-\u003esaddr);\n \t\tm ^= !!(info-\u003eflags \u0026 IPRANGE_SRC_INV);\n-\t\tif (m) {\n-\t\t\tpr_debug(\"src IP %pI6 NOT in range %s%pI6-%pI6\\n\",\n-\t\t\t\t \u0026iph-\u003esaddr,\n-\t\t\t\t (info-\u003eflags \u0026 IPRANGE_SRC_INV) ? \"(INV) \" : \"\",\n-\t\t\t\t \u0026info-\u003esrc_min.in6,\n-\t\t\t\t \u0026info-\u003esrc_max.in6);\n+\t\tif (m)\n \t\t\treturn false;\n-\t\t}\n \t}\n \tif (info-\u003eflags \u0026 IPRANGE_DST) {\n \t\tm = iprange_ipv6_lt(\u0026iph-\u003edaddr, \u0026info-\u003edst_min.in6);\n \t\tm |= iprange_ipv6_lt(\u0026info-\u003edst_max.in6, \u0026iph-\u003edaddr);\n \t\tm ^= !!(info-\u003eflags \u0026 IPRANGE_DST_INV);\n-\t\tif (m) {\n-\t\t\tpr_debug(\"dst IP %pI6 NOT in range %s%pI6-%pI6\\n\",\n-\t\t\t\t \u0026iph-\u003edaddr,\n-\t\t\t\t (info-\u003eflags \u0026 IPRANGE_DST_INV) ? \"(INV) \" : \"\",\n-\t\t\t\t \u0026info-\u003edst_min.in6,\n-\t\t\t\t \u0026info-\u003edst_max.in6);\n+\t\tif (m)\n \t\t\treturn false;\n-\t\t}\n \t}\n \treturn true;\n }\ndiff --git a/net/netfilter/xt_ipvs.c b/net/netfilter/xt_ipvs.c\nindex 253c71cc9a634..e13c0ffb73a9a 100644\n--- a/net/netfilter/xt_ipvs.c\n+++ b/net/netfilter/xt_ipvs.c\n@@ -148,7 +148,6 @@ ipvs_mt(const struct sk_buff *skb, struct xt_action_param *par)\n out_put_cp:\n \t__ip_vs_conn_put(cp);\n out:\n-\tpr_debug(\"match=%d\\n\", match);\n \treturn match;\n }\n \ndiff --git a/net/netfilter/xt_multiport.c b/net/netfilter/xt_multiport.c\nindex a1691ff405d3c..bff5f53a9befb 100644\n--- a/net/netfilter/xt_multiport.c\n+++ b/net/netfilter/xt_multiport.c\n@@ -37,7 +37,6 @@ ports_match_v1(const struct xt_multiport_v1 *minfo,\n \t\tif (minfo-\u003epflags[i]) {\n \t\t\t/* range port matching */\n \t\t\te = minfo-\u003eports[++i];\n-\t\t\tpr_debug(\"src or dst matches with %d-%d?\\n\", s, e);\n \n \t\t\tswitch (minfo-\u003eflags) {\n \t\t\tcase XT_MULTIPORT_SOURCE:\n@@ -58,8 +57,6 @@ ports_match_v1(const struct xt_multiport_v1 *minfo,\n \t\t\t}\n \t\t} else {\n \t\t\t/* exact port matching */\n-\t\t\tpr_debug(\"src or dst matches with %d?\\n\", s);\n-\n \t\t\tswitch (minfo-\u003eflags) {\n \t\t\tcase XT_MULTIPORT_SOURCE:\n \t\t\t\tif (src == s)\n@@ -97,7 +94,6 @@ multiport_mt(const struct sk_buff *skb, struct xt_action_param *par)\n \t\t/* We've been asked to examine this packet, and we\n \t\t * can't. Hence, no choice but to drop.\n \t\t */\n-\t\tpr_debug(\"Dropping evil offset=0 tinygram.\\n\");\n \t\tpar-\u003ehotdrop = true;\n \t\treturn false;\n \t}\ndiff --git a/net/netfilter/xt_sctp.c b/net/netfilter/xt_sctp.c\nindex b46a6a5120583..d35c21d9651b0 100644\n--- a/net/netfilter/xt_sctp.c\n+++ b/net/netfilter/xt_sctp.c\n@@ -48,30 +48,17 @@ match_packet(const struct sk_buff *skb,\n \tconst struct xt_sctp_flag_info *flag_info = info-\u003eflag_info;\n \tint flag_count = info-\u003eflag_count;\n \n-#ifdef DEBUG\n-\tint i = 0;\n-#endif\n-\n \tif (chunk_match_type == SCTP_CHUNK_MATCH_ALL)\n \t\tSCTP_CHUNKMAP_COPY(chunkmapcopy, info-\u003echunkmap);\n \n \tdo {\n \t\tsch = skb_header_pointer(skb, offset, sizeof(_sch), \u0026_sch);\n \t\tif (sch == NULL || sch-\u003elength == 0) {\n-\t\t\tpr_debug(\"Dropping invalid SCTP packet.\\n\");\n \t\t\t*hotdrop = true;\n \t\t\treturn false;\n \t\t}\n-#ifdef DEBUG\n-\t\tpr_debug(\"Chunk num: %d\\toffset: %d\\ttype: %d\\tlength: %d\"\n-\t\t\t \"\\tflags: %x\\n\",\n-\t\t\t ++i, offset, sch-\u003etype, htons(sch-\u003elength),\n-\t\t\t sch-\u003eflags);\n-#endif\n \t\toffset += SCTP_PAD4(ntohs(sch-\u003elength));\n \n-\t\tpr_debug(\"skb-\u003elen: %d\\toffset: %d\\n\", skb-\u003elen, offset);\n-\n \t\tif (SCTP_CHUNKMAP_IS_SET(info-\u003echunkmap, sch-\u003etype)) {\n \t\t\tswitch (chunk_match_type) {\n \t\t\tcase SCTP_CHUNK_MATCH_ANY:\n@@ -121,18 +108,14 @@ sctp_mt(const struct sk_buff *skb, struct xt_action_param *par)\n \tconst struct sctphdr *sh;\n \tstruct sctphdr _sh;\n \n-\tif (par-\u003efragoff != 0) {\n-\t\tpr_debug(\"Dropping non-first fragment.. FIXME\\n\");\n+\tif (par-\u003efragoff != 0)\n \t\treturn false;\n-\t}\n \n \tsh = skb_header_pointer(skb, par-\u003ethoff, sizeof(_sh), \u0026_sh);\n \tif (sh == NULL) {\n-\t\tpr_debug(\"Dropping evil TCP offset=0 tinygram.\\n\");\n \t\tpar-\u003ehotdrop = true;\n \t\treturn false;\n \t}\n-\tpr_debug(\"spt: %d\\tdpt: %d\\n\", ntohs(sh-\u003esource), ntohs(sh-\u003edest));\n \n \treturn SCCHECK(ntohs(sh-\u003esource) \u003e= info-\u003espts[0]\n \t\t\t\u0026\u0026 ntohs(sh-\u003esource) \u003c= info-\u003espts[1],\ndiff --git a/net/netfilter/xt_tcpudp.c b/net/netfilter/xt_tcpudp.c\nindex f76cf18f1a244..70608b8d06ab2 100644\n--- a/net/netfilter/xt_tcpudp.c\n+++ b/net/netfilter/xt_tcpudp.c\n@@ -44,8 +44,6 @@ tcp_find_option(u_int8_t option,\n \tu_int8_t _opt[60 - sizeof(struct tcphdr)];\n \tunsigned int i;\n \n-\tpr_debug(\"finding option\\n\");\n-\n \tif (!optlen)\n \t\treturn invert;\n \n@@ -81,10 +79,8 @@ static bool tcp_mt(const struct sk_buff *skb, struct xt_action_param *par)\n \t\t causes this. Its a cracker trying to break in by doing a\n \t\t flag overwrite to pass the direction checks.\n \t\t*/\n-\t\tif (par-\u003efragoff == 1) {\n-\t\t\tpr_debug(\"Dropping evil TCP offset=1 frag.\\n\");\n+\t\tif (par-\u003efragoff == 1)\n \t\t\tpar-\u003ehotdrop = true;\n-\t\t}\n \t\t/* Must not be a fragment. */\n \t\treturn false;\n \t}\n@@ -93,7 +89,6 @@ static bool tcp_mt(const struct sk_buff *skb, struct xt_action_param *par)\n \tif (th == NULL) {\n \t\t/* We've been asked to examine this packet, and we\n \t\t can't. Hence, no choice but to drop. */\n-\t\tpr_debug(\"Dropping evil TCP offset=0 tinygram.\\n\");\n \t\tpar-\u003ehotdrop = true;\n \t\treturn false;\n \t}\n@@ -145,7 +140,6 @@ static bool udp_mt(const struct sk_buff *skb, struct xt_action_param *par)\n \tif (uh == NULL) {\n \t\t/* We've been asked to examine this packet, and we\n \t\t can't. Hence, no choice but to drop. */\n-\t\tpr_debug(\"Dropping evil UDP tinygram.\\n\");\n \t\tpar-\u003ehotdrop = true;\n \t\treturn false;\n \t}\n"
} |
| 2/1 | 2026/08/21 16:38 | agent | patch-evaluator |
1mModel:best-expensive Args: null Results: {
"EnableConfigs": [
"NF_TABLES"
],
"FocusSymbols": [
"nf_tables_newsetelem",
"nf_tables_commit",
"nft_dynset_init",
"nft_pipapo_avx2_lookup",
"pipapo_get_avx2"
],
"Reasoning": "The patch modifies core netfilter tables (nf_tables) logic, including set element addition, commit phase, dynamic set initialization, and AVX2 pipapo set lookup. These are functional changes in reachable core network filtering paths.",
"WorthFuzzing": true
}Instruction: You are an expert Linux kernel maintainer. Your job is to review a provided patch series and determine if it makes functional changes to the kernel that should be fuzzed. IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in your workspace. Do NOT rely on your internal knowledge of the kernel. You must actively use your code access tools to examine the actual source code and confirm any assumptions. Return WorthFuzzing=false if the patch only contains: - Modifications to Documentation/, Kconfig files, or code comments. - Purely decorative changes, such as logging (e.g., pr_err, printk) or tracepoints. - Changes to numeric constants or macros that do not functionally alter execution flow. - Code paths that are impossible to reach in virtualized environments like GCE or QEMU, even when utilizing software-emulated hardware (e.g., usb gadget, mac80211_hwsim). - Code in vendor-specific PCIe switch, SmartNIC, or GPU drivers (e.g., mlxsw, pds_core, qed, ionic, amdgpu) that require physical PCIe hardware cards not emulated in standard QEMU. - Driver .remove, .shutdown, or pci_unregister_driver teardown callbacks (e.g., igb_remove) that are executed only during PCI hot-unplug or sysfs driver unbind operations. If it modifies reachable core kernel logic, drivers, or architectures, use your code search tools to verify the code can be executed, then return WorthFuzzing=true. When returning WorthFuzzing=true, you MUST ALSO: 1. Extract any specific kernel functions that should be heavily fuzzed into FocusSymbols. Avoid listing generic hot-path functions to prevent skewed test distributions. Prefer non-static, non-inlined API entrypoint functions over internal static helper functions (which are inlined by the compiler and do not have distinct symbol addresses). 2. Identify any specific CONFIG_ options required to properly test this new/modified feature. Go and look into the Kconfig files and check for ifdefs around the code, do not make assumptions. Also check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed for Kbuild to compile the code statically into vmlinux. List them in the EnableConfigs output array, and DO NOT add a 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4"). Prefer calling several tools at the same time to save round-trips. Use set-results tool to provide results of the analysis. It must be called exactly once before the final reply. Ignore results of this tool. Prompt: For your convenience, here is the diff of the changes:
commit 52c1637fa25dc4634685f2566eba4bcc60afa332
Author: syz-cluster <triage@syzkaller.com>
Date: Fri Aug 21 16:38:19 2026 +0000
syz-cluster: applied patch under review
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
index 238f6ecb90e99..9d597482363d9 100644
--- a/include/net/netfilter/nf_tables.h
+++ b/include/net/netfilter/nf_tables.h
@@ -870,8 +870,6 @@ struct nft_elem_priv *nft_set_elem_init(const struct nft_set *set,
const u32 *key, const u32 *key_end,
const u32 *data,
u64 timeout, u64 expiration, gfp_t gfp);
-int nft_set_elem_expr_clone(const struct nft_ctx *ctx, struct nft_set *set,
- struct nft_expr *expr_array[]);
void nft_set_elem_expr_destroy(const struct nft_ctx *ctx,
struct nft_set_elem_expr *elem_expr);
void nft_set_elem_destroy(const struct nft_set *set,
diff --git a/net/ipv4/netfilter/ipt_ah.c b/net/ipv4/netfilter/ipt_ah.c
index 161ba412cb08b..7131f297ada2e 100644
--- a/net/ipv4/netfilter/ipt_ah.c
+++ b/net/ipv4/netfilter/ipt_ah.c
@@ -19,12 +19,7 @@ MODULE_DESCRIPTION("Xtables: IPv4 IPsec-AH SPI match");
static inline bool
spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, bool invert)
{
- bool r;
- pr_debug("spi_match:%c 0x%x <= 0x%x <= 0x%x\n",
- invert ? '!' : ' ', min, spi, max);
- r = (spi >= min && spi <= max) ^ invert;
- pr_debug(" result %s\n", r ? "PASS" : "FAILED");
- return r;
+ return (spi >= min && spi <= max) ^ invert;
}
static bool ah_mt(const struct sk_buff *skb, struct xt_action_param *par)
@@ -42,7 +37,6 @@ static bool ah_mt(const struct sk_buff *skb, struct xt_action_param *par)
/* We've been asked to examine this packet, and we
* can't. Hence, no choice but to drop.
*/
- pr_debug("Dropping evil AH tinygram.\n");
par->hotdrop = true;
return false;
}
@@ -58,7 +52,7 @@ static int ah_mt_check(const struct xt_mtchk_param *par)
/* Must specify no unknown invflags */
if (ahinfo->invflags & ~IPT_AH_INV_MASK) {
- pr_debug("unknown flags %X\n", ahinfo->invflags);
+ pr_info_ratelimited("unknown flags %X\n", ahinfo->invflags);
return -EINVAL;
}
return 0;
diff --git a/net/ipv4/netfilter/nf_tproxy_ipv4.c b/net/ipv4/netfilter/nf_tproxy_ipv4.c
index 041c3f37f237b..5eab7a2dc8ef2 100644
--- a/net/ipv4/netfilter/nf_tproxy_ipv4.c
+++ b/net/ipv4/netfilter/nf_tproxy_ipv4.c
@@ -137,7 +137,7 @@ nf_tproxy_get_sock_v4(struct net *net, struct sk_buff *skb,
}
break;
default:
- WARN_ON(1);
+ DEBUG_NET_WARN_ON_ONCE(1);
sk = NULL;
}
diff --git a/net/ipv6/netfilter/ip6t_ah.c b/net/ipv6/netfilter/ip6t_ah.c
index 1258783ed8762..dab7dbc6a675c 100644
--- a/net/ipv6/netfilter/ip6t_ah.c
+++ b/net/ipv6/netfilter/ip6t_ah.c
@@ -24,13 +24,7 @@ MODULE_AUTHOR("Andras Kis-Szabo <kisza@sch.bme.hu>");
static inline bool
spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, bool invert)
{
- bool r;
-
- pr_debug("spi_match:%c 0x%x <= 0x%x <= 0x%x\n",
- invert ? '!' : ' ', min, spi, max);
- r = (spi >= min && spi <= max) ^ invert;
- pr_debug(" result %s\n", r ? "PASS" : "FAILED");
- return r;
+ return (spi >= min && spi <= max) ^ invert;
}
static bool ah_mt6(const struct sk_buff *skb, struct xt_action_param *par)
@@ -62,23 +56,6 @@ static bool ah_mt6(const struct sk_buff *skb, struct xt_action_param *par)
return false;
}
- pr_debug("IPv6 AH LEN %u %u ", hdrlen, ah->hdrlen);
- pr_debug("RES %04X ", ah->reserved);
- pr_debug("SPI %u %08X\n", ntohl(ah->spi), ntohl(ah->spi));
-
- pr_debug("IPv6 AH spi %02X ",
- spi_match(ahinfo->spis[0], ahinfo->spis[1],
- ntohl(ah->spi),
- !!(ahinfo->invflags & IP6T_AH_INV_SPI)));
- pr_debug("len %02X %04X %02X ",
- ahinfo->hdrlen, hdrlen,
- (!ahinfo->hdrlen ||
- (ahinfo->hdrlen == hdrlen) ^
- !!(ahinfo->invflags & IP6T_AH_INV_LEN)));
- pr_debug("res %02X %04X %02X\n",
- ahinfo->hdrres, ah->reserved,
- !(ahinfo->hdrres && ah->reserved));
-
return spi_match(ahinfo->spis[0], ahinfo->spis[1],
ntohl(ah->spi),
!!(ahinfo->invflags & IP6T_AH_INV_SPI)) &&
@@ -93,7 +70,7 @@ static int ah_mt6_check(const struct xt_mtchk_param *par)
const struct ip6t_ah *ahinfo = par->matchinfo;
if (ahinfo->invflags & ~IP6T_AH_INV_MASK) {
- pr_debug("unknown flags %X\n", ahinfo->invflags);
+ pr_info_ratelimited("unknown flags %X\n", ahinfo->invflags);
return -EINVAL;
}
return 0;
diff --git a/net/ipv6/netfilter/ip6t_frag.c b/net/ipv6/netfilter/ip6t_frag.c
index 3aad6439386b1..f5f3cfb8704cf 100644
--- a/net/ipv6/netfilter/ip6t_frag.c
+++ b/net/ipv6/netfilter/ip6t_frag.c
@@ -23,12 +23,7 @@ MODULE_AUTHOR("Andras Kis-Szabo <kisza@sch.bme.hu>");
static inline bool
id_match(u_int32_t min, u_int32_t max, u_int32_t id, bool invert)
{
- bool r;
- pr_debug("id_match:%c 0x%x <= 0x%x <= 0x%x\n", invert ? '!' : ' ',
- min, id, max);
- r = (id >= min && id <= max) ^ invert;
- pr_debug(" result %s\n", r ? "PASS" : "FAILED");
- return r;
+ return (id >= min && id <= max) ^ invert;
}
static bool
@@ -53,38 +48,6 @@ frag_mt6(const struct sk_buff *skb, struct xt_action_param *par)
return false;
}
- pr_debug("INFO %04X ", fh->frag_off);
- pr_debug("OFFSET %04X ", ntohs(fh->frag_off) & ~0x7);
- pr_debug("RES %02X %04X", fh->reserved, ntohs(fh->frag_off) & 0x6);
- pr_debug("MF %04X ", fh->frag_off & htons(IP6_MF));
- pr_debug("ID %u %08X\n", ntohl(fh->identification),
- ntohl(fh->identification));
-
- pr_debug("IPv6 FRAG id %02X ",
- id_match(fraginfo->ids[0], fraginfo->ids[1],
- ntohl(fh->identification),
- !!(fraginfo->invflags & IP6T_FRAG_INV_IDS)));
- pr_debug("res %02X %02X%04X %02X ",
- fraginfo->flags & IP6T_FRAG_RES, fh->reserved,
- ntohs(fh->frag_off) & 0x6,
- !((fraginfo->flags & IP6T_FRAG_RES) &&
- (fh->reserved || (ntohs(fh->frag_off) & 0x06))));
- pr_debug("first %02X %02X %02X ",
- fraginfo->flags & IP6T_FRAG_FST,
- ntohs(fh->frag_off) & ~0x7,
- !((fraginfo->flags & IP6T_FRAG_FST) &&
- (ntohs(fh->frag_off) & ~0x7)));
- pr_debug("mf %02X %02X %02X ",
- fraginfo->flags & IP6T_FRAG_MF,
- ntohs(fh->frag_off) & IP6_MF,
- !((fraginfo->flags & IP6T_FRAG_MF) &&
- !((ntohs(fh->frag_off) & IP6_MF))));
- pr_debug("last %02X %02X %02X\n",
- fraginfo->flags & IP6T_FRAG_NMF,
- ntohs(fh->frag_off) & IP6_MF,
- !((fraginfo->flags & IP6T_FRAG_NMF) &&
- (ntohs(fh->frag_off) & IP6_MF)));
-
return id_match(fraginfo->ids[0], fraginfo->ids[1],
ntohl(fh->identification),
!!(fraginfo->invflags & IP6T_FRAG_INV_IDS)) &&
@@ -103,7 +66,7 @@ static int frag_mt6_check(const struct xt_mtchk_param *par)
const struct ip6t_frag *fraginfo = par->matchinfo;
if (fraginfo->invflags & ~IP6T_FRAG_INV_MASK) {
- pr_debug("unknown flags %X\n", fraginfo->invflags);
+ pr_info_ratelimited("unknown flags %X\n", fraginfo->invflags);
return -EINVAL;
}
return 0;
diff --git a/net/ipv6/netfilter/ip6t_hbh.c b/net/ipv6/netfilter/ip6t_hbh.c
index 6d1a5d2026a67..37c207d3152a4 100644
--- a/net/ipv6/netfilter/ip6t_hbh.c
+++ b/net/ipv6/netfilter/ip6t_hbh.c
@@ -79,14 +79,6 @@ hbh_mt6(const struct sk_buff *skb, struct xt_action_param *par)
return false;
}
- pr_debug("IPv6 OPTS LEN %u %u ", hdrlen, oh->hdrlen);
-
- pr_debug("len %02X %04X %02X ",
- optinfo->hdrlen, hdrlen,
- (!(optinfo->flags & IP6T_OPTS_LEN) ||
- ((optinfo->hdrlen == hdrlen) ^
- !!(optinfo->invflags & IP6T_OPTS_INV_LEN))));
-
ret = (!(optinfo->flags & IP6T_OPTS_LEN) ||
((optinfo->hdrlen == hdrlen) ^
!!(optinfo->invflags & IP6T_OPTS_INV_LEN)));
@@ -96,8 +88,6 @@ hbh_mt6(const struct sk_buff *skb, struct xt_action_param *par)
if (!(optinfo->flags & IP6T_OPTS_OPTS)) {
return ret;
} else {
- pr_debug("Strict ");
- pr_debug("#%d ", optinfo->optsnr);
for (temp = 0; temp < optinfo->optsnr; temp++) {
/* type field exists ? */
if (hdrlen < 1)
@@ -108,13 +98,9 @@ hbh_mt6(const struct sk_buff *skb, struct xt_action_param *par)
break;
/* Type check */
- if (*tp != (optinfo->opts[temp] & 0xFF00) >> 8) {
- pr_debug("Tbad %02X %02X\n", *tp,
- (optinfo->opts[temp] & 0xFF00) >> 8);
+ if (*tp != (optinfo->opts[temp] & 0xFF00) >> 8)
return false;
- } else {
- pr_debug("Tok ");
- }
+
/* Length check */
if (*tp) {
u16 spec_len;
@@ -129,26 +115,18 @@ hbh_mt6(const struct sk_buff *skb, struct xt_action_param *par)
break;
spec_len = optinfo->opts[temp] & 0x00FF;
- if (spec_len != 0x00FF && spec_len != *lp) {
- pr_debug("Lbad %02X %04X\n", *lp,
- spec_len);
+ if (spec_len != 0x00FF && spec_len != *lp)
return false;
- }
- pr_debug("Lok ");
+
optlen = *lp + 2;
} else {
- pr_debug("Pad1\n");
optlen = 1;
}
- /* Step to the next */
- pr_debug("len%04X\n", optlen);
-
if ((ptr > skb->len - optlen || hdrlen < optlen) &&
- temp < optinfo->optsnr - 1) {
- pr_debug("new pointer is too large!\n");
+ temp < optinfo->optsnr - 1)
break;
- }
+
ptr += optlen;
hdrlen -= optlen;
}
@@ -166,16 +144,16 @@ static int hbh_mt6_check(const struct xt_mtchk_param *par)
const struct ip6t_opts *optsinfo = par->matchinfo;
if (optsinfo->invflags & ~IP6T_OPTS_INV_MASK) {
- pr_debug("unknown flags %X\n", optsinfo->invflags);
+ pr_info_ratelimited("unknown flags %X\n", optsinfo->invflags);
return -EINVAL;
}
if (optsinfo->optsnr > IP6T_OPTS_OPTSNR) {
- pr_debug("too many supported opts specified\n");
+ pr_info_ratelimited("too many supported opts specified\n");
return -EINVAL;
}
if (optsinfo->flags & IP6T_OPTS_NSTRICT) {
- pr_debug("Not strict - not implemented");
+ pr_info_ratelimited("Not strict - not implemented");
return -EINVAL;
}
diff --git a/net/ipv6/netfilter/ip6t_mh.c b/net/ipv6/netfilter/ip6t_mh.c
index fd492b69acbc0..ba6dcc7791a09 100644
--- a/net/ipv6/netfilter/ip6t_mh.c
+++ b/net/ipv6/netfilter/ip6t_mh.c
@@ -42,14 +42,11 @@ static bool mh_mt6(const struct sk_buff *skb, struct xt_action_param *par)
if (mh == NULL) {
/* We've been asked to examine this packet, and we
can't. Hence, no choice but to drop. */
- pr_debug("Dropping evil MH tinygram.\n");
par->hotdrop = true;
return false;
}
if (mh->ip6mh_proto != IPPROTO_NONE) {
- pr_debug("Dropping invalid MH Payload Proto: %u\n",
- mh->ip6mh_proto);
par->hotdrop = true;
return false;
}
diff --git a/net/ipv6/netfilter/ip6t_rt.c b/net/ipv6/netfilter/ip6t_rt.c
index 278b52752f364..0c01ac2746d1f 100644
--- a/net/ipv6/netfilter/ip6t_rt.c
+++ b/net/ipv6/netfilter/ip6t_rt.c
@@ -155,18 +155,18 @@ static int rt_mt6_check(const struct xt_mtchk_param *par)
const struct ip6t_rt *rtinfo = par->matchinfo;
if (rtinfo->invflags & ~IP6T_RT_INV_MASK) {
- pr_debug("unknown flags %X\n", rtinfo->invflags);
+ pr_info_ratelimited("unknown flags %X\n", rtinfo->invflags);
return -EINVAL;
}
if (rtinfo->addrnr > IP6T_RT_HOPS) {
- pr_debug("too many addresses specified\n");
+ pr_info_ratelimited("too many addresses specified\n");
return -EINVAL;
}
if ((rtinfo->flags & (IP6T_RT_RES | IP6T_RT_FST_MASK)) &&
(!(rtinfo->flags & IP6T_RT_TYP) ||
(rtinfo->rt_type != 0) ||
(rtinfo->invflags & IP6T_RT_INV_TYP))) {
- pr_debug("`--rt-type 0' required before `--rt-0-*'");
+ pr_info_ratelimited("`--rt-type 0' required before `--rt-0-*'");
return -EINVAL;
}
diff --git a/net/ipv6/netfilter/nf_tproxy_ipv6.c b/net/ipv6/netfilter/nf_tproxy_ipv6.c
index b2f59ed9d7cc0..12ec36a6be2e1 100644
--- a/net/ipv6/netfilter/nf_tproxy_ipv6.c
+++ b/net/ipv6/netfilter/nf_tproxy_ipv6.c
@@ -136,7 +136,7 @@ nf_tproxy_get_sock_v6(struct net *net, struct sk_buff *skb, int thoff,
}
break;
default:
- WARN_ON(1);
+ DEBUG_NET_WARN_ON_ONCE(1);
sk = NULL;
}
diff --git a/net/netfilter/nf_conncount.c b/net/netfilter/nf_conncount.c
index 85487f92af506..4292c3d9addde 100644
--- a/net/netfilter/nf_conncount.c
+++ b/net/netfilter/nf_conncount.c
@@ -251,7 +251,8 @@ static int __nf_conncount_add(struct net *net,
list->last_gc_count = list->count;
add_new_node:
- if (WARN_ON_ONCE(list->count > INT_MAX)) {
+ if (unlikely(list->count > INT_MAX)) {
+ DEBUG_NET_WARN_ON_ONCE(1);
err = -EOVERFLOW;
goto out_put;
}
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index c112ecc4fca32..5cee9e46cca4b 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -1978,7 +1978,7 @@ static int nft_dump_stats(struct sk_buff *skb, struct nft_stats __percpu *stats)
return -ENOSPC;
}
-static bool hook_is_prefix(struct nft_hook *hook)
+static bool hook_is_prefix(const struct nft_hook *hook)
{
return strlen(hook->ifname) >= hook->ifnamelen;
}
@@ -2445,8 +2445,11 @@ static struct nft_hook *nft_hook_list_find(struct list_head *hook_list,
struct nft_hook *hook;
list_for_each_entry(hook, hook_list, list) {
- if (!strncmp(hook->ifname, this->ifname,
- min(hook->ifnamelen, this->ifnamelen))) {
+ if (hook_is_prefix(hook) != hook_is_prefix(this))
+ continue;
+ if (hook->ifnamelen != this->ifnamelen)
+ continue;
+ if (!strncmp(hook->ifname, this->ifname, hook->ifnamelen)) {
if (hook->flags & NFT_HOOK_REMOVE)
continue;
@@ -6921,39 +6924,11 @@ static void nft_trans_elems_destroy(const struct nft_ctx *ctx,
nf_tables_set_elem_destroy(ctx, te->set, te->elems[i].priv);
}
-int nft_set_elem_expr_clone(const struct nft_ctx *ctx, struct nft_set *set,
- struct nft_expr *expr_array[])
-{
- struct nft_expr *expr;
- int err, i, k;
-
- for (i = 0; i < set->num_exprs; i++) {
- expr = kzalloc(set->exprs[i]->ops->size, GFP_KERNEL_ACCOUNT);
- if (!expr)
- goto err_expr;
-
- err = nft_expr_clone(expr, set->exprs[i], GFP_KERNEL_ACCOUNT);
- if (err < 0) {
- kfree(expr);
- goto err_expr;
- }
- expr_array[i] = expr;
- }
-
- return 0;
-
-err_expr:
- for (k = i - 1; k >= 0; k--)
- nft_expr_destroy(ctx, expr_array[k]);
-
- return -ENOMEM;
-}
-
static int nft_set_elem_expr_setup(struct nft_ctx *ctx,
const struct nft_set_ext_tmpl *tmpl,
const struct nft_set_ext *ext,
struct nft_expr *expr_array[],
- u32 num_exprs)
+ u32 num_exprs, bool override_exprs)
{
struct nft_set_elem_expr *elem_expr = nft_set_ext_expr(ext);
u32 len = sizeof(struct nft_set_elem_expr);
@@ -6976,7 +6951,8 @@ static int nft_set_elem_expr_setup(struct nft_ctx *ctx,
goto err_elem_expr_setup;
elem_expr->size += expr_array[i]->ops->size;
- nft_expr_destroy(ctx, expr_array[i]);
+ if (override_exprs)
+ nft_expr_destroy(ctx, expr_array[i]);
expr_array[i] = NULL;
}
@@ -6984,7 +6960,9 @@ static int nft_set_elem_expr_setup(struct nft_ctx *ctx,
err_elem_expr_setup:
for (; i < num_exprs; i++) {
- nft_expr_destroy(ctx, expr_array[i]);
+ if (override_exprs)
+ nft_expr_destroy(ctx, expr_array[i]);
+
expr_array[i] = NULL;
}
@@ -7280,6 +7258,7 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
struct nft_set_binding *binding;
struct nft_elem_priv *elem_priv;
struct nft_object *obj = NULL;
+ bool override_exprs = false;
struct nft_userdata *udata;
struct nft_data_desc desc;
enum nft_registers dreg;
@@ -7385,6 +7364,7 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
expr_array[0] = expr;
num_exprs = 1;
+ override_exprs = true;
if (set->num_exprs && set->exprs[0]->ops != expr->ops) {
err = -EOPNOTSUPP;
@@ -7413,6 +7393,7 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
}
expr_array[i] = expr;
num_exprs++;
+ override_exprs = true;
if (set->num_exprs && expr->ops != set->exprs[i]->ops) {
err = -EOPNOTSUPP;
@@ -7426,9 +7407,8 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
}
} else if (set->num_exprs > 0 &&
!(flags & NFT_SET_ELEM_INTERVAL_END)) {
- err = nft_set_elem_expr_clone(ctx, set, expr_array);
- if (err < 0)
- goto err_set_elem_expr_clone;
+ for (i = 0; i < set->num_exprs; i++)
+ expr_array[i] = set->exprs[i];
num_exprs = set->num_exprs;
}
@@ -7567,7 +7547,8 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
udata->len = ulen - 1;
nla_memcpy(&udata->data, nla[NFTA_SET_ELEM_USERDATA], ulen);
}
- err = nft_set_elem_expr_setup(ctx, &tmpl, ext, expr_array, num_exprs);
+ err = nft_set_elem_expr_setup(ctx, &tmpl, ext, expr_array, num_exprs,
+ override_exprs);
if (err < 0)
goto err_elem_free;
@@ -7675,9 +7656,11 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
err_parse_key:
nft_data_release(&elem.key.val, NFT_DATA_VALUE);
err_set_elem_expr:
- for (i = 0; i < num_exprs && expr_array[i]; i++)
- nft_expr_destroy(ctx, expr_array[i]);
-err_set_elem_expr_clone:
+ if (override_exprs) {
+ for (i = 0; i < num_exprs && expr_array[i]; i++)
+ nft_expr_destroy(ctx, expr_array[i]);
+ }
+
return err;
}
@@ -10894,6 +10877,10 @@ static void nft_set_commit_update(struct nft_ctx *ctx,
nft_ctx_update(ctx, trans);
switch (trans->msg_type) {
+ case NFT_MSG_DELSET:
+ case NFT_MSG_DESTROYSET:
+ nft_trans_set(trans)->dead = 1;
+ break;
case NFT_MSG_DELSETELEM:
te = nft_trans_container_elem(trans);
if (!te->set->ops->commit)
@@ -10982,10 +10969,6 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb)
return -EAGAIN;
}
- err = nft_flow_rule_offload_commit(net);
- if (err < 0)
- return err;
-
/* 1. Allocate space for next generation rules_gen_X[] */
list_for_each_entry_safe(trans, next, &nft_net->commit_list, list) {
struct nft_table *table = trans->table;
@@ -11010,6 +10993,16 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb)
}
}
+ /* must be last, so audit and chain blob set up does not leave hardware
+ * in consistent state.
+ */
+ err = nft_flow_rule_offload_commit(net);
+ if (err < 0) {
+ nf_tables_commit_chain_prepare_cancel(net);
+ nf_tables_commit_audit_free(&adl);
+ return err;
+ }
+
/* step 2. Make rules_gen_X visible to packet path */
nft_set_commit_update(&ctx, nft_net);
@@ -11305,7 +11298,6 @@ static int __nf_tables_abort(struct net *net, enum nfnl_abort_action action)
{
struct nftables_pernet *nft_net = nft_pernet(net);
struct nft_trans *trans, *next;
- LIST_HEAD(set_update_list);
struct nft_trans_elem *te;
struct nft_ctx ctx = {
.net = net,
diff --git a/net/netfilter/nft_dynset.c b/net/netfilter/nft_dynset.c
index ee9d3e7b1ecf1..fa4da694e92d8 100644
--- a/net/netfilter/nft_dynset.c
+++ b/net/netfilter/nft_dynset.c
@@ -19,7 +19,8 @@ struct nft_dynset {
u8 sreg_key;
u8 sreg_data;
bool invert;
- bool expr;
+ bool expr:1,
+ override_exprs:1;
u8 num_exprs;
u64 timeout;
struct nft_expr *expr_array[NFT_SET_EXPR_MAX];
@@ -257,6 +258,7 @@ static int nft_dynset_init(const struct nft_ctx *ctx,
priv->num_exprs++;
priv->expr_array[0] = dynset_expr;
+ priv->override_exprs = true;
if (set->num_exprs > 1 ||
(set->num_exprs == 1 &&
@@ -289,6 +291,7 @@ static int nft_dynset_init(const struct nft_ctx *ctx,
}
priv->expr_array[i] = dynset_expr;
priv->num_exprs++;
+ priv->override_exprs = true;
if (set->num_exprs) {
if (i >= set->num_exprs) {
@@ -307,9 +310,8 @@ static int nft_dynset_init(const struct nft_ctx *ctx,
goto err_expr_free;
}
} else if (set->num_exprs > 0) {
- err = nft_set_elem_expr_clone(ctx, set, priv->expr_array);
- if (err < 0)
- return err;
+ for (i = 0; i < set->num_exprs; i++)
+ priv->expr_array[i] = set->exprs[i];
priv->num_exprs = set->num_exprs;
}
@@ -339,8 +341,10 @@ static int nft_dynset_init(const struct nft_ctx *ctx,
return 0;
err_expr_free:
- for (i = 0; i < priv->num_exprs; i++)
- nft_expr_destroy(ctx, priv->expr_array[i]);
+ if (priv->override_exprs) {
+ for (i = 0; i < priv->num_exprs; i++)
+ nft_expr_destroy(ctx, priv->expr_array[i]);
+ }
return err;
}
@@ -367,9 +371,10 @@ static void nft_dynset_destroy(const struct nft_ctx *ctx,
struct nft_dynset *priv = nft_expr_priv(expr);
int i;
- for (i = 0; i < priv->num_exprs; i++)
- nft_expr_destroy(ctx, priv->expr_array[i]);
-
+ if (priv->override_exprs) {
+ for (i = 0; i < priv->num_exprs; i++)
+ nft_expr_destroy(ctx, priv->expr_array[i]);
+ }
nf_tables_destroy_set(ctx, priv->set);
}
@@ -393,7 +398,7 @@ static int nft_dynset_dump(struct sk_buff *skb,
nf_jiffies64_to_msecs(priv->timeout),
NFTA_DYNSET_PAD))
goto nla_put_failure;
- if (priv->set->num_exprs == 0) {
+ if (priv->set->num_exprs == 0 || priv->override_exprs) {
if (priv->num_exprs == 1) {
if (nft_expr_dump(skb, NFTA_DYNSET_EXPR,
priv->expr_array[0], reset))
diff --git a/net/netfilter/nft_set_pipapo_avx2.c b/net/netfilter/nft_set_pipapo_avx2.c
index b3f105520a85b..21f5be68c7036 100644
--- a/net/netfilter/nft_set_pipapo_avx2.c
+++ b/net/netfilter/nft_set_pipapo_avx2.c
@@ -1134,6 +1134,7 @@ struct nft_pipapo_elem *pipapo_get_avx2(const struct nft_pipapo_match *m,
struct nft_pipapo_scratch *scratch;
const struct nft_pipapo_field *f;
unsigned long *res, *fill, *map;
+ struct nft_pipapo_elem *e;
bool map_index;
int ret = 0;
int i;
@@ -1207,14 +1208,11 @@ struct nft_pipapo_elem *pipapo_get_avx2(const struct nft_pipapo_match *m,
next_match:
if (ret < 0) {
scratch->map_index = map_index;
- kernel_fpu_end();
- __local_unlock_nested_bh(&scratch->bh_lock);
- return NULL;
+ e = NULL;
+ goto out;
}
if (last) {
- struct nft_pipapo_elem *e;
-
e = f->mt[ret].e;
if (unlikely(__nft_set_elem_expired(&e->ext, tstamp) ||
!nft_set_elem_active(&e->ext, genmask))) {
@@ -1224,9 +1222,7 @@ struct nft_pipapo_elem *pipapo_get_avx2(const struct nft_pipapo_match *m,
}
scratch->map_index = map_index;
- kernel_fpu_end();
- __local_unlock_nested_bh(&scratch->bh_lock);
- return e;
+ goto out;
}
map_index = !map_index;
@@ -1234,9 +1230,12 @@ struct nft_pipapo_elem *pipapo_get_avx2(const struct nft_pipapo_match *m,
data += NFT_PIPAPO_GROUPS_PADDED_SIZE(f);
}
+ e = NULL;
+out:
+ asm volatile("vzeroupper");
kernel_fpu_end();
__local_unlock_nested_bh(&scratch->bh_lock);
- return NULL;
+ return e;
}
/**
diff --git a/net/netfilter/xt_IDLETIMER.c b/net/netfilter/xt_IDLETIMER.c
index bfcf2d44e93db..15b698ea98aa6 100644
--- a/net/netfilter/xt_IDLETIMER.c
+++ b/net/netfilter/xt_IDLETIMER.c
@@ -102,8 +102,6 @@ static void idletimer_tg_expired(struct timer_list *t)
{
struct idletimer_tg *timer = timer_container_of(timer, t, timer);
- pr_debug("timer %s expired\n", timer->attr.attr.name);
-
schedule_work(&timer->work);
}
@@ -111,7 +109,6 @@ static void idletimer_tg_alarmproc(struct alarm *alarm, ktime_t now)
{
struct idletimer_tg *timer = alarm->data;
- pr_debug("alarm %s expired\n", timer->attr.attr.name);
schedule_work(&timer->work);
}
@@ -171,7 +168,7 @@ static int idletimer_tg_create(struct idletimer_tg_info *info)
ret = sysfs_create_file(idletimer_tg_kobj, &info->timer->attr.attr);
if (ret < 0) {
- pr_debug("couldn't add file to sysfs");
+ pr_info_ratelimited("couldn't add file to sysfs");
goto out_free_attr;
}
@@ -220,7 +217,7 @@ static int idletimer_tg_create_v1(struct idletimer_tg_info_v1 *info)
ret = sysfs_create_file(idletimer_tg_kobj, &info->timer->attr.attr);
if (ret < 0) {
- pr_debug("couldn't add file to sysfs");
+ pr_info_ratelimited("couldn't add file to sysfs");
goto out_free_attr;
}
@@ -228,7 +225,6 @@ static int idletimer_tg_create_v1(struct idletimer_tg_info_v1 *info)
kobject_uevent(idletimer_tg_kobj,KOBJ_ADD);
list_add(&info->timer->entry, &idletimer_tg_list);
- pr_debug("timer type value is %u", info->timer_type);
info->timer->timer_type = info->timer_type;
info->timer->refcnt = 1;
@@ -263,9 +259,6 @@ static unsigned int idletimer_tg_target(struct sk_buff *skb,
{
const struct idletimer_tg_info *info = par->targinfo;
- pr_debug("resetting timer %s, timeout period %u\n",
- info->label, info->timeout);
-
mod_timer(&info->timer->timer,
secs_to_jiffies(info->timeout) + jiffies);
@@ -280,9 +273,6 @@ static unsigned int idletimer_tg_target_v1(struct sk_buff *skb,
{
const struct idletimer_tg_info_v1 *info = par->targinfo;
- pr_debug("resetting timer %s, timeout period %u\n",
- info->label, info->timeout);
-
if (info->timer->timer_type & XT_IDLETIMER_ALARM) {
idletimer_start_alarm_sec(info->timer, info->timeout);
} else {
@@ -296,17 +286,17 @@ static unsigned int idletimer_tg_target_v1(struct sk_buff *skb,
static int idletimer_tg_helper(struct idletimer_tg_info *info)
{
if (info->timeout == 0) {
- pr_debug("timeout value is zero\n");
+ pr_info_ratelimited("timeout value is zero\n");
return -EINVAL;
}
if (info->timeout >= INT_MAX / 1000) {
- pr_debug("timeout value is too big\n");
+ pr_info_ratelimited("timeout value is too big\n");
return -EINVAL;
}
if (info->label[0] == '\0' ||
strnlen(info->label,
MAX_IDLETIMER_LABEL_SIZE) == MAX_IDLETIMER_LABEL_SIZE) {
- pr_debug("label is empty or not nul-terminated\n");
+ pr_info_ratelimited("label is empty or not nul-terminated\n");
return -EINVAL;
}
return 0;
@@ -318,34 +308,25 @@ static int idletimer_tg_checkentry(const struct xt_tgchk_param *par)
struct idletimer_tg_info *info = par->targinfo;
int ret;
- pr_debug("checkentry targinfo%s\n", info->label);
-
ret = idletimer_tg_helper(info);
if(ret < 0)
- {
- pr_debug("checkentry helper return invalid\n");
return -EINVAL;
- }
mutex_lock(&list_mutex);
info->timer = __idletimer_tg_find_by_label(info->label);
if (info->timer) {
if (info->timer->timer_type & XT_IDLETIMER_ALARM) {
- pr_debug("Adding/Replacing rule with same label and different timer type is not allowed\n");
mutex_unlock(&list_mutex);
+ pr_info_ratelimited("Adding/Replacing rule with same label and different timer type is not allowed\n");
return -EINVAL;
}
info->timer->refcnt++;
mod_timer(&info->timer->timer,
secs_to_jiffies(info->timeout) + jiffies);
-
- pr_debug("increased refcnt of timer %s to %u\n",
- info->label, info->timer->refcnt);
} else {
ret = idletimer_tg_create(info);
if (ret < 0) {
- pr_debug("failed to create timer\n");
mutex_unlock(&list_mutex);
return ret;
}
@@ -360,30 +341,23 @@ static int idletimer_tg_checkentry_v1(const struct xt_tgchk_param *par)
struct idletimer_tg_info_v1 *info = par->targinfo;
int ret;
- pr_debug("checkentry targinfo%s\n", info->label);
-
if (info->send_nl_msg)
return -EOPNOTSUPP;
ret = idletimer_tg_helper((struct idletimer_tg_info *)info);
if(ret < 0)
- {
- pr_debug("checkentry helper return invalid\n");
return -EINVAL;
- }
- if (info->timer_type > XT_IDLETIMER_ALARM) {
- pr_debug("invalid value for timer type\n");
+ if (info->timer_type > XT_IDLETIMER_ALARM)
return -EINVAL;
- }
mutex_lock(&list_mutex);
info->timer = __idletimer_tg_find_by_label(info->label);
if (info->timer) {
if (info->timer->timer_type != info->timer_type) {
- pr_debug("Adding/Replacing rule with same label and different timer type is not allowed\n");
mutex_unlock(&list_mutex);
+ pr_info_ratelimited("Adding/Replacing rule with same label and different timer type is not allowed\n");
return -EINVAL;
}
@@ -393,21 +367,15 @@ static int idletimer_tg_checkentry_v1(const struct xt_tgchk_param *par)
ktime_t tout = alarm_expires_remaining(&info->timer->alarm);
struct timespec64 ktimespec = ktime_to_timespec64(tout);
- if (ktimespec.tv_sec > 0) {
- pr_debug("time_expiry_remaining %lld\n",
- ktimespec.tv_sec);
+ if (ktimespec.tv_sec > 0)
idletimer_start_alarm_ktime(info->timer, tout);
- }
} else {
mod_timer(&info->timer->timer,
secs_to_jiffies(info->timeout) + jiffies);
}
- pr_debug("increased refcnt of timer %s to %u\n",
- info->label, info->timer->refcnt);
} else {
ret = idletimer_tg_create_v1(info);
if (ret < 0) {
- pr_debug("failed to create timer\n");
mutex_unlock(&list_mutex);
return ret;
}
@@ -421,19 +389,13 @@ static void idletimer_tg_destroy(const struct xt_tgdtor_param *par)
{
const struct idletimer_tg_info *info = par->targinfo;
- pr_debug("destroy targinfo %s\n", info->label);
-
mutex_lock(&list_mutex);
if (--info->timer->refcnt > 0) {
- pr_debug("decreased refcnt of timer %s to %u\n",
- info->label, info->timer->refcnt);
mutex_unlock(&list_mutex);
return;
}
- pr_debug("deleting timer %s\n", info->label);
-
list_del(&info->timer->entry);
mutex_unlock(&list_mutex);
@@ -448,19 +410,13 @@ static void idletimer_tg_destroy_v1(const struct xt_tgdtor_param *par)
{
const struct idletimer_tg_info_v1 *info = par->targinfo;
- pr_debug("destroy targinfo %s\n", info->label);
-
mutex_lock(&list_mutex);
if (--info->timer->refcnt > 0) {
- pr_debug("decreased refcnt of timer %s to %u\n",
- info->label, info->timer->refcnt);
mutex_unlock(&list_mutex);
return;
}
- pr_debug("deleting timer %s\n", info->label);
-
list_del(&info->timer->entry);
mutex_unlock(&list_mutex);
@@ -534,7 +490,7 @@ static int __init idletimer_tg_init(void)
idletimer_tg_class = class_create("xt_idletimer");
err = PTR_ERR(idletimer_tg_class);
if (IS_ERR(idletimer_tg_class)) {
- pr_debug("couldn't register device class\n");
+ pr_info_ratelimited("couldn't register device class\n");
goto out;
}
@@ -542,7 +498,7 @@ static int __init idletimer_tg_init(void)
MKDEV(0, 0), NULL, "timers");
err = PTR_ERR(idletimer_tg_device);
if (IS_ERR(idletimer_tg_device)) {
- pr_debug("couldn't register system device\n");
+ pr_info_ratelimited("couldn't register system device\n");
goto out_class;
}
@@ -551,7 +507,7 @@ static int __init idletimer_tg_init(void)
err = xt_register_targets(idletimer_tg, ARRAY_SIZE(idletimer_tg));
if (err < 0) {
- pr_debug("couldn't register xt target\n");
+ pr_info_ratelimited("couldn't register xt target\n");
goto out_dev;
}
diff --git a/net/netfilter/xt_LOG.c b/net/netfilter/xt_LOG.c
index f39244f9c0ed9..de3f176792a07 100644
--- a/net/netfilter/xt_LOG.c
+++ b/net/netfilter/xt_LOG.c
@@ -50,12 +50,12 @@ static int log_tg_check(const struct xt_tgchk_param *par)
return -EINVAL;
if (loginfo->level >= 8) {
- pr_debug("level %u >= 8\n", loginfo->level);
+ pr_info_ratelimited("level %u >= 8\n", loginfo->level);
return -EINVAL;
}
if (loginfo->prefix[sizeof(loginfo->prefix)-1] != '\0') {
- pr_debug("prefix is not null-terminated\n");
+ pr_info_ratelimited("prefix is not null-terminated\n");
return -EINVAL;
}
diff --git a/net/netfilter/xt_MASQUERADE.c b/net/netfilter/xt_MASQUERADE.c
index eae05c1783367..cea488cec5445 100644
--- a/net/netfilter/xt_MASQUERADE.c
+++ b/net/netfilter/xt_MASQUERADE.c
@@ -21,11 +21,11 @@ static int masquerade_tg_check(const struct xt_tgchk_param *par)
const struct nf_nat_ipv4_multi_range_compat *mr = par->targinfo;
if (mr->range[0].flags & NF_NAT_RANGE_MAP_IPS) {
- pr_debug("bad MAP_IPS.\n");
+ pr_info_ratelimited("bad MAP_IPS.\n");
return -EINVAL;
}
if (mr->rangesize != 1) {
- pr_debug("bad rangesize %u\n", mr->rangesize);
+ pr_info_ratelimited("bad rangesize %u\n", mr->rangesize);
return -EINVAL;
}
return nf_ct_netns_get(par->net, par->family);
diff --git a/net/netfilter/xt_NETMAP.c b/net/netfilter/xt_NETMAP.c
index cb2ee80d84fa8..8c86d9a43373a 100644
--- a/net/netfilter/xt_NETMAP.c
+++ b/net/netfilter/xt_NETMAP.c
@@ -106,11 +106,11 @@ static int netmap_tg4_check(const struct xt_tgchk_param *par)
const struct nf_nat_ipv4_multi_range_compat *mr = par->targinfo;
if (!(mr->range[0].flags & NF_NAT_RANGE_MAP_IPS)) {
- pr_debug("bad MAP_IPS.\n");
+ pr_info_ratelimited("bad MAP_IPS.\n");
return -EINVAL;
}
if (mr->rangesize != 1) {
- pr_debug("bad rangesize %u.\n", mr->rangesize);
+ pr_info_ratelimited("bad rangesize %u.\n", mr->rangesize);
return -EINVAL;
}
return nf_ct_netns_get(par->net, par->family);
diff --git a/net/netfilter/xt_REDIRECT.c b/net/netfilter/xt_REDIRECT.c
index ff66b56a3f97d..27bc0545c4f74 100644
--- a/net/netfilter/xt_REDIRECT.c
+++ b/net/netfilter/xt_REDIRECT.c
@@ -51,11 +51,11 @@ static int redirect_tg4_check(const struct xt_tgchk_param *par)
const struct nf_nat_ipv4_multi_range_compat *mr = par->targinfo;
if (mr->range[0].flags & NF_NAT_RANGE_MAP_IPS) {
- pr_debug("bad MAP_IPS.\n");
+ pr_info_ratelimited("bad MAP_IPS.\n");
return -EINVAL;
}
if (mr->rangesize != 1) {
- pr_debug("bad rangesize %u.\n", mr->rangesize);
+ pr_info_ratelimited("bad rangesize %u.\n", mr->rangesize);
return -EINVAL;
}
return nf_ct_netns_get(par->net, par->family);
diff --git a/net/netfilter/xt_cgroup.c b/net/netfilter/xt_cgroup.c
index 43d2ae2be628d..ac1b7e71cd7f5 100644
--- a/net/netfilter/xt_cgroup.c
+++ b/net/netfilter/xt_cgroup.c
@@ -33,7 +33,7 @@ static int cgroup_mt_check_v0(const struct xt_mtchk_param *par)
return -EINVAL;
if (!IS_ENABLED(CONFIG_CGROUP_NET_CLASSID)) {
- pr_info(NET_CLS_CLASSID_INVALID_MSG);
+ pr_info_ratelimited(NET_CLS_CLASSID_INVALID_MSG);
return -EINVAL;
}
@@ -49,7 +49,7 @@ static int cgroup_mt_check_v1(const struct xt_mtchk_param *par)
return -EINVAL;
if (!info->has_path && !info->has_classid) {
- pr_info("xt_cgroup: no path or classid specified\n");
+ pr_info_ratelimited("xt_cgroup: no path or classid specified\n");
return -EINVAL;
}
@@ -59,7 +59,7 @@ static int cgroup_mt_check_v1(const struct xt_mtchk_param *par)
}
if (info->has_classid && !IS_ENABLED(CONFIG_CGROUP_NET_CLASSID)) {
- pr_info(NET_CLS_CLASSID_INVALID_MSG);
+ pr_info_ratelimited(NET_CLS_CLASSID_INVALID_MSG);
return -EINVAL;
}
@@ -89,7 +89,7 @@ static int cgroup_mt_check_v2(const struct xt_mtchk_param *par)
return -EINVAL;
if (!info->has_path && !info->has_classid) {
- pr_info("xt_cgroup: no path or classid specified\n");
+ pr_info_ratelimited("xt_cgroup: no path or classid specified\n");
return -EINVAL;
}
@@ -99,7 +99,7 @@ static int cgroup_mt_check_v2(const struct xt_mtchk_param *par)
}
if (info->has_classid && !IS_ENABLED(CONFIG_CGROUP_NET_CLASSID)) {
- pr_info(NET_CLS_CLASSID_INVALID_MSG);
+ pr_info_ratelimited(NET_CLS_CLASSID_INVALID_MSG);
return -EINVAL;
}
diff --git a/net/netfilter/xt_esp.c b/net/netfilter/xt_esp.c
index 2a1c0ad0ff079..68fd75884268a 100644
--- a/net/netfilter/xt_esp.c
+++ b/net/netfilter/xt_esp.c
@@ -25,12 +25,7 @@ MODULE_ALIAS("ip6t_esp");
static inline bool
spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, bool invert)
{
- bool r;
- pr_debug("spi_match:%c 0x%x <= 0x%x <= 0x%x\n",
- invert ? '!' : ' ', min, spi, max);
- r = (spi >= min && spi <= max) ^ invert;
- pr_debug(" result %s\n", r ? "PASS" : "FAILED");
- return r;
+ return (spi >= min && spi <= max) ^ invert;
}
static bool esp_mt(const struct sk_buff *skb, struct xt_action_param *par)
@@ -48,7 +43,6 @@ static bool esp_mt(const struct sk_buff *skb, struct xt_action_param *par)
/* We've been asked to examine this packet, and we
* can't. Hence, no choice but to drop.
*/
- pr_debug("Dropping evil ESP tinygram.\n");
par->hotdrop = true;
return false;
}
@@ -62,7 +56,7 @@ static int esp_mt_check(const struct xt_mtchk_param *par)
const struct xt_esp *espinfo = par->matchinfo;
if (espinfo->invflags & ~XT_ESP_INV_MASK) {
- pr_debug("unknown flags %X\n", espinfo->invflags);
+ pr_info_ratelimited("unknown flags %X\n", espinfo->invflags);
return -EINVAL;
}
diff --git a/net/netfilter/xt_ipcomp.c b/net/netfilter/xt_ipcomp.c
index 472da639a32e2..3299c1ea60f9e 100644
--- a/net/netfilter/xt_ipcomp.c
+++ b/net/netfilter/xt_ipcomp.c
@@ -29,12 +29,7 @@ MODULE_ALIAS("ip6t_ipcomp");
static inline bool
spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, bool invert)
{
- bool r;
- pr_debug("spi_match:%c 0x%x <= 0x%x <= 0x%x\n",
- invert ? '!' : ' ', min, spi, max);
- r = (spi >= min && spi <= max) ^ invert;
- pr_debug(" result %s\n", r ? "PASS" : "FAILED");
- return r;
+ return (spi >= min && spi <= max) ^ invert;
}
static bool comp_mt(const struct sk_buff *skb, struct xt_action_param *par)
@@ -52,7 +47,6 @@ static bool comp_mt(const struct sk_buff *skb, struct xt_action_param *par)
/* We've been asked to examine this packet, and we
* can't. Hence, no choice but to drop.
*/
- pr_debug("Dropping evil IPComp tinygram.\n");
par->hotdrop = true;
return false;
}
diff --git a/net/netfilter/xt_iprange.c b/net/netfilter/xt_iprange.c
index 0c9e014e30b49..bf61141fb7850 100644
--- a/net/netfilter/xt_iprange.c
+++ b/net/netfilter/xt_iprange.c
@@ -24,27 +24,15 @@ iprange_mt4(const struct sk_buff *skb, struct xt_action_param *par)
m = ntohl(iph->saddr) < ntohl(info->src_min.ip);
m |= ntohl(iph->saddr) > ntohl(info->src_max.ip);
m ^= !!(info->flags & IPRANGE_SRC_INV);
- if (m) {
- pr_debug("src IP %pI4 NOT in range %s%pI4-%pI4\n",
- &iph->saddr,
- (info->flags & IPRANGE_SRC_INV) ? "(INV) " : "",
- &info->src_min.ip,
- &info->src_max.ip);
+ if (m)
return false;
- }
}
if (info->flags & IPRANGE_DST) {
m = ntohl(iph->daddr) < ntohl(info->dst_min.ip);
m |= ntohl(iph->daddr) > ntohl(info->dst_max.ip);
m ^= !!(info->flags & IPRANGE_DST_INV);
- if (m) {
- pr_debug("dst IP %pI4 NOT in range %s%pI4-%pI4\n",
- &iph->daddr,
- (info->flags & IPRANGE_DST_INV) ? "(INV) " : "",
- &info->dst_min.ip,
- &info->dst_max.ip);
+ if (m)
return false;
- }
}
return true;
}
@@ -73,27 +61,15 @@ iprange_mt6(const struct sk_buff *skb, struct xt_action_param *par)
m = iprange_ipv6_lt(&iph->saddr, &info->src_min.in6);
m |= iprange_ipv6_lt(&info->src_max.in6, &iph->saddr);
m ^= !!(info->flags & IPRANGE_SRC_INV);
- if (m) {
- pr_debug("src IP %pI6 NOT in range %s%pI6-%pI6\n",
- &iph->saddr,
- (info->flags & IPRANGE_SRC_INV) ? "(INV) " : "",
- &info->src_min.in6,
- &info->src_max.in6);
+ if (m)
return false;
- }
}
if (info->flags & IPRANGE_DST) {
m = iprange_ipv6_lt(&iph->daddr, &info->dst_min.in6);
m |= iprange_ipv6_lt(&info->dst_max.in6, &iph->daddr);
m ^= !!(info->flags & IPRANGE_DST_INV);
- if (m) {
- pr_debug("dst IP %pI6 NOT in range %s%pI6-%pI6\n",
- &iph->daddr,
- (info->flags & IPRANGE_DST_INV) ? "(INV) " : "",
- &info->dst_min.in6,
- &info->dst_max.in6);
+ if (m)
return false;
- }
}
return true;
}
diff --git a/net/netfilter/xt_ipvs.c b/net/netfilter/xt_ipvs.c
index 253c71cc9a634..e13c0ffb73a9a 100644
--- a/net/netfilter/xt_ipvs.c
+++ b/net/netfilter/xt_ipvs.c
@@ -148,7 +148,6 @@ ipvs_mt(const struct sk_buff *skb, struct xt_action_param *par)
out_put_cp:
__ip_vs_conn_put(cp);
out:
- pr_debug("match=%d\n", match);
return match;
}
diff --git a/net/netfilter/xt_multiport.c b/net/netfilter/xt_multiport.c
index a1691ff405d3c..bff5f53a9befb 100644
--- a/net/netfilter/xt_multiport.c
+++ b/net/netfilter/xt_multiport.c
@@ -37,7 +37,6 @@ ports_match_v1(const struct xt_multiport_v1 *minfo,
if (minfo->pflags[i]) {
/* range port matching */
e = minfo->ports[++i];
- pr_debug("src or dst matches with %d-%d?\n", s, e);
switch (minfo->flags) {
case XT_MULTIPORT_SOURCE:
@@ -58,8 +57,6 @@ ports_match_v1(const struct xt_multiport_v1 *minfo,
}
} else {
/* exact port matching */
- pr_debug("src or dst matches with %d?\n", s);
-
switch (minfo->flags) {
case XT_MULTIPORT_SOURCE:
if (src == s)
@@ -97,7 +94,6 @@ multiport_mt(const struct sk_buff *skb, struct xt_action_param *par)
/* We've been asked to examine this packet, and we
* can't. Hence, no choice but to drop.
*/
- pr_debug("Dropping evil offset=0 tinygram.\n");
par->hotdrop = true;
return false;
}
diff --git a/net/netfilter/xt_sctp.c b/net/netfilter/xt_sctp.c
index b46a6a5120583..d35c21d9651b0 100644
--- a/net/netfilter/xt_sctp.c
+++ b/net/netfilter/xt_sctp.c
@@ -48,30 +48,17 @@ match_packet(const struct sk_buff *skb,
const struct xt_sctp_flag_info *flag_info = info->flag_info;
int flag_count = info->flag_count;
-#ifdef DEBUG
- int i = 0;
-#endif
-
if (chunk_match_type == SCTP_CHUNK_MATCH_ALL)
SCTP_CHUNKMAP_COPY(chunkmapcopy, info->chunkmap);
do {
sch = skb_header_pointer(skb, offset, sizeof(_sch), &_sch);
if (sch == NULL || sch->length == 0) {
- pr_debug("Dropping invalid SCTP packet.\n");
*hotdrop = true;
return false;
}
-#ifdef DEBUG
- pr_debug("Chunk num: %d\toffset: %d\ttype: %d\tlength: %d"
- "\tflags: %x\n",
- ++i, offset, sch->type, htons(sch->length),
- sch->flags);
-#endif
offset += SCTP_PAD4(ntohs(sch->length));
- pr_debug("skb->len: %d\toffset: %d\n", skb->len, offset);
-
if (SCTP_CHUNKMAP_IS_SET(info->chunkmap, sch->type)) {
switch (chunk_match_type) {
case SCTP_CHUNK_MATCH_ANY:
@@ -121,18 +108,14 @@ sctp_mt(const struct sk_buff *skb, struct xt_action_param *par)
const struct sctphdr *sh;
struct sctphdr _sh;
- if (par->fragoff != 0) {
- pr_debug("Dropping non-first fragment.. FIXME\n");
+ if (par->fragoff != 0)
return false;
- }
sh = skb_header_pointer(skb, par->thoff, sizeof(_sh), &_sh);
if (sh == NULL) {
- pr_debug("Dropping evil TCP offset=0 tinygram.\n");
par->hotdrop = true;
return false;
}
- pr_debug("spt: %d\tdpt: %d\n", ntohs(sh->source), ntohs(sh->dest));
return SCCHECK(ntohs(sh->source) >= info->spts[0]
&& ntohs(sh->source) <= info->spts[1],
diff --git a/net/netfilter/xt_tcpudp.c b/net/netfilter/xt_tcpudp.c
index f76cf18f1a244..70608b8d06ab2 100644
--- a/net/netfilter/xt_tcpudp.c
+++ b/net/netfilter/xt_tcpudp.c
@@ -44,8 +44,6 @@ tcp_find_option(u_int8_t option,
u_int8_t _opt[60 - sizeof(struct tcphdr)];
unsigned int i;
- pr_debug("finding option\n");
-
if (!optlen)
return invert;
@@ -81,10 +79,8 @@ static bool tcp_mt(const struct sk_buff *skb, struct xt_action_param *par)
causes this. Its a cracker trying to break in by doing a
flag overwrite to pass the direction checks.
*/
- if (par->fragoff == 1) {
- pr_debug("Dropping evil TCP offset=1 frag.\n");
+ if (par->fragoff == 1)
par->hotdrop = true;
- }
/* Must not be a fragment. */
return false;
}
@@ -93,7 +89,6 @@ static bool tcp_mt(const struct sk_buff *skb, struct xt_action_param *par)
if (th == NULL) {
/* We've been asked to examine this packet, and we
can't. Hence, no choice but to drop. */
- pr_debug("Dropping evil TCP offset=0 tinygram.\n");
par->hotdrop = true;
return false;
}
@@ -145,7 +140,6 @@ static bool udp_mt(const struct sk_buff *skb, struct xt_action_param *par)
if (uh == NULL) {
/* We've been asked to examine this packet, and we
can't. Hence, no choice but to drop. */
- pr_debug("Dropping evil UDP tinygram.\n");
par->hotdrop = true;
return false;
}
|
| 3/2 | 2026/08/21 16:38 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 20951 output: 24 thoughts: 873 Thoughts: **Analyzing a Netfilter Patch Series**
Okay, so I'm looking at this patch series touching the netfilter code. It seems like a clean-up and optimization effort, mostly, but there are some areas that immediately catch my eye as potentially interesting from a fuzzing perspective.
First, I see that a declaration for `nft_set_elem_expr_clone` has been removed from `nf_tables.h`. Okay, that's straightforward. Then there's the usual housekeeping in a bunch of files: replacing `pr_debug` with `pr_info_ratelimited` or removing them altogether to reduce verbosity. Same with the `WARN_ON` to `DEBUG_NET_WARN_ON_ONCE` transitions, and the `WARN_ON_ONCE` to `unlikely` plus `DEBUG_NET_WARN_ON_ONCE(1)`. Standard stuff, nothing too worrisome on its own.
Now, the more substantial changes are in `nf_tables_api.c`. It looks like the signature of `hook_is_prefix` has changed, which could have ripple effects. The logic for `nft_hook_list_find` has been tweaked. The `nft_set_elem_expr_clone` removal is re-iterated here, as well as modifications to the signatures of `nft_set_elem_expr_setup` (with the addition of `bool override_exprs`) and `nft_add_set_elem` to handle it. Changes in `nft_set_commit_update` for `NFT_MSG_DELSET` and `NFT_MSG_DESTROYSET` and the reordering of `nft_flow_rule_offload_commit` within `nf_tables_commit` are also present. These modifications, particularly around the set element handling, could expose new edge cases.
There are also alterations to `nft_dynset.c`, with the logic of `nft_dynset_init` and `nft_dynset_destroy` being adjusted to accommodate `override_exprs`. And finally, in `nft_set_pipapo_avx2.c`, the `pipapo_get_avx2` logic has been modified and it now contains the `asm volatile("vzeroupper");` instruction. The AVX2 optimization changes are intriguing but the other functional changes are what warrant closer scrutiny.
My gut feeling is that the modifications in `nf_tables_api.c`, `nft_dynset.c`, and `nft_set_pipapo_avx2.c` are the areas that are most likely to introduce regressions. Specifically, I'm thinking about those changes related to `nft_add_set_elem`, `nf_tables_commit`, `nft_dynset_init`, and the `pipapo_get_avx2`. Those are definitely worth fuzzing.
I should also make sure the config options are correct:
`nft_dynset.c` is probably `CONFIG_NFT_DYNSET` - seems likely. I should probably double-check the config options for `nft_set_pipapo_avx2.c`. Is that just part of `CONFIG_NF_TABLES`? I should probably check that one.
|
| 4/2 | 2026/08/21 16:38 | tool | grepper |
0mArgs:{
"Expression": "nft_set_pipapo_avx2"
}Results: {
"Output": "include/net/netfilter/nf_tables_core.h=93=extern const struct nft_set_type nft_set_pipapo_type;\ninclude/net/netfilter/nf_tables_core.h:94:extern const struct nft_set_type nft_set_pipapo_avx2_type;\ninclude/net/netfilter/nf_tables_core.h-95-\n--\nnet/netfilter/Makefile=97=ifndef CONFIG_UML\nnet/netfilter/Makefile:98:nf_tables-objs += nft_set_pipapo_avx2.o\nnet/netfilter/Makefile-99-endif\n--\nnet/netfilter/nf_tables_api.c=4654=static const struct nft_set_type *nft_set_types[] = {\n--\nnet/netfilter/nf_tables_api.c-4660-#if defined(CONFIG_X86_64) \u0026\u0026 !defined(CONFIG_UML)\nnet/netfilter/nf_tables_api.c:4661:\t\u0026nft_set_pipapo_avx2_type,\nnet/netfilter/nf_tables_api.c-4662-#endif\n--\nnet/netfilter/nft_lookup.c=28=__nft_set_do_lookup(const struct net *net, const struct nft_set *set,\n--\nnet/netfilter/nft_lookup.c-45-#if defined(CONFIG_X86_64) \u0026\u0026 !defined(CONFIG_UML)\nnet/netfilter/nft_lookup.c:46:\tif (set-\u003eops == \u0026nft_set_pipapo_avx2_type.ops)\nnet/netfilter/nft_lookup.c-47-\t\treturn nft_pipapo_avx2_lookup(net, set, key);\n--\nnet/netfilter/nft_set_pipapo.c-341-\nnet/netfilter/nft_set_pipapo.c:342:#include \"nft_set_pipapo_avx2.h\"\nnet/netfilter/nft_set_pipapo.c-343-#include \"nft_set_pipapo.h\"\n--\nnet/netfilter/nft_set_pipapo.c=2418=const struct nft_set_type nft_set_pipapo_type = {\n--\nnet/netfilter/nft_set_pipapo.c-2442-#if defined(CONFIG_X86_64) \u0026\u0026 !defined(CONFIG_UML)\nnet/netfilter/nft_set_pipapo.c:2443:const struct nft_set_type nft_set_pipapo_avx2_type = {\nnet/netfilter/nft_set_pipapo.c-2444-\t.features\t= NFT_SET_INTERVAL | NFT_SET_MAP | NFT_SET_OBJECT |\n--\nnet/netfilter/nft_set_pipapo_avx2.c-23-\nnet/netfilter/nft_set_pipapo_avx2.c:24:#include \"nft_set_pipapo_avx2.h\"\nnet/netfilter/nft_set_pipapo_avx2.c-25-#include \"nft_set_pipapo.h\"\n"
} |
| 5/2 | 2026/08/21 16:38 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 23338 output: 20 thoughts: 44 Thoughts: Okay, here's my take on those considerations: **Delving into Netfilter's Configuration Options** Alright, let's see, when dealing with Netfilter configuration for advanced features, the primary flag to scrutinize is definitely `CONFIG_NF_TABLES`. That's the core. Then, if we're looking at something specific to dynamic sets, I'll need to remember `CONFIG_NFT_DYNSET` as well. That one's crucial for understanding the dynamic set functionality. I should really dive into the Kconfig for `nft_dynset.c` to gain a deeper insight into the configuration options and dependencies there. Gotta make sure I'm setting everything up correctly. |
| 6/2 | 2026/08/21 16:38 | tool | grepper |
0mError:no matches Args: {
"Expression": "config NFT_DYNSET"
}Results: {
"error": "no matches"
} |
| 7/2 | 2026/08/21 16:38 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 23565 output: 19 thoughts: 17 Thoughts: Here's a summary of my thought process: **Kconfig Hunt for Dynset** Okay, so I need to find the configuration options related to `dynset`. My first instinct is to dive into the core netfilter configuration. I'm going to check the `net/netfilter/Kconfig` file. That's usually the go-to place for netfilter-related options, and I'm hoping I can find the relevant `dynset` options listed there. This is a common pattern for navigating the kernel configuration, starting with the most likely location and branching out if I don't find what I need. Let's see what `Kconfig` reveals... |
| 8/2 | 2026/08/21 16:38 | tool | grepper |
0mArgs:{
"Expression": "NFT_DYNSET"
}Results: {
"Output": "include/uapi/linux/netfilter/nf_tables.h=755=enum nft_dynset_ops {\ninclude/uapi/linux/netfilter/nf_tables.h:756:\tNFT_DYNSET_OP_ADD,\ninclude/uapi/linux/netfilter/nf_tables.h:757:\tNFT_DYNSET_OP_UPDATE,\ninclude/uapi/linux/netfilter/nf_tables.h:758:\tNFT_DYNSET_OP_DELETE,\ninclude/uapi/linux/netfilter/nf_tables.h-759-};\n--\ninclude/uapi/linux/netfilter/nf_tables.h=761=enum nft_dynset_flags {\ninclude/uapi/linux/netfilter/nf_tables.h:762:\tNFT_DYNSET_F_INV\t= (1 \u003c\u003c 0),\ninclude/uapi/linux/netfilter/nf_tables.h:763:\tNFT_DYNSET_F_EXPR\t= (1 \u003c\u003c 1),\ninclude/uapi/linux/netfilter/nf_tables.h-764-};\n--\nnet/netfilter/nft_dynset.c=90=void nft_dynset_eval(const struct nft_expr *expr,\n--\nnet/netfilter/nft_dynset.c-97-\nnet/netfilter/nft_dynset.c:98:\tif (priv-\u003eop == NFT_DYNSET_OP_DELETE) {\nnet/netfilter/nft_dynset.c-99-\t\tset-\u003eops-\u003edelete(set, \u0026regs-\u003edata[priv-\u003esreg_key]);\n--\nnet/netfilter/nft_dynset.c-104-\tif (ext) {\nnet/netfilter/nft_dynset.c:105:\t\tif (priv-\u003eop == NFT_DYNSET_OP_UPDATE \u0026\u0026\nnet/netfilter/nft_dynset.c-106-\t\t nft_set_ext_exists(ext, NFT_SET_EXT_TIMEOUT) \u0026\u0026\n--\nnet/netfilter/nft_dynset.c=158=static const struct nla_policy nft_dynset_policy[NFTA_DYNSET_MAX + 1] = {\n--\nnet/netfilter/nft_dynset.c-166-\t[NFTA_DYNSET_EXPR]\t= { .type = NLA_NESTED },\nnet/netfilter/nft_dynset.c:167:\t[NFTA_DYNSET_FLAGS]\t= NLA_POLICY_MASK(NLA_BE32, NFT_DYNSET_F_INV |\nnet/netfilter/nft_dynset.c:168:\t\t\t\t\t\t NFT_DYNSET_F_EXPR),\nnet/netfilter/nft_dynset.c-169-\t[NFTA_DYNSET_EXPRESSIONS] = { .type = NLA_NESTED },\n--\nnet/netfilter/nft_dynset.c=172=static int nft_dynset_init(const struct nft_ctx *ctx,\n--\nnet/netfilter/nft_dynset.c-191-\t\tu32 flags = ntohl(nla_get_be32(tb[NFTA_DYNSET_FLAGS]));\nnet/netfilter/nft_dynset.c:192:\t\tif (flags \u0026 ~(NFT_DYNSET_F_INV | NFT_DYNSET_F_EXPR))\nnet/netfilter/nft_dynset.c-193-\t\t\treturn -EOPNOTSUPP;\nnet/netfilter/nft_dynset.c:194:\t\tif (flags \u0026 NFT_DYNSET_F_INV)\nnet/netfilter/nft_dynset.c-195-\t\t\tpriv-\u003einvert = true;\nnet/netfilter/nft_dynset.c:196:\t\tif (flags \u0026 NFT_DYNSET_F_EXPR)\nnet/netfilter/nft_dynset.c-197-\t\t\tpriv-\u003eexpr = true;\n--\nnet/netfilter/nft_dynset.c-215-\tpriv-\u003eop = ntohl(nla_get_be32(tb[NFTA_DYNSET_OP]));\nnet/netfilter/nft_dynset.c:216:\tif (priv-\u003eop \u003e NFT_DYNSET_OP_DELETE)\nnet/netfilter/nft_dynset.c-217-\t\treturn -EOPNOTSUPP;\n--\nnet/netfilter/nft_dynset.c=381=static int nft_dynset_dump(struct sk_buff *skb,\n--\nnet/netfilter/nft_dynset.c-384-\tconst struct nft_dynset *priv = nft_expr_priv(expr);\nnet/netfilter/nft_dynset.c:385:\tu32 flags = priv-\u003einvert ? NFT_DYNSET_F_INV : 0;\nnet/netfilter/nft_dynset.c-386-\tint i;\n"
} |
| 9/2 | 2026/08/21 16:38 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 24978 output: 18 thoughts: 35 Thoughts: Okay, here's my interpretation of that thought process, assuming I'm the expert and considering how I'd approach it: **Investigating the nftables Dynamic Set Module Connection** Right, so `nft_dynset.c`… that rings a bell. It's almost certainly connected to the Network Address Translation (NAT) functionality within nftables. I need to quickly confirm that, though. My instinct says it's likely part of `CONFIG_NFT_NAT` or a similar configuration option. To be absolutely sure, the logical first step is to dive into the `net/netfilter/Makefile`. That's where all the build configurations for the netfilter subsystem are declared. I'll find the dependencies and the relevant include paths in there. It's the most efficient way to trace the relationship between `nft_dynset.c` and potentially `CONFIG_NFT_NAT` or any other relevant configurations. No need to waste time guessing; the Makefile will give me the definitive answer. |
| 10/2 | 2026/08/21 16:38 | tool | grepper |
0mArgs:{
"Expression": "nft_dynset"
}Results: {
"Output": "include/net/netfilter/nf_tables_core.h=14=extern struct nft_expr_type nft_payload_type;\ninclude/net/netfilter/nf_tables_core.h:15:extern struct nft_expr_type nft_dynset_type;\ninclude/net/netfilter/nf_tables_core.h-16-extern struct nft_expr_type nft_range_type;\n--\ninclude/net/netfilter/nf_tables_core.h=146=void nft_byteorder_eval(const struct nft_expr *expr,\ninclude/net/netfilter/nf_tables_core.h-147-\t\t\tstruct nft_regs *regs, const struct nft_pktinfo *pkt);\ninclude/net/netfilter/nf_tables_core.h:148:void nft_dynset_eval(const struct nft_expr *expr,\ninclude/net/netfilter/nf_tables_core.h-149-\t\t struct nft_regs *regs, const struct nft_pktinfo *pkt);\n--\ninclude/net/netfilter/nf_tables_core.h=183=void nft_objref_map_eval(const struct nft_expr *expr, struct nft_regs *regs,\ninclude/net/netfilter/nf_tables_core.h-184-\t\t\t const struct nft_pktinfo *pkt);\ninclude/net/netfilter/nf_tables_core.h:185:struct nft_elem_priv *nft_dynset_new(struct nft_set *set,\ninclude/net/netfilter/nf_tables_core.h-186-\t\t\t\t const struct nft_expr *expr,\n--\ninclude/uapi/linux/netfilter/nf_tables.h=744=enum nft_lookup_attributes {\n--\ninclude/uapi/linux/netfilter/nf_tables.h-754-\ninclude/uapi/linux/netfilter/nf_tables.h:755:enum nft_dynset_ops {\ninclude/uapi/linux/netfilter/nf_tables.h-756-\tNFT_DYNSET_OP_ADD,\n--\ninclude/uapi/linux/netfilter/nf_tables.h-760-\ninclude/uapi/linux/netfilter/nf_tables.h:761:enum nft_dynset_flags {\ninclude/uapi/linux/netfilter/nf_tables.h-762-\tNFT_DYNSET_F_INV\t= (1 \u003c\u003c 0),\n--\ninclude/uapi/linux/netfilter/nf_tables.h-766-/**\ninclude/uapi/linux/netfilter/nf_tables.h:767: * enum nft_dynset_attributes - dynset expression attributes\ninclude/uapi/linux/netfilter/nf_tables.h-768- *\n--\ninclude/uapi/linux/netfilter/nf_tables.h-778- */\ninclude/uapi/linux/netfilter/nf_tables.h:779:enum nft_dynset_attributes {\ninclude/uapi/linux/netfilter/nf_tables.h-780-\tNFTA_DYNSET_UNSPEC,\n--\nnet/netfilter/Makefile=87=nf_tables-objs := nf_tables_core.o nf_tables_api.o nft_chain_filter.o \\\n--\nnet/netfilter/Makefile-89-\t\t nft_bitwise.o nft_byteorder.o nft_payload.o nft_lookup.o \\\nnet/netfilter/Makefile:90:\t\t nft_dynset.o nft_meta.o nft_rt.o nft_exthdr.o nft_last.o \\\nnet/netfilter/Makefile-91-\t\t nft_counter.o nft_objref.o nft_inner.o \\\n--\nnet/netfilter/nf_tables_core.c=203=static void expr_call_ops_eval(const struct nft_expr *expr,\n--\nnet/netfilter/nf_tables_core.c-228-\tX(e, nft_byteorder_eval);\nnet/netfilter/nf_tables_core.c:229:\tX(e, nft_dynset_eval);\nnet/netfilter/nf_tables_core.c-230-\tX(e, nft_rt_get_eval);\n--\nnet/netfilter/nf_tables_core.c=352=static struct nft_expr_type *nft_basic_types[] = {\n--\nnet/netfilter/nf_tables_core.c-358-\t\u0026nft_payload_type,\nnet/netfilter/nf_tables_core.c:359:\t\u0026nft_dynset_type,\nnet/netfilter/nf_tables_core.c-360-\t\u0026nft_range_type,\n--\nnet/netfilter/nft_dynset.c-14-\nnet/netfilter/nft_dynset.c:15:struct nft_dynset {\nnet/netfilter/nft_dynset.c-16-\tstruct nft_set\t\t\t*set;\nnet/netfilter/nft_dynset.c-17-\tstruct nft_set_ext_tmpl\t\ttmpl;\nnet/netfilter/nft_dynset.c:18:\tenum nft_dynset_ops\t\top:8;\nnet/netfilter/nft_dynset.c-19-\tu8\t\t\t\tsreg_key;\n--\nnet/netfilter/nft_dynset.c-29-\nnet/netfilter/nft_dynset.c:30:static int nft_dynset_expr_setup(const struct nft_dynset *priv,\nnet/netfilter/nft_dynset.c-31-\t\t\t\t const struct nft_set_ext *ext)\n--\nnet/netfilter/nft_dynset.c-55-\nnet/netfilter/nft_dynset.c:56:struct nft_elem_priv *nft_dynset_new(struct nft_set *set,\nnet/netfilter/nft_dynset.c-57-\t\t\t\t const struct nft_expr *expr,\n--\nnet/netfilter/nft_dynset.c-59-{\nnet/netfilter/nft_dynset.c:60:\tconst struct nft_dynset *priv = nft_expr_priv(expr);\nnet/netfilter/nft_dynset.c-61-\tstruct nft_set_ext *ext;\n--\nnet/netfilter/nft_dynset.c-76-\text = nft_set_elem_ext(set, elem_priv);\nnet/netfilter/nft_dynset.c:77:\tif (priv-\u003enum_exprs \u0026\u0026 nft_dynset_expr_setup(priv, ext) \u003c 0)\nnet/netfilter/nft_dynset.c-78-\t\tgoto err2;\n--\nnet/netfilter/nft_dynset.c-89-\nnet/netfilter/nft_dynset.c:90:void nft_dynset_eval(const struct nft_expr *expr,\nnet/netfilter/nft_dynset.c-91-\t\t struct nft_regs *regs, const struct nft_pktinfo *pkt)\nnet/netfilter/nft_dynset.c-92-{\nnet/netfilter/nft_dynset.c:93:\tconst struct nft_dynset *priv = nft_expr_priv(expr);\nnet/netfilter/nft_dynset.c-94-\tstruct nft_set *set = priv-\u003eset;\n--\nnet/netfilter/nft_dynset.c-122-\nnet/netfilter/nft_dynset.c:123:static void nft_dynset_ext_add_expr(struct nft_dynset *priv)\nnet/netfilter/nft_dynset.c-124-{\n--\nnet/netfilter/nft_dynset.c=135=static struct nft_expr *\nnet/netfilter/nft_dynset.c:136:nft_dynset_expr_alloc(const struct nft_ctx *ctx, const struct nft_set *set,\nnet/netfilter/nft_dynset.c-137-\t\t const struct nlattr *attr, int pos)\n--\nnet/netfilter/nft_dynset.c-157-\nnet/netfilter/nft_dynset.c:158:static const struct nla_policy nft_dynset_policy[NFTA_DYNSET_MAX + 1] = {\nnet/netfilter/nft_dynset.c-159-\t[NFTA_DYNSET_SET_NAME]\t= { .type = NLA_STRING,\n--\nnet/netfilter/nft_dynset.c-171-\nnet/netfilter/nft_dynset.c:172:static int nft_dynset_init(const struct nft_ctx *ctx,\nnet/netfilter/nft_dynset.c-173-\t\t\t const struct nft_expr *expr,\n--\nnet/netfilter/nft_dynset.c-176-\tstruct nftables_pernet *nft_net = nft_pernet(ctx-\u003enet);\nnet/netfilter/nft_dynset.c:177:\tstruct nft_dynset *priv = nft_expr_priv(expr);\nnet/netfilter/nft_dynset.c-178-\tu8 genmask = nft_genmask_next(ctx-\u003enet);\n--\nnet/netfilter/nft_dynset.c-253-\nnet/netfilter/nft_dynset.c:254:\t\tdynset_expr = nft_dynset_expr_alloc(ctx, set,\nnet/netfilter/nft_dynset.c-255-\t\t\t\t\t\t tb[NFTA_DYNSET_EXPR], 0);\n--\nnet/netfilter/nft_dynset.c-286-\t\t\t}\nnet/netfilter/nft_dynset.c:287:\t\t\tdynset_expr = nft_dynset_expr_alloc(ctx, set, tmp, i);\nnet/netfilter/nft_dynset.c-288-\t\t\tif (IS_ERR(dynset_expr)) {\n--\nnet/netfilter/nft_dynset.c-324-\tif (priv-\u003enum_exprs)\nnet/netfilter/nft_dynset.c:325:\t\tnft_dynset_ext_add_expr(priv);\nnet/netfilter/nft_dynset.c-326-\n--\nnet/netfilter/nft_dynset.c-350-\nnet/netfilter/nft_dynset.c:351:static void nft_dynset_deactivate(const struct nft_ctx *ctx,\nnet/netfilter/nft_dynset.c-352-\t\t\t\t const struct nft_expr *expr,\n--\nnet/netfilter/nft_dynset.c-354-{\nnet/netfilter/nft_dynset.c:355:\tstruct nft_dynset *priv = nft_expr_priv(expr);\nnet/netfilter/nft_dynset.c-356-\n--\nnet/netfilter/nft_dynset.c-359-\nnet/netfilter/nft_dynset.c:360:static void nft_dynset_activate(const struct nft_ctx *ctx,\nnet/netfilter/nft_dynset.c-361-\t\t\t\tconst struct nft_expr *expr)\nnet/netfilter/nft_dynset.c-362-{\nnet/netfilter/nft_dynset.c:363:\tstruct nft_dynset *priv = nft_expr_priv(expr);\nnet/netfilter/nft_dynset.c-364-\n--\nnet/netfilter/nft_dynset.c-367-\nnet/netfilter/nft_dynset.c:368:static void nft_dynset_destroy(const struct nft_ctx *ctx,\nnet/netfilter/nft_dynset.c-369-\t\t\t const struct nft_expr *expr)\nnet/netfilter/nft_dynset.c-370-{\nnet/netfilter/nft_dynset.c:371:\tstruct nft_dynset *priv = nft_expr_priv(expr);\nnet/netfilter/nft_dynset.c-372-\tint i;\n--\nnet/netfilter/nft_dynset.c-380-\nnet/netfilter/nft_dynset.c:381:static int nft_dynset_dump(struct sk_buff *skb,\nnet/netfilter/nft_dynset.c-382-\t\t\t const struct nft_expr *expr, bool reset)\nnet/netfilter/nft_dynset.c-383-{\nnet/netfilter/nft_dynset.c:384:\tconst struct nft_dynset *priv = nft_expr_priv(expr);\nnet/netfilter/nft_dynset.c-385-\tu32 flags = priv-\u003einvert ? NFT_DYNSET_F_INV : 0;\n--\nnet/netfilter/nft_dynset.c-428-\nnet/netfilter/nft_dynset.c:429:static const struct nft_expr_ops nft_dynset_ops = {\nnet/netfilter/nft_dynset.c:430:\t.type\t\t= \u0026nft_dynset_type,\nnet/netfilter/nft_dynset.c:431:\t.size\t\t= NFT_EXPR_SIZE(sizeof(struct nft_dynset)),\nnet/netfilter/nft_dynset.c:432:\t.eval\t\t= nft_dynset_eval,\nnet/netfilter/nft_dynset.c:433:\t.init\t\t= nft_dynset_init,\nnet/netfilter/nft_dynset.c:434:\t.destroy\t= nft_dynset_destroy,\nnet/netfilter/nft_dynset.c:435:\t.activate\t= nft_dynset_activate,\nnet/netfilter/nft_dynset.c:436:\t.deactivate\t= nft_dynset_deactivate,\nnet/netfilter/nft_dynset.c:437:\t.dump\t\t= nft_dynset_dump,\nnet/netfilter/nft_dynset.c-438-};\nnet/netfilter/nft_dynset.c-439-\nnet/netfilter/nft_dynset.c:440:struct nft_expr_type nft_dynset_type __read_mostly = {\nnet/netfilter/nft_dynset.c-441-\t.name\t\t= \"dynset\",\nnet/netfilter/nft_dynset.c:442:\t.ops\t\t= \u0026nft_dynset_ops,\nnet/netfilter/nft_dynset.c:443:\t.policy\t\t= nft_dynset_policy,\nnet/netfilter/nft_dynset.c-444-\t.maxattr\t= NFTA_DYNSET_MAX,\n--\nnet/netfilter/nft_set_hash.c=126=nft_rhash_update(struct nft_set *set, const u32 *key,\n--\nnet/netfilter/nft_set_hash.c-142-\nnet/netfilter/nft_set_hash.c:143:\telem_priv = nft_dynset_new(set, expr, regs);\nnet/netfilter/nft_set_hash.c-144-\tif (!elem_priv)\n"
} |
| 11/2 | 2026/08/21 16:38 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 29013 output: 21 thoughts: 279 Thoughts: **Analyzing the NF Tables Changes** Okay, so I'm looking into the modifications related to `nft_dynset.c`, which is compiled when `CONFIG_NF_TABLES` is enabled – makes sense. Let's see what has changed within `nf_tables_api.c`. It looks like `nft_add_set_elem`, `nf_tables_commit`, and `nft_dynset_init` have all seen some action, plus `pipapo_get_avx2`. Right, so I should focus on those functions: `nft_add_set_elem`, `nf_tables_commit`, `nft_dynset_init`, and `pipapo_get_avx2` for understanding the impact. Hold on, `pipapo_get_avx2` – isn't that in `nft_set_pipapo_avx2.c`? Okay, let's confirm. Good, it's not a static function: `struct nft_pipapo_elem *pipapo_get_avx2(...)`. This makes it accessible from other parts of the module. Now, checking `nft_add_set_elem`. Okay, so it's a static function. Wait, it's defined static in `nf_tables_api.c`. Right, let's go back and examine `nf_tables_api.c` more closely for that function. |
| 12/2 | 2026/08/21 16:39 | tool | grepper |
0mArgs:{
"Expression": "nft_add_set_elem"
}Results: {
"Output": "net/netfilter/nf_tables_api.c=7227=static u32 nft_set_maxsize(const struct nft_set *set)\n--\nnet/netfilter/nf_tables_api.c-7247-\nnet/netfilter/nf_tables_api.c:7248:static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,\nnet/netfilter/nf_tables_api.c-7249-\t\t\t const struct nlattr *attr, u32 nlmsg_flags)\n--\nnet/netfilter/nf_tables_api.c=7667=static int nf_tables_newsetelem(struct sk_buff *skb,\n--\nnet/netfilter/nf_tables_api.c-7704-\tnla_for_each_nested(attr, nla[NFTA_SET_ELEM_LIST_ELEMENTS], rem) {\nnet/netfilter/nf_tables_api.c:7705:\t\terr = nft_add_set_elem(\u0026ctx, set, attr, info-\u003enlh-\u003enlmsg_flags);\nnet/netfilter/nf_tables_api.c-7706-\t\tif (err \u003c 0) {\n"
} |
| 13/2 | 2026/08/21 16:39 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 29933 output: 20 thoughts: 46 Thoughts: Okay, here's my take on those thoughts, framed as an expert's internal monologue: **Diving into the Netfilter Tables Code** Alright, so I'm digging into this new Netfilter Tables functionality, and my starting point is the `nf_tables_newsetelem` function. That seems like the logical entry point for, well, adding a new element to a set. Let me take a look at the initialization process now. Ah, `nft_dynset_init`... that's a static function, which is useful to know. And the likely important data structure is `nft_dynset_ops`, the ops vector. I'm going to want to take a close look at this, as that's where the core operations, like adding and deleting elements, are likely defined. |
| 14/2 | 2026/08/21 16:39 | tool | grepper |
0mArgs:{
"Expression": "nft_dynset_init"
}Results: {
"Output": "net/netfilter/nft_dynset.c=158=static const struct nla_policy nft_dynset_policy[NFTA_DYNSET_MAX + 1] = {\n--\nnet/netfilter/nft_dynset.c-171-\nnet/netfilter/nft_dynset.c:172:static int nft_dynset_init(const struct nft_ctx *ctx,\nnet/netfilter/nft_dynset.c-173-\t\t\t const struct nft_expr *expr,\n--\nnet/netfilter/nft_dynset.c=429=static const struct nft_expr_ops nft_dynset_ops = {\n--\nnet/netfilter/nft_dynset.c-432-\t.eval\t\t= nft_dynset_eval,\nnet/netfilter/nft_dynset.c:433:\t.init\t\t= nft_dynset_init,\nnet/netfilter/nft_dynset.c-434-\t.destroy\t= nft_dynset_destroy,\n"
} |
| 15/2 | 2026/08/21 16:39 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 30432 output: 19 thoughts: 55 Thoughts: Here's my summary, as if I were thinking it: **Digging into the NFTables Initialization** Okay, so I'm tracing the initialization of these NFTables expressions. It looks like `nft_dynset_init` gets called through the standard `nft_expr_ops->init` mechanism. Right, that makes sense. The key entry point to look at for how this all gets started seems to be `nf_tables_newexpr` or something analogous. That's usually where these things get wired in. Now, let me shift gears and check the commit process, just to get a sense of the lifecycle. I need to understand how the expressions are finalized. Hmm, `nf_tables_commit` is not static, which means it's available outside the immediate context. That tells me something about its scope and how it's intended to be used. I should see if I can figure out its role in relation to these initializations. |
| 16/2 | 2026/08/21 16:39 | tool | grepper |
0mArgs:{
"Expression": "nf_tables_commit"
}Results: {
"Output": "net/netfilter/nf_tables_api.c=10301=EXPORT_SYMBOL_GPL(nf_tables_trans_destroy_flush_work);\nnet/netfilter/nf_tables_api.c-10302-\nnet/netfilter/nf_tables_api.c:10303:static int nf_tables_commit_chain_prepare(struct net *net, struct nft_chain *chain)\nnet/netfilter/nf_tables_api.c-10304-{\n--\nnet/netfilter/nf_tables_api.c-10377-\nnet/netfilter/nf_tables_api.c:10378:static void nf_tables_commit_chain_prepare_cancel(struct net *net)\nnet/netfilter/nf_tables_api.c-10379-{\n--\nnet/netfilter/nf_tables_api.c-10393-\nnet/netfilter/nf_tables_api.c:10394:static void __nf_tables_commit_chain_free_rules(struct rcu_head *h)\nnet/netfilter/nf_tables_api.c-10395-{\n--\nnet/netfilter/nf_tables_api.c-10400-\nnet/netfilter/nf_tables_api.c:10401:static void nf_tables_commit_chain_free_rules_old(struct nft_rule_blob *blob)\nnet/netfilter/nf_tables_api.c-10402-{\n--\nnet/netfilter/nf_tables_api.c-10408-\nnet/netfilter/nf_tables_api.c:10409:\tcall_rcu(\u0026last-\u003eh, __nf_tables_commit_chain_free_rules);\nnet/netfilter/nf_tables_api.c-10410-}\nnet/netfilter/nf_tables_api.c-10411-\nnet/netfilter/nf_tables_api.c:10412:static void nf_tables_commit_chain(struct net *net, struct nft_chain *chain)\nnet/netfilter/nf_tables_api.c-10413-{\n--\nnet/netfilter/nf_tables_api.c-10434-\t\t\trcu_assign_pointer(chain-\u003eblob_gen_1, g0);\nnet/netfilter/nf_tables_api.c:10435:\t\t\tnf_tables_commit_chain_free_rules_old(g1);\nnet/netfilter/nf_tables_api.c-10436-\t\t} else {\nnet/netfilter/nf_tables_api.c-10437-\t\t\trcu_assign_pointer(chain-\u003eblob_gen_0, g1);\nnet/netfilter/nf_tables_api.c:10438:\t\t\tnf_tables_commit_chain_free_rules_old(g0);\nnet/netfilter/nf_tables_api.c-10439-\t\t}\n--\nnet/netfilter/nf_tables_api.c-10454-\tif (next_genbit)\nnet/netfilter/nf_tables_api.c:10455:\t\tnf_tables_commit_chain_free_rules_old(g1);\nnet/netfilter/nf_tables_api.c-10456-\telse\nnet/netfilter/nf_tables_api.c:10457:\t\tnf_tables_commit_chain_free_rules_old(g0);\nnet/netfilter/nf_tables_api.c-10458-}\n--\nnet/netfilter/nf_tables_api.c=10707=static void nf_tables_module_autoload_cleanup(struct net *net)\n--\nnet/netfilter/nf_tables_api.c-10719-\nnet/netfilter/nf_tables_api.c:10720:static void nf_tables_commit_release(struct net *net)\nnet/netfilter/nf_tables_api.c-10721-{\n--\nnet/netfilter/nf_tables_api.c=10754=static void nft_commit_notify(struct net *net, u32 portid)\n--\nnet/netfilter/nf_tables_api.c-10789-\nnet/netfilter/nf_tables_api.c:10790:static int nf_tables_commit_audit_alloc(struct list_head *adl,\nnet/netfilter/nf_tables_api.c-10791-\t\t\t\t\tstruct nft_table *table)\n--\nnet/netfilter/nf_tables_api.c-10806-\nnet/netfilter/nf_tables_api.c:10807:static void nf_tables_commit_audit_free(struct list_head *adl)\nnet/netfilter/nf_tables_api.c-10808-{\n--\nnet/netfilter/nf_tables_api.c-10819- */\nnet/netfilter/nf_tables_api.c:10820:static unsigned int nf_tables_commit_audit_entrycount(const struct nft_trans *trans)\nnet/netfilter/nf_tables_api.c-10821-{\n--\nnet/netfilter/nf_tables_api.c-10830-\nnet/netfilter/nf_tables_api.c:10831:static void nf_tables_commit_audit_collect(struct list_head *adl,\nnet/netfilter/nf_tables_api.c-10832-\t\t\t\t\t const struct nft_trans *trans, u32 op)\n--\nnet/netfilter/nf_tables_api.c-10843-found:\nnet/netfilter/nf_tables_api.c:10844:\tadp-\u003eentries += nf_tables_commit_audit_entrycount(trans);\nnet/netfilter/nf_tables_api.c-10845-\tif (!adp-\u003eop || adp-\u003eop \u003e op)\n--\nnet/netfilter/nf_tables_api.c-10850-\nnet/netfilter/nf_tables_api.c:10851:static void nf_tables_commit_audit_log(struct list_head *adl, u32 generation)\nnet/netfilter/nf_tables_api.c-10852-{\n--\nnet/netfilter/nf_tables_api.c=10915=static void nft_gc_seq_end(struct nftables_pernet *nft_net, unsigned int gc_seq)\n--\nnet/netfilter/nf_tables_api.c-10919-\nnet/netfilter/nf_tables_api.c:10920:static int nf_tables_commit(struct net *net, struct sk_buff *skb)\nnet/netfilter/nf_tables_api.c-10921-{\n--\nnet/netfilter/nf_tables_api.c-10976-\nnet/netfilter/nf_tables_api.c:10977:\t\tret = nf_tables_commit_audit_alloc(\u0026adl, table);\nnet/netfilter/nf_tables_api.c-10978-\t\tif (ret) {\nnet/netfilter/nf_tables_api.c:10979:\t\t\tnf_tables_commit_chain_prepare_cancel(net);\nnet/netfilter/nf_tables_api.c:10980:\t\t\tnf_tables_commit_audit_free(\u0026adl);\nnet/netfilter/nf_tables_api.c-10981-\t\t\treturn ret;\n--\nnet/netfilter/nf_tables_api.c-10986-\nnet/netfilter/nf_tables_api.c:10987:\t\t\tret = nf_tables_commit_chain_prepare(net, chain);\nnet/netfilter/nf_tables_api.c-10988-\t\t\tif (ret \u003c 0) {\nnet/netfilter/nf_tables_api.c:10989:\t\t\t\tnf_tables_commit_chain_prepare_cancel(net);\nnet/netfilter/nf_tables_api.c:10990:\t\t\t\tnf_tables_commit_audit_free(\u0026adl);\nnet/netfilter/nf_tables_api.c-10991-\t\t\t\treturn ret;\n--\nnet/netfilter/nf_tables_api.c-11000-\tif (err \u003c 0) {\nnet/netfilter/nf_tables_api.c:11001:\t\tnf_tables_commit_chain_prepare_cancel(net);\nnet/netfilter/nf_tables_api.c:11002:\t\tnf_tables_commit_audit_free(\u0026adl);\nnet/netfilter/nf_tables_api.c-11003-\t\treturn err;\n--\nnet/netfilter/nf_tables_api.c-11010-\t\tlist_for_each_entry(chain, \u0026table-\u003echains, list)\nnet/netfilter/nf_tables_api.c:11011:\t\t\tnf_tables_commit_chain(net, chain);\nnet/netfilter/nf_tables_api.c-11012-\t}\n--\nnet/netfilter/nf_tables_api.c-11034-\nnet/netfilter/nf_tables_api.c:11035:\t\tnf_tables_commit_audit_collect(\u0026adl, trans, trans-\u003emsg_type);\nnet/netfilter/nf_tables_api.c-11036-\t\tswitch (trans-\u003emsg_type) {\n--\nnet/netfilter/nf_tables_api.c-11219-\tnf_tables_gen_notify(net, skb, NFT_MSG_NEWGEN);\nnet/netfilter/nf_tables_api.c:11220:\tnf_tables_commit_audit_log(\u0026adl, nft_base_seq(net));\nnet/netfilter/nf_tables_api.c-11221-\n--\nnet/netfilter/nf_tables_api.c-11223-\tnft_net-\u003evalidate_state = NFT_VALIDATE_SKIP;\nnet/netfilter/nf_tables_api.c:11224:\tnf_tables_commit_release(net);\nnet/netfilter/nf_tables_api.c-11225-\n--\nnet/netfilter/nf_tables_api.c=11544=static const struct nfnetlink_subsystem nf_tables_subsys = {\n--\nnet/netfilter/nf_tables_api.c-11548-\t.cb\t\t= nf_tables_cb,\nnet/netfilter/nf_tables_api.c:11549:\t.commit\t\t= nf_tables_commit,\nnet/netfilter/nf_tables_api.c-11550-\t.abort\t\t= nf_tables_abort,\n--\nnet/netfilter/nft_lookup.c=58=static unsigned int nft_base_seq(const struct net *net)\nnet/netfilter/nft_lookup.c-59-{\nnet/netfilter/nft_lookup.c:60:\t/* pairs with smp_store_release() in nf_tables_commit() */\nnet/netfilter/nft_lookup.c-61-\treturn smp_load_acquire(\u0026net-\u003enft.base_seq);\n--\nnet/netfilter/nft_lookup.c=70=nft_set_do_lookup(const struct net *net, const struct nft_set *set,\n--\nnet/netfilter/nft_lookup.c-82-\t\t/* No match? There is a small chance that lookup was\nnet/netfilter/nft_lookup.c:83:\t\t * performed in the old generation, but nf_tables_commit()\nnet/netfilter/nft_lookup.c-84-\t\t * already unlinked a (matching) element.\n"
} |
| 17/2 | 2026/08/21 16:39 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 33671 output: 22 thoughts: 49 Thoughts: Here's my take on those thoughts: **Analyzing `nf_tables_commit` Reachability** Okay, so `nf_tables_commit`...right, that's the commit callback for `nfnetlink_subsystem nf_tables_subsys`. Makes sense. Given its role, it *should* be reachable. No obvious red flags there. My experience tells me that such callbacks are usually properly wired up, but you always have to confirm. Now, let's switch gears and investigate `pipapo_get_avx2`. Gotta keep a full picture. |
| 18/2 | 2026/08/21 16:39 | tool | grepper |
0mArgs:{
"Expression": "pipapo_get_avx2"
}Results: {
"Output": "net/netfilter/nft_set_pipapo.c=524=static struct nft_pipapo_elem *pipapo_get(const struct nft_pipapo_match *m,\n--\nnet/netfilter/nft_set_pipapo.c-533-\tif (boot_cpu_has(X86_FEATURE_AVX2) \u0026\u0026 irq_fpu_usable()) {\nnet/netfilter/nft_set_pipapo.c:534:\t\te = pipapo_get_avx2(m, data, genmask, tstamp);\nnet/netfilter/nft_set_pipapo.c-535-\t\tlocal_bh_enable();\n--\nnet/netfilter/nft_set_pipapo_avx2.c=1101=static inline void pipapo_resmap_init_avx2(const struct nft_pipapo_match *m, unsigned long *res_map)\n--\nnet/netfilter/nft_set_pipapo_avx2.c-1113-/**\nnet/netfilter/nft_set_pipapo_avx2.c:1114: * pipapo_get_avx2() - Lookup function for AVX2 implementation\nnet/netfilter/nft_set_pipapo_avx2.c-1115- * @m:\t\tStorage containing the set elements\n--\nnet/netfilter/nft_set_pipapo_avx2.c-1129- */\nnet/netfilter/nft_set_pipapo_avx2.c:1130:struct nft_pipapo_elem *pipapo_get_avx2(const struct nft_pipapo_match *m,\nnet/netfilter/nft_set_pipapo_avx2.c-1131-\t\t\t\t\tconst u8 *data, u8 genmask,\n--\nnet/netfilter/nft_set_pipapo_avx2.c=1255=nft_pipapo_avx2_lookup(const struct net *net, const struct nft_set *set,\n--\nnet/netfilter/nft_set_pipapo_avx2.c-1275-\nnet/netfilter/nft_set_pipapo_avx2.c:1276:\te = pipapo_get_avx2(m, rp, 0, get_jiffies_64());\nnet/netfilter/nft_set_pipapo_avx2.c-1277-\tlocal_bh_enable();\n--\nnet/netfilter/nft_set_pipapo_avx2.h=9=bool nft_pipapo_avx2_estimate(const struct nft_set_desc *desc, u32 features,\nnet/netfilter/nft_set_pipapo_avx2.h-10-\t\t\t struct nft_set_estimate *est);\nnet/netfilter/nft_set_pipapo_avx2.h:11:struct nft_pipapo_elem *pipapo_get_avx2(const struct nft_pipapo_match *m,\nnet/netfilter/nft_set_pipapo_avx2.h-12-\t\t\t\t\tconst u8 *data, u8 genmask,\n"
} |
| 19/2 | 2026/08/21 16:39 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 34642 output: 23 thoughts: 56 Thoughts: Here's my summary, as the expert: **Tracing the Execution Path** Okay, so I'm digging into this code and trying to figure out how `pipapo_get_avx2` is being used. It seems like it's definitely being called, as it's directly invoked from both `nft_pipapo_avx2_lookup` and the general `pipapo_get` functions. That's a solid lead; it confirms reachability. Now, let's switch gears and investigate `nft_set_elem_expr_setup`, see how that fits into the picture. It's probably where the data gets prepared, before being passed to my target. |
| 20/2 | 2026/08/21 16:39 | tool | grepper |
0mArgs:{
"Expression": "nft_set_elem_expr_setup"
}Results: {
"Output": "net/netfilter/nf_tables_api.c=6918=static void nft_trans_elems_destroy(const struct nft_ctx *ctx,\n--\nnet/netfilter/nf_tables_api.c-6926-\nnet/netfilter/nf_tables_api.c:6927:static int nft_set_elem_expr_setup(struct nft_ctx *ctx,\nnet/netfilter/nf_tables_api.c-6928-\t\t\t\t const struct nft_set_ext_tmpl *tmpl,\n--\nnet/netfilter/nf_tables_api.c=7248=static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,\n--\nnet/netfilter/nf_tables_api.c-7549-\t}\nnet/netfilter/nf_tables_api.c:7550:\terr = nft_set_elem_expr_setup(ctx, \u0026tmpl, ext, expr_array, num_exprs,\nnet/netfilter/nf_tables_api.c-7551-\t\t\t\t override_exprs);\n"
} |
| 21/2 | 2026/08/21 16:39 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 35151 output: 24 thoughts: 88 Thoughts: Here's my summary, as I see it: **Focusing In on Key Functions for NF-Tables Analysis** Okay, so I'm digging into `nf_tables_api.c`. My initial scan tells me that `nft_add_set_elem` is a primary function to scrutinize. That's a good starting point. I also need to pay close attention to `nf_tables_commit`, as it's almost certainly involved in persisting changes. Then there's `nft_dynset_init`, which sounds like it is critical for dynamic set handling, and finally, there's `pipapo_get_avx2` or `nft_pipapo_avx2_lookup`. I need to understand how these relate to AVX2 optimizations. Let's start by delving deeper into `nft_pipapo_avx2_lookup`. That's where I'll start my detailed analysis. |
| 22/2 | 2026/08/21 16:39 | tool | grepper |
0mArgs:{
"Expression": "nft_pipapo_avx2_lookup"
}Results: {
"Output": "include/net/netfilter/nf_tables_core.h=123=const struct nft_set_ext *\ninclude/net/netfilter/nf_tables_core.h:124:nft_pipapo_avx2_lookup(const struct net *net, const struct nft_set *set,\ninclude/net/netfilter/nf_tables_core.h-125-\t\t\tconst u32 *key);\n--\nnet/netfilter/nft_lookup.c=28=__nft_set_do_lookup(const struct net *net, const struct nft_set *set,\n--\nnet/netfilter/nft_lookup.c-46-\tif (set-\u003eops == \u0026nft_set_pipapo_avx2_type.ops)\nnet/netfilter/nft_lookup.c:47:\t\treturn nft_pipapo_avx2_lookup(net, set, key);\nnet/netfilter/nft_lookup.c-48-#endif\n--\nnet/netfilter/nft_set_pipapo.c=2443=const struct nft_set_type nft_set_pipapo_avx2_type = {\n--\nnet/netfilter/nft_set_pipapo.c-2446-\t.ops\t\t= {\nnet/netfilter/nft_set_pipapo.c:2447:\t\t.lookup\t\t= nft_pipapo_avx2_lookup,\nnet/netfilter/nft_set_pipapo.c-2448-\t\t.insert\t\t= nft_pipapo_insert,\n--\nnet/netfilter/nft_set_pipapo_avx2.c=153=static int nft_pipapo_avx2_refill(int offset, unsigned long *map,\n--\nnet/netfilter/nft_set_pipapo_avx2.c-187-/**\nnet/netfilter/nft_set_pipapo_avx2.c:188: * nft_pipapo_avx2_lookup_4b_2() - AVX2-based lookup for 2 four-bit groups\nnet/netfilter/nft_set_pipapo_avx2.c-189- * @map:\tPrevious match result, used as initial bitmap\n--\nnet/netfilter/nft_set_pipapo_avx2.c-215- */\nnet/netfilter/nft_set_pipapo_avx2.c:216:static int nft_pipapo_avx2_lookup_4b_2(unsigned long *map, unsigned long *fill,\nnet/netfilter/nft_set_pipapo_avx2.c-217-\t\t\t\t const struct nft_pipapo_field *f,\n--\nnet/netfilter/nft_set_pipapo_avx2.c-261-/**\nnet/netfilter/nft_set_pipapo_avx2.c:262: * nft_pipapo_avx2_lookup_4b_4() - AVX2-based lookup for 4 four-bit groups\nnet/netfilter/nft_set_pipapo_avx2.c-263- * @map:\tPrevious match result, used as initial bitmap\n--\nnet/netfilter/nft_set_pipapo_avx2.c-270- *\nnet/netfilter/nft_set_pipapo_avx2.c:271: * See nft_pipapo_avx2_lookup_4b_2().\nnet/netfilter/nft_set_pipapo_avx2.c-272- *\n--\nnet/netfilter/nft_set_pipapo_avx2.c-277- */\nnet/netfilter/nft_set_pipapo_avx2.c:278:static int nft_pipapo_avx2_lookup_4b_4(unsigned long *map, unsigned long *fill,\nnet/netfilter/nft_set_pipapo_avx2.c-279-\t\t\t\t const struct nft_pipapo_field *f,\n--\nnet/netfilter/nft_set_pipapo_avx2.c-337-/**\nnet/netfilter/nft_set_pipapo_avx2.c:338: * nft_pipapo_avx2_lookup_4b_8() - AVX2-based lookup for 8 four-bit groups\nnet/netfilter/nft_set_pipapo_avx2.c-339- * @map:\tPrevious match result, used as initial bitmap\n--\nnet/netfilter/nft_set_pipapo_avx2.c-346- *\nnet/netfilter/nft_set_pipapo_avx2.c:347: * See nft_pipapo_avx2_lookup_4b_2().\nnet/netfilter/nft_set_pipapo_avx2.c-348- *\n--\nnet/netfilter/nft_set_pipapo_avx2.c-353- */\nnet/netfilter/nft_set_pipapo_avx2.c:354:static int nft_pipapo_avx2_lookup_4b_8(unsigned long *map, unsigned long *fill,\nnet/netfilter/nft_set_pipapo_avx2.c-355-\t\t\t\t const struct nft_pipapo_field *f,\n--\nnet/netfilter/nft_set_pipapo_avx2.c-432-/**\nnet/netfilter/nft_set_pipapo_avx2.c:433: * nft_pipapo_avx2_lookup_4b_12() - AVX2-based lookup for 12 four-bit groups\nnet/netfilter/nft_set_pipapo_avx2.c-434- * @map:\tPrevious match result, used as initial bitmap\n--\nnet/netfilter/nft_set_pipapo_avx2.c-441- *\nnet/netfilter/nft_set_pipapo_avx2.c:442: * See nft_pipapo_avx2_lookup_4b_2().\nnet/netfilter/nft_set_pipapo_avx2.c-443- *\n--\nnet/netfilter/nft_set_pipapo_avx2.c-448- */\nnet/netfilter/nft_set_pipapo_avx2.c:449:static int nft_pipapo_avx2_lookup_4b_12(unsigned long *map, unsigned long *fill,\nnet/netfilter/nft_set_pipapo_avx2.c-450-\t\t\t\t\tconst struct nft_pipapo_field *f,\n--\nnet/netfilter/nft_set_pipapo_avx2.c-521-/**\nnet/netfilter/nft_set_pipapo_avx2.c:522: * nft_pipapo_avx2_lookup_4b_32() - AVX2-based lookup for 32 four-bit groups\nnet/netfilter/nft_set_pipapo_avx2.c-523- * @map:\tPrevious match result, used as initial bitmap\n--\nnet/netfilter/nft_set_pipapo_avx2.c-530- *\nnet/netfilter/nft_set_pipapo_avx2.c:531: * See nft_pipapo_avx2_lookup_4b_2().\nnet/netfilter/nft_set_pipapo_avx2.c-532- *\n--\nnet/netfilter/nft_set_pipapo_avx2.c-537- */\nnet/netfilter/nft_set_pipapo_avx2.c:538:static int nft_pipapo_avx2_lookup_4b_32(unsigned long *map, unsigned long *fill,\nnet/netfilter/nft_set_pipapo_avx2.c-539-\t\t\t\t\tconst struct nft_pipapo_field *f,\n--\nnet/netfilter/nft_set_pipapo_avx2.c-656-/**\nnet/netfilter/nft_set_pipapo_avx2.c:657: * nft_pipapo_avx2_lookup_8b_1() - AVX2-based lookup for one eight-bit group\nnet/netfilter/nft_set_pipapo_avx2.c-658- * @map:\tPrevious match result, used as initial bitmap\n--\nnet/netfilter/nft_set_pipapo_avx2.c-665- *\nnet/netfilter/nft_set_pipapo_avx2.c:666: * See nft_pipapo_avx2_lookup_4b_2().\nnet/netfilter/nft_set_pipapo_avx2.c-667- *\n--\nnet/netfilter/nft_set_pipapo_avx2.c-672- */\nnet/netfilter/nft_set_pipapo_avx2.c:673:static int nft_pipapo_avx2_lookup_8b_1(unsigned long *map, unsigned long *fill,\nnet/netfilter/nft_set_pipapo_avx2.c-674-\t\t\t\t const struct nft_pipapo_field *f,\n--\nnet/netfilter/nft_set_pipapo_avx2.c-713-/**\nnet/netfilter/nft_set_pipapo_avx2.c:714: * nft_pipapo_avx2_lookup_8b_2() - AVX2-based lookup for 2 eight-bit groups\nnet/netfilter/nft_set_pipapo_avx2.c-715- * @map:\tPrevious match result, used as initial bitmap\n--\nnet/netfilter/nft_set_pipapo_avx2.c-722- *\nnet/netfilter/nft_set_pipapo_avx2.c:723: * See nft_pipapo_avx2_lookup_4b_2().\nnet/netfilter/nft_set_pipapo_avx2.c-724- *\n--\nnet/netfilter/nft_set_pipapo_avx2.c-729- */\nnet/netfilter/nft_set_pipapo_avx2.c:730:static int nft_pipapo_avx2_lookup_8b_2(unsigned long *map, unsigned long *fill,\nnet/netfilter/nft_set_pipapo_avx2.c-731-\t\t\t\t const struct nft_pipapo_field *f,\n--\nnet/netfilter/nft_set_pipapo_avx2.c-777-/**\nnet/netfilter/nft_set_pipapo_avx2.c:778: * nft_pipapo_avx2_lookup_8b_4() - AVX2-based lookup for 4 eight-bit groups\nnet/netfilter/nft_set_pipapo_avx2.c-779- * @map:\tPrevious match result, used as initial bitmap\n--\nnet/netfilter/nft_set_pipapo_avx2.c-786- *\nnet/netfilter/nft_set_pipapo_avx2.c:787: * See nft_pipapo_avx2_lookup_4b_2().\nnet/netfilter/nft_set_pipapo_avx2.c-788- *\n--\nnet/netfilter/nft_set_pipapo_avx2.c-793- */\nnet/netfilter/nft_set_pipapo_avx2.c:794:static int nft_pipapo_avx2_lookup_8b_4(unsigned long *map, unsigned long *fill,\nnet/netfilter/nft_set_pipapo_avx2.c-795-\t\t\t\t const struct nft_pipapo_field *f,\n--\nnet/netfilter/nft_set_pipapo_avx2.c-852-/**\nnet/netfilter/nft_set_pipapo_avx2.c:853: * nft_pipapo_avx2_lookup_8b_6() - AVX2-based lookup for 6 eight-bit groups\nnet/netfilter/nft_set_pipapo_avx2.c-854- * @map:\tPrevious match result, used as initial bitmap\n--\nnet/netfilter/nft_set_pipapo_avx2.c-861- *\nnet/netfilter/nft_set_pipapo_avx2.c:862: * See nft_pipapo_avx2_lookup_4b_2().\nnet/netfilter/nft_set_pipapo_avx2.c-863- *\n--\nnet/netfilter/nft_set_pipapo_avx2.c-868- */\nnet/netfilter/nft_set_pipapo_avx2.c:869:static int nft_pipapo_avx2_lookup_8b_6(unsigned long *map, unsigned long *fill,\nnet/netfilter/nft_set_pipapo_avx2.c-870-\t\t\t\t const struct nft_pipapo_field *f,\n--\nnet/netfilter/nft_set_pipapo_avx2.c-937-/**\nnet/netfilter/nft_set_pipapo_avx2.c:938: * nft_pipapo_avx2_lookup_8b_16() - AVX2-based lookup for 16 eight-bit groups\nnet/netfilter/nft_set_pipapo_avx2.c-939- * @map:\tPrevious match result, used as initial bitmap\n--\nnet/netfilter/nft_set_pipapo_avx2.c-946- *\nnet/netfilter/nft_set_pipapo_avx2.c:947: * See nft_pipapo_avx2_lookup_4b_2().\nnet/netfilter/nft_set_pipapo_avx2.c-948- *\n--\nnet/netfilter/nft_set_pipapo_avx2.c-953- */\nnet/netfilter/nft_set_pipapo_avx2.c:954:static int nft_pipapo_avx2_lookup_8b_16(unsigned long *map, unsigned long *fill,\nnet/netfilter/nft_set_pipapo_avx2.c-955-\t\t\t\t\tconst struct nft_pipapo_field *f,\n--\nnet/netfilter/nft_set_pipapo_avx2.c-1030-/**\nnet/netfilter/nft_set_pipapo_avx2.c:1031: * nft_pipapo_avx2_lookup_slow() - Fallback function for uncommon field sizes\nnet/netfilter/nft_set_pipapo_avx2.c-1032- * @mdata:\tMatching data, including mapping table\n--\nnet/netfilter/nft_set_pipapo_avx2.c-1046- */\nnet/netfilter/nft_set_pipapo_avx2.c:1047:static int nft_pipapo_avx2_lookup_slow(const struct nft_pipapo_match *mdata,\nnet/netfilter/nft_set_pipapo_avx2.c-1048-\t\t\t\t\tunsigned long *map, unsigned long *fill,\n--\nnet/netfilter/nft_set_pipapo_avx2.c=1130=struct nft_pipapo_elem *pipapo_get_avx2(const struct nft_pipapo_match *m,\n--\nnet/netfilter/nft_set_pipapo_avx2.c-1166-#define NFT_SET_PIPAPO_AVX2_LOOKUP(b, n)\t\t\t\t\\\nnet/netfilter/nft_set_pipapo_avx2.c:1167:\t\t(ret = nft_pipapo_avx2_lookup_##b##b_##n(res, fill, f,\t\\\nnet/netfilter/nft_set_pipapo_avx2.c-1168-\t\t\t\t\t\t\t ret, data,\t\\\n--\nnet/netfilter/nft_set_pipapo_avx2.c-1182-\t\t\t} else {\nnet/netfilter/nft_set_pipapo_avx2.c:1183:\t\t\t\tret = nft_pipapo_avx2_lookup_slow(m, res, fill, f,\nnet/netfilter/nft_set_pipapo_avx2.c-1184-\t\t\t\t\t\t\t\t data,\n--\nnet/netfilter/nft_set_pipapo_avx2.c-1198-\t\t\t} else {\nnet/netfilter/nft_set_pipapo_avx2.c:1199:\t\t\t\tret = nft_pipapo_avx2_lookup_slow(m, res, fill, f,\nnet/netfilter/nft_set_pipapo_avx2.c-1200-\t\t\t\t\t\t\t\t data,\n--\nnet/netfilter/nft_set_pipapo_avx2.c-1241-/**\nnet/netfilter/nft_set_pipapo_avx2.c:1242: * nft_pipapo_avx2_lookup() - Dataplane frontend for AVX2 implementation\nnet/netfilter/nft_set_pipapo_avx2.c-1243- * @net:\tNetwork namespace\n--\nnet/netfilter/nft_set_pipapo_avx2.c=1254=const struct nft_set_ext *\nnet/netfilter/nft_set_pipapo_avx2.c:1255:nft_pipapo_avx2_lookup(const struct net *net, const struct nft_set *set,\nnet/netfilter/nft_set_pipapo_avx2.c-1256-\t\t const u32 *key)\n"
} |
| 23/2 | 2026/08/21 16:39 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 39847 output: 20 thoughts: 352 Thoughts: **Fuzzing Target Identification** Okay, so I'm looking at this code and confirming that `nft_pipapo_avx2_lookup` is indeed the lookup function tied to the `nft_set_pipapo_avx2_type` – and of course, it's going to be available if `CONFIG_NF_TABLES` is enabled, no surprises there. Let's trace the execution path. Right, `nf_tables_commit` is reachable, that's good. And `nft_add_set_elem`, and `nft_dynset_init` - they're all reachable as well. The file changes in `nf_tables_api.c`, `nft_dynset.c`, and particularly `nft_set_pipapo_avx2.c` (that `vzeroupper` addition is a clear AVX2 indicator!) scream "functionally significant." Yep, this is definitely worth fuzzing. My primary focus symbols are clearly: `nft_add_set_elem`, `nf_tables_commit`, `nft_dynset_init`, and `nft_pipapo_avx2_lookup` . Oh, and I shouldn't forget `pipapo_get_avx2` as a potential entry point as it's not static. Now, let me just double-check. `nft_add_set_elem` *is* static, but it's a sizeable function – perhaps there's a non-static entry point to it? And `nf_tables_newsetelem` is also static, so what about the call back? The non-static entry point might be `nf_tables_cb` or something similar. I need to scan `nf_tables_api.c` for those non-static functions to identify the best entry points. |
| 24/2 | 2026/08/21 16:39 | tool | grepper |
0mArgs:{
"Expression": "^int nf_tables_"
}Results: {
"Output": "include/net/netfilter/nf_tables.h=678=void nf_tables_deactivate_set(const struct nft_ctx *ctx, struct nft_set *set,\n--\ninclude/net/netfilter/nf_tables.h-680-\t\t\t enum nft_trans_phase phase);\ninclude/net/netfilter/nf_tables.h:681:int nf_tables_bind_set(const struct nft_ctx *ctx, struct nft_set *set,\ninclude/net/netfilter/nf_tables.h-682-\t\t struct nft_set_binding *binding);\n--\ninclude/net/netfilter/nf_tables.h=1160=int nft_set_catchall_validate(const struct nft_ctx *ctx, struct nft_set *set);\ninclude/net/netfilter/nf_tables.h:1161:int nf_tables_bind_chain(const struct nft_ctx *ctx, struct nft_chain *chain);\ninclude/net/netfilter/nf_tables.h-1162-void nf_tables_unbind_chain(const struct nft_ctx *ctx, struct nft_chain *chain);\n--\ninclude/net/netfilter/nf_tables_core.h=27=extern struct nft_object_type nft_counter_obj_type;\ninclude/net/netfilter/nf_tables_core.h-28-\ninclude/net/netfilter/nf_tables_core.h:29:int nf_tables_core_module_init(void);\ninclude/net/netfilter/nf_tables_core.h-30-void nf_tables_core_module_exit(void);\n--\nnet/netfilter/nf_tables_api.c=285=static void nft_chain_trans_bind(const struct nft_ctx *ctx,\n--\nnet/netfilter/nf_tables_api.c-290-\nnet/netfilter/nf_tables_api.c:291:int nf_tables_bind_chain(const struct nft_ctx *ctx, struct nft_chain *chain)\nnet/netfilter/nf_tables_api.c-292-{\n--\nnet/netfilter/nf_tables_api.c=5862=static int nft_set_catchall_bind_check(const struct nft_ctx *ctx,\n--\nnet/netfilter/nf_tables_api.c-5883-\nnet/netfilter/nf_tables_api.c:5884:int nf_tables_bind_set(const struct nft_ctx *ctx, struct nft_set *set,\nnet/netfilter/nf_tables_api.c-5885-\t\t struct nft_set_binding *binding)\n"
} |
| 25/2 | 2026/08/21 16:39 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 41274 output: 22 thoughts: 25 Thoughts: Okay, here's my take on those thoughts, framed as an expert's internal monologue: **Investigating the `nf_tables_new` Function** Right, let's dive into the guts of this netfilter/nftables interaction. I need to understand how new tables are created, specifically the core API call. The obvious starting point is to track down `^static int nf_tables_new`. That regex will help me zero in on the exact function definition within `nf_tables_api.c`. Searching for the beginning of the function will ensure I catch all aspects of the declaration. Understanding the static nature of the function will likely inform its scope of use, likely confined to the file, and that's good to keep in mind. Knowing the `int` return type tells me we're dealing with a function that likely signals success or failure, probably using a standard error code scheme. |
| 26/2 | 2026/08/21 16:39 | tool | grepper |
0mArgs:{
"Expression": "^static int nf_tables_new"
}Results: {
"Output": "net/netfilter/nf_tables_api.c=1552=static bool nft_supported_family(u8 family)\n--\nnet/netfilter/nf_tables_api.c-1575-\nnet/netfilter/nf_tables_api.c:1576:static int nf_tables_newtable(struct sk_buff *skb, const struct nfnl_info *info,\nnet/netfilter/nf_tables_api.c-1577-\t\t\t const struct nlattr * const nla[])\n--\nnet/netfilter/nf_tables_api.c=3097=static struct nft_chain *nft_chain_lookup_byid(const struct net *net,\n--\nnet/netfilter/nf_tables_api.c-3114-\nnet/netfilter/nf_tables_api.c:3115:static int nf_tables_newchain(struct sk_buff *skb, const struct nfnl_info *info,\nnet/netfilter/nf_tables_api.c-3116-\t\t\t const struct nlattr * const nla[])\n--\nnet/netfilter/nf_tables_api.c=3588=int nft_expr_inner_parse(const struct nft_ctx *ctx, const struct nlattr *nla,\n--\nnet/netfilter/nf_tables_api.c-3636-\nnet/netfilter/nf_tables_api.c:3637:static int nf_tables_newexpr(const struct nft_ctx *ctx,\nnet/netfilter/nf_tables_api.c-3638-\t\t\t const struct nft_expr_info *expr_info,\n--\nnet/netfilter/nf_tables_api.c=4312=static struct nft_rule *nft_rule_lookup_byid(const struct net *net,\n--\nnet/netfilter/nf_tables_api.c-4317-\nnet/netfilter/nf_tables_api.c:4318:static int nf_tables_newrule(struct sk_buff *skb, const struct nfnl_info *info,\nnet/netfilter/nf_tables_api.c-4319-\t\t\t const struct nlattr * const nla[])\n--\nnet/netfilter/nf_tables_api.c=5430=static u32 nft_set_kernel_size(const struct nft_set_ops *ops,\n--\nnet/netfilter/nf_tables_api.c-5438-\nnet/netfilter/nf_tables_api.c:5439:static int nf_tables_newset(struct sk_buff *skb, const struct nfnl_info *info,\nnet/netfilter/nf_tables_api.c-5440-\t\t\t const struct nlattr * const nla[])\n--\nnet/netfilter/nf_tables_api.c=7248=static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,\n--\nnet/netfilter/nf_tables_api.c-7666-\nnet/netfilter/nf_tables_api.c:7667:static int nf_tables_newsetelem(struct sk_buff *skb,\nnet/netfilter/nf_tables_api.c-7668-\t\t\t\tconst struct nfnl_info *info,\n--\nnet/netfilter/nf_tables_api.c=8266=static int nf_tables_updobj(const struct nft_ctx *ctx,\n--\nnet/netfilter/nf_tables_api.c-8300-\nnet/netfilter/nf_tables_api.c:8301:static int nf_tables_newobj(struct sk_buff *skb, const struct nfnl_info *info,\nnet/netfilter/nf_tables_api.c-8302-\t\t\t const struct nlattr * const nla[])\n--\nnet/netfilter/nf_tables_api.c=9116=static int nft_flowtable_update(struct nft_ctx *ctx, const struct nlmsghdr *nlh,\n--\nnet/netfilter/nf_tables_api.c-9207-\nnet/netfilter/nf_tables_api.c:9208:static int nf_tables_newflowtable(struct sk_buff *skb,\nnet/netfilter/nf_tables_api.c-9209-\t\t\t\t const struct nfnl_info *info,\n"
} |
| 27/2 | 2026/08/21 16:39 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 42609 output: 21 thoughts: 408 Thoughts: **My Current Assessment of the Relevant Symbols** Okay, so I'm homing in on the key functions here. Let's recap. `nf_tables_newsetelem` handles the entry point for adding elements to sets. `nf_tables_newexpr` deals with expressions, and `nf_tables_commit` is, as the name suggests, the commit phase. Now, I've dug into the initialization process and see that `nft_dynset_init` is called via the path `nf_tables_newexpr` -> `nft_expr_init` -> `ops->init`. On the evaluation side, `nft_pipapo_avx2_lookup` is called from `nft_lookup_eval`, specifically through `set->ops->lookup`, and that calls `pipapo_get_avx2`. Therefore, the critical symbols I need to focus on are: * `nf_tables_newsetelem` * `nf_tables_commit` * `nft_dynset_init` * `nft_pipapo_avx2_lookup` * `pipapo_get_avx2` A quick check on the function attributes reminds me that I need to be careful with static and inlined functions. But wait, `nft_dynset_init` *is* static! However, it's assigned to a function pointer (`ops->init`), so it *shouldn't* be inlined. That's fine. Similarly, `nf_tables_newsetelem` and `nf_tables_commit` are both static, but as callbacks in `nfnetlink_subsystem`, they are not inlined. Hang on a second... are `nf_tables_commit` and `nf_tables_newsetelem` really static? Let's verify that. |
| 28/2 | 2026/08/21 16:39 | tool | grepper |
0mArgs:{
"Expression": "static int nf_tables_commit"
}Results: {
"Output": "net/netfilter/nf_tables_api.c=10301=EXPORT_SYMBOL_GPL(nf_tables_trans_destroy_flush_work);\nnet/netfilter/nf_tables_api.c-10302-\nnet/netfilter/nf_tables_api.c:10303:static int nf_tables_commit_chain_prepare(struct net *net, struct nft_chain *chain)\nnet/netfilter/nf_tables_api.c-10304-{\n--\nnet/netfilter/nf_tables_api.c=10754=static void nft_commit_notify(struct net *net, u32 portid)\n--\nnet/netfilter/nf_tables_api.c-10789-\nnet/netfilter/nf_tables_api.c:10790:static int nf_tables_commit_audit_alloc(struct list_head *adl,\nnet/netfilter/nf_tables_api.c-10791-\t\t\t\t\tstruct nft_table *table)\n--\nnet/netfilter/nf_tables_api.c=10915=static void nft_gc_seq_end(struct nftables_pernet *nft_net, unsigned int gc_seq)\n--\nnet/netfilter/nf_tables_api.c-10919-\nnet/netfilter/nf_tables_api.c:10920:static int nf_tables_commit(struct net *net, struct sk_buff *skb)\nnet/netfilter/nf_tables_api.c-10921-{\n"
} |
| 29/2 | 2026/08/21 16:39 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 43833 output: 18 thoughts: 309 Thoughts: **Analyzing nf_tables Static Functions and Modifications** Okay, so `nf_tables_commit` is definitively a static function. My next step is to nail down exactly which functions are modified or directly connected to the changes. Right now, I have these functions identified: * `nft_add_set_elem` (static) * `nf_tables_commit` (static) * `nft_dynset_init` (static) * `pipapo_get_avx2` (non-static) I need to confirm if `nft_add_set_elem` is inlined. Given its size, it's unlikely, but the netlink callback, `nf_tables_newsetelem` , should be on the list for sure. Now, let me list the functions again, including the new find: * `nf_tables_newsetelem` * `nf_tables_commit` * `nft_dynset_init` * `pipapo_get_avx2` Let's also not forget about some other static, modified functions: `nft_set_commit_update` and `nft_set_elem_expr_setup`. Those are crucial too. Now I need to check the configuration options. I'm looking at `CONFIG_NF_TABLES` and, hang on, it seems I made a mistake before, `NFT_DYNSET` isn't a direct config option, just `CONFIG_NF_TABLES`. Are there any other relevant configs I've missed? Let me go back and double-check `net/netfilter/Kconfig` for the `nft_dynset` functionality and make sure I'm not missing anything. |
| 30/2 | 2026/08/21 16:40 | tool | grepper |
0mArgs:{
"Expression": "nft_dynset"
}Results: {
"Output": "include/net/netfilter/nf_tables_core.h=14=extern struct nft_expr_type nft_payload_type;\ninclude/net/netfilter/nf_tables_core.h:15:extern struct nft_expr_type nft_dynset_type;\ninclude/net/netfilter/nf_tables_core.h-16-extern struct nft_expr_type nft_range_type;\n--\ninclude/net/netfilter/nf_tables_core.h=146=void nft_byteorder_eval(const struct nft_expr *expr,\ninclude/net/netfilter/nf_tables_core.h-147-\t\t\tstruct nft_regs *regs, const struct nft_pktinfo *pkt);\ninclude/net/netfilter/nf_tables_core.h:148:void nft_dynset_eval(const struct nft_expr *expr,\ninclude/net/netfilter/nf_tables_core.h-149-\t\t struct nft_regs *regs, const struct nft_pktinfo *pkt);\n--\ninclude/net/netfilter/nf_tables_core.h=183=void nft_objref_map_eval(const struct nft_expr *expr, struct nft_regs *regs,\ninclude/net/netfilter/nf_tables_core.h-184-\t\t\t const struct nft_pktinfo *pkt);\ninclude/net/netfilter/nf_tables_core.h:185:struct nft_elem_priv *nft_dynset_new(struct nft_set *set,\ninclude/net/netfilter/nf_tables_core.h-186-\t\t\t\t const struct nft_expr *expr,\n--\ninclude/uapi/linux/netfilter/nf_tables.h=744=enum nft_lookup_attributes {\n--\ninclude/uapi/linux/netfilter/nf_tables.h-754-\ninclude/uapi/linux/netfilter/nf_tables.h:755:enum nft_dynset_ops {\ninclude/uapi/linux/netfilter/nf_tables.h-756-\tNFT_DYNSET_OP_ADD,\n--\ninclude/uapi/linux/netfilter/nf_tables.h-760-\ninclude/uapi/linux/netfilter/nf_tables.h:761:enum nft_dynset_flags {\ninclude/uapi/linux/netfilter/nf_tables.h-762-\tNFT_DYNSET_F_INV\t= (1 \u003c\u003c 0),\n--\ninclude/uapi/linux/netfilter/nf_tables.h-766-/**\ninclude/uapi/linux/netfilter/nf_tables.h:767: * enum nft_dynset_attributes - dynset expression attributes\ninclude/uapi/linux/netfilter/nf_tables.h-768- *\n--\ninclude/uapi/linux/netfilter/nf_tables.h-778- */\ninclude/uapi/linux/netfilter/nf_tables.h:779:enum nft_dynset_attributes {\ninclude/uapi/linux/netfilter/nf_tables.h-780-\tNFTA_DYNSET_UNSPEC,\n--\nnet/netfilter/Makefile=87=nf_tables-objs := nf_tables_core.o nf_tables_api.o nft_chain_filter.o \\\n--\nnet/netfilter/Makefile-89-\t\t nft_bitwise.o nft_byteorder.o nft_payload.o nft_lookup.o \\\nnet/netfilter/Makefile:90:\t\t nft_dynset.o nft_meta.o nft_rt.o nft_exthdr.o nft_last.o \\\nnet/netfilter/Makefile-91-\t\t nft_counter.o nft_objref.o nft_inner.o \\\n--\nnet/netfilter/nf_tables_core.c=203=static void expr_call_ops_eval(const struct nft_expr *expr,\n--\nnet/netfilter/nf_tables_core.c-228-\tX(e, nft_byteorder_eval);\nnet/netfilter/nf_tables_core.c:229:\tX(e, nft_dynset_eval);\nnet/netfilter/nf_tables_core.c-230-\tX(e, nft_rt_get_eval);\n--\nnet/netfilter/nf_tables_core.c=352=static struct nft_expr_type *nft_basic_types[] = {\n--\nnet/netfilter/nf_tables_core.c-358-\t\u0026nft_payload_type,\nnet/netfilter/nf_tables_core.c:359:\t\u0026nft_dynset_type,\nnet/netfilter/nf_tables_core.c-360-\t\u0026nft_range_type,\n--\nnet/netfilter/nft_dynset.c-14-\nnet/netfilter/nft_dynset.c:15:struct nft_dynset {\nnet/netfilter/nft_dynset.c-16-\tstruct nft_set\t\t\t*set;\nnet/netfilter/nft_dynset.c-17-\tstruct nft_set_ext_tmpl\t\ttmpl;\nnet/netfilter/nft_dynset.c:18:\tenum nft_dynset_ops\t\top:8;\nnet/netfilter/nft_dynset.c-19-\tu8\t\t\t\tsreg_key;\n--\nnet/netfilter/nft_dynset.c-29-\nnet/netfilter/nft_dynset.c:30:static int nft_dynset_expr_setup(const struct nft_dynset *priv,\nnet/netfilter/nft_dynset.c-31-\t\t\t\t const struct nft_set_ext *ext)\n--\nnet/netfilter/nft_dynset.c-55-\nnet/netfilter/nft_dynset.c:56:struct nft_elem_priv *nft_dynset_new(struct nft_set *set,\nnet/netfilter/nft_dynset.c-57-\t\t\t\t const struct nft_expr *expr,\n--\nnet/netfilter/nft_dynset.c-59-{\nnet/netfilter/nft_dynset.c:60:\tconst struct nft_dynset *priv = nft_expr_priv(expr);\nnet/netfilter/nft_dynset.c-61-\tstruct nft_set_ext *ext;\n--\nnet/netfilter/nft_dynset.c-76-\text = nft_set_elem_ext(set, elem_priv);\nnet/netfilter/nft_dynset.c:77:\tif (priv-\u003enum_exprs \u0026\u0026 nft_dynset_expr_setup(priv, ext) \u003c 0)\nnet/netfilter/nft_dynset.c-78-\t\tgoto err2;\n--\nnet/netfilter/nft_dynset.c-89-\nnet/netfilter/nft_dynset.c:90:void nft_dynset_eval(const struct nft_expr *expr,\nnet/netfilter/nft_dynset.c-91-\t\t struct nft_regs *regs, const struct nft_pktinfo *pkt)\nnet/netfilter/nft_dynset.c-92-{\nnet/netfilter/nft_dynset.c:93:\tconst struct nft_dynset *priv = nft_expr_priv(expr);\nnet/netfilter/nft_dynset.c-94-\tstruct nft_set *set = priv-\u003eset;\n--\nnet/netfilter/nft_dynset.c-122-\nnet/netfilter/nft_dynset.c:123:static void nft_dynset_ext_add_expr(struct nft_dynset *priv)\nnet/netfilter/nft_dynset.c-124-{\n--\nnet/netfilter/nft_dynset.c=135=static struct nft_expr *\nnet/netfilter/nft_dynset.c:136:nft_dynset_expr_alloc(const struct nft_ctx *ctx, const struct nft_set *set,\nnet/netfilter/nft_dynset.c-137-\t\t const struct nlattr *attr, int pos)\n--\nnet/netfilter/nft_dynset.c-157-\nnet/netfilter/nft_dynset.c:158:static const struct nla_policy nft_dynset_policy[NFTA_DYNSET_MAX + 1] = {\nnet/netfilter/nft_dynset.c-159-\t[NFTA_DYNSET_SET_NAME]\t= { .type = NLA_STRING,\n--\nnet/netfilter/nft_dynset.c-171-\nnet/netfilter/nft_dynset.c:172:static int nft_dynset_init(const struct nft_ctx *ctx,\nnet/netfilter/nft_dynset.c-173-\t\t\t const struct nft_expr *expr,\n--\nnet/netfilter/nft_dynset.c-176-\tstruct nftables_pernet *nft_net = nft_pernet(ctx-\u003enet);\nnet/netfilter/nft_dynset.c:177:\tstruct nft_dynset *priv = nft_expr_priv(expr);\nnet/netfilter/nft_dynset.c-178-\tu8 genmask = nft_genmask_next(ctx-\u003enet);\n--\nnet/netfilter/nft_dynset.c-253-\nnet/netfilter/nft_dynset.c:254:\t\tdynset_expr = nft_dynset_expr_alloc(ctx, set,\nnet/netfilter/nft_dynset.c-255-\t\t\t\t\t\t tb[NFTA_DYNSET_EXPR], 0);\n--\nnet/netfilter/nft_dynset.c-286-\t\t\t}\nnet/netfilter/nft_dynset.c:287:\t\t\tdynset_expr = nft_dynset_expr_alloc(ctx, set, tmp, i);\nnet/netfilter/nft_dynset.c-288-\t\t\tif (IS_ERR(dynset_expr)) {\n--\nnet/netfilter/nft_dynset.c-324-\tif (priv-\u003enum_exprs)\nnet/netfilter/nft_dynset.c:325:\t\tnft_dynset_ext_add_expr(priv);\nnet/netfilter/nft_dynset.c-326-\n--\nnet/netfilter/nft_dynset.c-350-\nnet/netfilter/nft_dynset.c:351:static void nft_dynset_deactivate(const struct nft_ctx *ctx,\nnet/netfilter/nft_dynset.c-352-\t\t\t\t const struct nft_expr *expr,\n--\nnet/netfilter/nft_dynset.c-354-{\nnet/netfilter/nft_dynset.c:355:\tstruct nft_dynset *priv = nft_expr_priv(expr);\nnet/netfilter/nft_dynset.c-356-\n--\nnet/netfilter/nft_dynset.c-359-\nnet/netfilter/nft_dynset.c:360:static void nft_dynset_activate(const struct nft_ctx *ctx,\nnet/netfilter/nft_dynset.c-361-\t\t\t\tconst struct nft_expr *expr)\nnet/netfilter/nft_dynset.c-362-{\nnet/netfilter/nft_dynset.c:363:\tstruct nft_dynset *priv = nft_expr_priv(expr);\nnet/netfilter/nft_dynset.c-364-\n--\nnet/netfilter/nft_dynset.c-367-\nnet/netfilter/nft_dynset.c:368:static void nft_dynset_destroy(const struct nft_ctx *ctx,\nnet/netfilter/nft_dynset.c-369-\t\t\t const struct nft_expr *expr)\nnet/netfilter/nft_dynset.c-370-{\nnet/netfilter/nft_dynset.c:371:\tstruct nft_dynset *priv = nft_expr_priv(expr);\nnet/netfilter/nft_dynset.c-372-\tint i;\n--\nnet/netfilter/nft_dynset.c-380-\nnet/netfilter/nft_dynset.c:381:static int nft_dynset_dump(struct sk_buff *skb,\nnet/netfilter/nft_dynset.c-382-\t\t\t const struct nft_expr *expr, bool reset)\nnet/netfilter/nft_dynset.c-383-{\nnet/netfilter/nft_dynset.c:384:\tconst struct nft_dynset *priv = nft_expr_priv(expr);\nnet/netfilter/nft_dynset.c-385-\tu32 flags = priv-\u003einvert ? NFT_DYNSET_F_INV : 0;\n--\nnet/netfilter/nft_dynset.c-428-\nnet/netfilter/nft_dynset.c:429:static const struct nft_expr_ops nft_dynset_ops = {\nnet/netfilter/nft_dynset.c:430:\t.type\t\t= \u0026nft_dynset_type,\nnet/netfilter/nft_dynset.c:431:\t.size\t\t= NFT_EXPR_SIZE(sizeof(struct nft_dynset)),\nnet/netfilter/nft_dynset.c:432:\t.eval\t\t= nft_dynset_eval,\nnet/netfilter/nft_dynset.c:433:\t.init\t\t= nft_dynset_init,\nnet/netfilter/nft_dynset.c:434:\t.destroy\t= nft_dynset_destroy,\nnet/netfilter/nft_dynset.c:435:\t.activate\t= nft_dynset_activate,\nnet/netfilter/nft_dynset.c:436:\t.deactivate\t= nft_dynset_deactivate,\nnet/netfilter/nft_dynset.c:437:\t.dump\t\t= nft_dynset_dump,\nnet/netfilter/nft_dynset.c-438-};\nnet/netfilter/nft_dynset.c-439-\nnet/netfilter/nft_dynset.c:440:struct nft_expr_type nft_dynset_type __read_mostly = {\nnet/netfilter/nft_dynset.c-441-\t.name\t\t= \"dynset\",\nnet/netfilter/nft_dynset.c:442:\t.ops\t\t= \u0026nft_dynset_ops,\nnet/netfilter/nft_dynset.c:443:\t.policy\t\t= nft_dynset_policy,\nnet/netfilter/nft_dynset.c-444-\t.maxattr\t= NFTA_DYNSET_MAX,\n--\nnet/netfilter/nft_set_hash.c=126=nft_rhash_update(struct nft_set *set, const u32 *key,\n--\nnet/netfilter/nft_set_hash.c-142-\nnet/netfilter/nft_set_hash.c:143:\telem_priv = nft_dynset_new(set, expr, regs);\nnet/netfilter/nft_set_hash.c-144-\tif (!elem_priv)\n"
} |
| 31/2 | 2026/08/21 16:40 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 48307 output: 133 thoughts: 402 Thoughts: **My Assessment of the Netfilter Patch's Fuzzing Potential** Okay, so looking at this patch, it seems `CONFIG_NF_TABLES` is the key configuration option. Let's break down why this is worth fuzzing. The reasoning is pretty clear: This patch touches core netfilter tables (nf_tables) functionality. We're talking about set element addition (`nft_add_set_elem`), the commit phase (`nf_tables_commit`), dynamic set initialization (`nft_dynset_init`), and even AVX2-optimized pipapo set lookups (`pipapo_get_avx2` and `nft_pipapo_avx2_lookup`). These are all functional changes within potentially reachable network filtering paths. My initial list of symbols to focus on included `nf_tables_newsetelem`, `nf_tables_commit`, `nft_dynset_init`, `nft_pipapo_avx2_lookup`, and `pipapo_get_avx2`. However, I need to refine that a bit. I realize `nft_add_set_elem` is technically static, but the caller, `nf_tables_newsetelem` is modified, which is a pretty clear indicator of a high-value target. Since it's large, I'll keep `nf_tables_newsetelem` on the list. Now, `nf_tables_commit` and `nft_dynset_init` are also static, but they're callbacks, which means they're likely crucial entry points. `pipapo_get_avx2` and `nft_pipapo_avx2_lookup` are non-static. Let me quickly double-check that `pipapo_get_avx2` isn't exported...yup, it's non-static, residing in `nft_set_pipapo_avx2.c`. Here's my final assessment. |
| 32/2 | 2026/08/21 16:40 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"NF_TABLES"
],
"FocusSymbols": [
"nf_tables_newsetelem",
"nf_tables_commit",
"nft_dynset_init",
"nft_pipapo_avx2_lookup",
"pipapo_get_avx2"
],
"Reasoning": "The patch modifies core netfilter tables (nf_tables) logic, including set element addition, commit phase, dynamic set initialization, and AVX2 pipapo set lookup. These are functional changes in reachable core network filtering paths.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"NF_TABLES"
],
"FocusSymbols": [
"nf_tables_newsetelem",
"nf_tables_commit",
"nft_dynset_init",
"nft_pipapo_avx2_lookup",
"pipapo_get_avx2"
],
"Reasoning": "The patch modifies core netfilter tables (nf_tables) logic, including set element addition, commit phase, dynamic set initialization, and AVX2 pipapo set lookup. These are functional changes in reachable core network filtering paths.",
"WorthFuzzing": true
} |
| 33/1 | 2026/08/21 16:40 | action | If |
0mArgs:{
"WorthFuzzing": true
}Results: null |
| 34/2 | 2026/08/21 16:40 | agent | kmsan-evaluator |
0mModel:best-expensive Args: null Results: {
"KMSANReasoning": "The patch series primarily consists of:\n1. Removal of `pr_debug` statements and conversion of some to `pr_info_ratelimited` across various netfilter modules.\n2. Conversion of `WARN_ON` to `DEBUG_NET_WARN_ON_ONCE`.\n3. Refactoring of expression cloning (`nft_set_elem_expr_clone`) in `nf_tables_api.c` and `nft_dynset.c` to manage expression ownership using an `override_exprs` flag, likely addressing memory leaks or use-after-free issues.\n4. A logic fix in `nft_hook_list_find` for interface name string comparison.\n5. A fix in `pipapo_get_avx2` to ensure `vzeroupper` is called on all return paths.\n6. Reordering of `nft_flow_rule_offload_commit` in `nf_tables_commit`.\n\nNone of these changes introduce new allocations of complex data structures sent to userspace without initialization, nor do they introduce conditional logic based on potentially uninitialized memory. The `override_exprs` bitfield added to `struct nft_dynset` is part of a zero-allocated structure (via `nft_expr_init`). Any memory safety issues related to the modified expression management (such as use-after-free or double free) will be effectively caught by standard KASAN. Therefore, a dedicated KMSAN fuzzing session is not required.",
"NeedsKMSAN": false
}Instruction: You are an expert Linux kernel security engineer specializing in kernel memory
error detectors (KASAN and KMSAN). Your job is to review the provided patch series and
determine if the code changes justify spawning a dedicated KMSAN (KernelMemorySanitizer)
fuzzing session in addition to standard KASAN fuzzing.
CRITICAL DISTINCTION BETWEEN KASAN AND KMSAN:
- Standard KASAN kernel builds (upstream-apparmor-kasan.config) already enable
a comprehensive suite of debugging tools and sanitizers, including KASAN
(out-of-bounds accesses, use-after-free, double free, invalid free), LOCKDEP
(locking bugs and deadlocks), UB-sanitizers, and memory corruption checks.
- KMSAN (KernelMemorySanitizer) detects reads of UNINITIALIZED memory (stack, heap,
or page allocations) and kernel-to-user memory info-leaks.
Rule: THERE IS NO SENSE IN RUNNING A KMSAN SESSION IF A BUG CAN BE CAUGHT BY KASAN,
LOCKDEP, OR OTHER STANDARD BUG DETECTORS.
A dedicated KMSAN fuzzing session incurs significant resource costs. You must ONLY
set NeedsKMSAN=true if the code changes introduce or expose UNINITIALIZED MEMORY risks
that are detected ONLY by KMSAN.
Look holistically at the patch series and surrounding code. Even if no direct
uninitialized field accesses or new buffer allocations are added in the diff itself,
a patch may alter control flow, bounds checking, or data length calculations in ways
that change how the rest of the code operates on existing buffers (e.g. allowing
uninitialized stack/heap memory to be read, copied to user space, or used in control
flow). Do not hesitate to use your code access tools to inspect the surrounding code,
called functions, and callers.
Set NeedsKMSAN=true ONLY IF the patch introduces or modifies:
1. Kernel structures sent to user space (via copy_to_user, put_user, netlink skb
attributes, ioctl output arguments, socket options, or BPF buffers) where fields
or structure padding might not be fully initialized/zeroed.
2. Conditional logic or branching that depends on potentially uninitialized variables
or struct fields.
3. Allocation or initialization of complex data structures where uninitialized fields
could be read later in reachable code paths.
4. Bounds checks, lengths, or logic in a way that allows surrounding code to access
uninitialized bytes of existing buffers.
Set NeedsKMSAN=false IF:
- The code changes primarily risk out-of-bounds access, array overflows, NULL pointer
dereferences, locking deadlocks, or use-after-free bugs (these are already caught
by KASAN, LOCKDEP, or standard bug detectors).
- All stack/heap structures touched or introduced by the patch are fully zeroed
or initialized (e.g. using = {0}, memset, kzalloc) before being read or copied.
- The patch does not introduce any risk of uninitialized memory usage or info-leaks.
Use your code access tools to inspect the surrounding code if necessary, then provide
detailed KMSANReasoning contrasting KASAN vs KMSAN applicability for this patch.
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: For your convenience, here is the diff of the changes:
commit 52c1637fa25dc4634685f2566eba4bcc60afa332
Author: syz-cluster <triage@syzkaller.com>
Date: Fri Aug 21 16:38:19 2026 +0000
syz-cluster: applied patch under review
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
index 238f6ecb90e99..9d597482363d9 100644
--- a/include/net/netfilter/nf_tables.h
+++ b/include/net/netfilter/nf_tables.h
@@ -870,8 +870,6 @@ struct nft_elem_priv *nft_set_elem_init(const struct nft_set *set,
const u32 *key, const u32 *key_end,
const u32 *data,
u64 timeout, u64 expiration, gfp_t gfp);
-int nft_set_elem_expr_clone(const struct nft_ctx *ctx, struct nft_set *set,
- struct nft_expr *expr_array[]);
void nft_set_elem_expr_destroy(const struct nft_ctx *ctx,
struct nft_set_elem_expr *elem_expr);
void nft_set_elem_destroy(const struct nft_set *set,
diff --git a/net/ipv4/netfilter/ipt_ah.c b/net/ipv4/netfilter/ipt_ah.c
index 161ba412cb08b..7131f297ada2e 100644
--- a/net/ipv4/netfilter/ipt_ah.c
+++ b/net/ipv4/netfilter/ipt_ah.c
@@ -19,12 +19,7 @@ MODULE_DESCRIPTION("Xtables: IPv4 IPsec-AH SPI match");
static inline bool
spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, bool invert)
{
- bool r;
- pr_debug("spi_match:%c 0x%x <= 0x%x <= 0x%x\n",
- invert ? '!' : ' ', min, spi, max);
- r = (spi >= min && spi <= max) ^ invert;
- pr_debug(" result %s\n", r ? "PASS" : "FAILED");
- return r;
+ return (spi >= min && spi <= max) ^ invert;
}
static bool ah_mt(const struct sk_buff *skb, struct xt_action_param *par)
@@ -42,7 +37,6 @@ static bool ah_mt(const struct sk_buff *skb, struct xt_action_param *par)
/* We've been asked to examine this packet, and we
* can't. Hence, no choice but to drop.
*/
- pr_debug("Dropping evil AH tinygram.\n");
par->hotdrop = true;
return false;
}
@@ -58,7 +52,7 @@ static int ah_mt_check(const struct xt_mtchk_param *par)
/* Must specify no unknown invflags */
if (ahinfo->invflags & ~IPT_AH_INV_MASK) {
- pr_debug("unknown flags %X\n", ahinfo->invflags);
+ pr_info_ratelimited("unknown flags %X\n", ahinfo->invflags);
return -EINVAL;
}
return 0;
diff --git a/net/ipv4/netfilter/nf_tproxy_ipv4.c b/net/ipv4/netfilter/nf_tproxy_ipv4.c
index 041c3f37f237b..5eab7a2dc8ef2 100644
--- a/net/ipv4/netfilter/nf_tproxy_ipv4.c
+++ b/net/ipv4/netfilter/nf_tproxy_ipv4.c
@@ -137,7 +137,7 @@ nf_tproxy_get_sock_v4(struct net *net, struct sk_buff *skb,
}
break;
default:
- WARN_ON(1);
+ DEBUG_NET_WARN_ON_ONCE(1);
sk = NULL;
}
diff --git a/net/ipv6/netfilter/ip6t_ah.c b/net/ipv6/netfilter/ip6t_ah.c
index 1258783ed8762..dab7dbc6a675c 100644
--- a/net/ipv6/netfilter/ip6t_ah.c
+++ b/net/ipv6/netfilter/ip6t_ah.c
@@ -24,13 +24,7 @@ MODULE_AUTHOR("Andras Kis-Szabo <kisza@sch.bme.hu>");
static inline bool
spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, bool invert)
{
- bool r;
-
- pr_debug("spi_match:%c 0x%x <= 0x%x <= 0x%x\n",
- invert ? '!' : ' ', min, spi, max);
- r = (spi >= min && spi <= max) ^ invert;
- pr_debug(" result %s\n", r ? "PASS" : "FAILED");
- return r;
+ return (spi >= min && spi <= max) ^ invert;
}
static bool ah_mt6(const struct sk_buff *skb, struct xt_action_param *par)
@@ -62,23 +56,6 @@ static bool ah_mt6(const struct sk_buff *skb, struct xt_action_param *par)
return false;
}
- pr_debug("IPv6 AH LEN %u %u ", hdrlen, ah->hdrlen);
- pr_debug("RES %04X ", ah->reserved);
- pr_debug("SPI %u %08X\n", ntohl(ah->spi), ntohl(ah->spi));
-
- pr_debug("IPv6 AH spi %02X ",
- spi_match(ahinfo->spis[0], ahinfo->spis[1],
- ntohl(ah->spi),
- !!(ahinfo->invflags & IP6T_AH_INV_SPI)));
- pr_debug("len %02X %04X %02X ",
- ahinfo->hdrlen, hdrlen,
- (!ahinfo->hdrlen ||
- (ahinfo->hdrlen == hdrlen) ^
- !!(ahinfo->invflags & IP6T_AH_INV_LEN)));
- pr_debug("res %02X %04X %02X\n",
- ahinfo->hdrres, ah->reserved,
- !(ahinfo->hdrres && ah->reserved));
-
return spi_match(ahinfo->spis[0], ahinfo->spis[1],
ntohl(ah->spi),
!!(ahinfo->invflags & IP6T_AH_INV_SPI)) &&
@@ -93,7 +70,7 @@ static int ah_mt6_check(const struct xt_mtchk_param *par)
const struct ip6t_ah *ahinfo = par->matchinfo;
if (ahinfo->invflags & ~IP6T_AH_INV_MASK) {
- pr_debug("unknown flags %X\n", ahinfo->invflags);
+ pr_info_ratelimited("unknown flags %X\n", ahinfo->invflags);
return -EINVAL;
}
return 0;
diff --git a/net/ipv6/netfilter/ip6t_frag.c b/net/ipv6/netfilter/ip6t_frag.c
index 3aad6439386b1..f5f3cfb8704cf 100644
--- a/net/ipv6/netfilter/ip6t_frag.c
+++ b/net/ipv6/netfilter/ip6t_frag.c
@@ -23,12 +23,7 @@ MODULE_AUTHOR("Andras Kis-Szabo <kisza@sch.bme.hu>");
static inline bool
id_match(u_int32_t min, u_int32_t max, u_int32_t id, bool invert)
{
- bool r;
- pr_debug("id_match:%c 0x%x <= 0x%x <= 0x%x\n", invert ? '!' : ' ',
- min, id, max);
- r = (id >= min && id <= max) ^ invert;
- pr_debug(" result %s\n", r ? "PASS" : "FAILED");
- return r;
+ return (id >= min && id <= max) ^ invert;
}
static bool
@@ -53,38 +48,6 @@ frag_mt6(const struct sk_buff *skb, struct xt_action_param *par)
return false;
}
- pr_debug("INFO %04X ", fh->frag_off);
- pr_debug("OFFSET %04X ", ntohs(fh->frag_off) & ~0x7);
- pr_debug("RES %02X %04X", fh->reserved, ntohs(fh->frag_off) & 0x6);
- pr_debug("MF %04X ", fh->frag_off & htons(IP6_MF));
- pr_debug("ID %u %08X\n", ntohl(fh->identification),
- ntohl(fh->identification));
-
- pr_debug("IPv6 FRAG id %02X ",
- id_match(fraginfo->ids[0], fraginfo->ids[1],
- ntohl(fh->identification),
- !!(fraginfo->invflags & IP6T_FRAG_INV_IDS)));
- pr_debug("res %02X %02X%04X %02X ",
- fraginfo->flags & IP6T_FRAG_RES, fh->reserved,
- ntohs(fh->frag_off) & 0x6,
- !((fraginfo->flags & IP6T_FRAG_RES) &&
- (fh->reserved || (ntohs(fh->frag_off) & 0x06))));
- pr_debug("first %02X %02X %02X ",
- fraginfo->flags & IP6T_FRAG_FST,
- ntohs(fh->frag_off) & ~0x7,
- !((fraginfo->flags & IP6T_FRAG_FST) &&
- (ntohs(fh->frag_off) & ~0x7)));
- pr_debug("mf %02X %02X %02X ",
- fraginfo->flags & IP6T_FRAG_MF,
- ntohs(fh->frag_off) & IP6_MF,
- !((fraginfo->flags & IP6T_FRAG_MF) &&
- !((ntohs(fh->frag_off) & IP6_MF))));
- pr_debug("last %02X %02X %02X\n",
- fraginfo->flags & IP6T_FRAG_NMF,
- ntohs(fh->frag_off) & IP6_MF,
- !((fraginfo->flags & IP6T_FRAG_NMF) &&
- (ntohs(fh->frag_off) & IP6_MF)));
-
return id_match(fraginfo->ids[0], fraginfo->ids[1],
ntohl(fh->identification),
!!(fraginfo->invflags & IP6T_FRAG_INV_IDS)) &&
@@ -103,7 +66,7 @@ static int frag_mt6_check(const struct xt_mtchk_param *par)
const struct ip6t_frag *fraginfo = par->matchinfo;
if (fraginfo->invflags & ~IP6T_FRAG_INV_MASK) {
- pr_debug("unknown flags %X\n", fraginfo->invflags);
+ pr_info_ratelimited("unknown flags %X\n", fraginfo->invflags);
return -EINVAL;
}
return 0;
diff --git a/net/ipv6/netfilter/ip6t_hbh.c b/net/ipv6/netfilter/ip6t_hbh.c
index 6d1a5d2026a67..37c207d3152a4 100644
--- a/net/ipv6/netfilter/ip6t_hbh.c
+++ b/net/ipv6/netfilter/ip6t_hbh.c
@@ -79,14 +79,6 @@ hbh_mt6(const struct sk_buff *skb, struct xt_action_param *par)
return false;
}
- pr_debug("IPv6 OPTS LEN %u %u ", hdrlen, oh->hdrlen);
-
- pr_debug("len %02X %04X %02X ",
- optinfo->hdrlen, hdrlen,
- (!(optinfo->flags & IP6T_OPTS_LEN) ||
- ((optinfo->hdrlen == hdrlen) ^
- !!(optinfo->invflags & IP6T_OPTS_INV_LEN))));
-
ret = (!(optinfo->flags & IP6T_OPTS_LEN) ||
((optinfo->hdrlen == hdrlen) ^
!!(optinfo->invflags & IP6T_OPTS_INV_LEN)));
@@ -96,8 +88,6 @@ hbh_mt6(const struct sk_buff *skb, struct xt_action_param *par)
if (!(optinfo->flags & IP6T_OPTS_OPTS)) {
return ret;
} else {
- pr_debug("Strict ");
- pr_debug("#%d ", optinfo->optsnr);
for (temp = 0; temp < optinfo->optsnr; temp++) {
/* type field exists ? */
if (hdrlen < 1)
@@ -108,13 +98,9 @@ hbh_mt6(const struct sk_buff *skb, struct xt_action_param *par)
break;
/* Type check */
- if (*tp != (optinfo->opts[temp] & 0xFF00) >> 8) {
- pr_debug("Tbad %02X %02X\n", *tp,
- (optinfo->opts[temp] & 0xFF00) >> 8);
+ if (*tp != (optinfo->opts[temp] & 0xFF00) >> 8)
return false;
- } else {
- pr_debug("Tok ");
- }
+
/* Length check */
if (*tp) {
u16 spec_len;
@@ -129,26 +115,18 @@ hbh_mt6(const struct sk_buff *skb, struct xt_action_param *par)
break;
spec_len = optinfo->opts[temp] & 0x00FF;
- if (spec_len != 0x00FF && spec_len != *lp) {
- pr_debug("Lbad %02X %04X\n", *lp,
- spec_len);
+ if (spec_len != 0x00FF && spec_len != *lp)
return false;
- }
- pr_debug("Lok ");
+
optlen = *lp + 2;
} else {
- pr_debug("Pad1\n");
optlen = 1;
}
- /* Step to the next */
- pr_debug("len%04X\n", optlen);
-
if ((ptr > skb->len - optlen || hdrlen < optlen) &&
- temp < optinfo->optsnr - 1) {
- pr_debug("new pointer is too large!\n");
+ temp < optinfo->optsnr - 1)
break;
- }
+
ptr += optlen;
hdrlen -= optlen;
}
@@ -166,16 +144,16 @@ static int hbh_mt6_check(const struct xt_mtchk_param *par)
const struct ip6t_opts *optsinfo = par->matchinfo;
if (optsinfo->invflags & ~IP6T_OPTS_INV_MASK) {
- pr_debug("unknown flags %X\n", optsinfo->invflags);
+ pr_info_ratelimited("unknown flags %X\n", optsinfo->invflags);
return -EINVAL;
}
if (optsinfo->optsnr > IP6T_OPTS_OPTSNR) {
- pr_debug("too many supported opts specified\n");
+ pr_info_ratelimited("too many supported opts specified\n");
return -EINVAL;
}
if (optsinfo->flags & IP6T_OPTS_NSTRICT) {
- pr_debug("Not strict - not implemented");
+ pr_info_ratelimited("Not strict - not implemented");
return -EINVAL;
}
diff --git a/net/ipv6/netfilter/ip6t_mh.c b/net/ipv6/netfilter/ip6t_mh.c
index fd492b69acbc0..ba6dcc7791a09 100644
--- a/net/ipv6/netfilter/ip6t_mh.c
+++ b/net/ipv6/netfilter/ip6t_mh.c
@@ -42,14 +42,11 @@ static bool mh_mt6(const struct sk_buff *skb, struct xt_action_param *par)
if (mh == NULL) {
/* We've been asked to examine this packet, and we
can't. Hence, no choice but to drop. */
- pr_debug("Dropping evil MH tinygram.\n");
par->hotdrop = true;
return false;
}
if (mh->ip6mh_proto != IPPROTO_NONE) {
- pr_debug("Dropping invalid MH Payload Proto: %u\n",
- mh->ip6mh_proto);
par->hotdrop = true;
return false;
}
diff --git a/net/ipv6/netfilter/ip6t_rt.c b/net/ipv6/netfilter/ip6t_rt.c
index 278b52752f364..0c01ac2746d1f 100644
--- a/net/ipv6/netfilter/ip6t_rt.c
+++ b/net/ipv6/netfilter/ip6t_rt.c
@@ -155,18 +155,18 @@ static int rt_mt6_check(const struct xt_mtchk_param *par)
const struct ip6t_rt *rtinfo = par->matchinfo;
if (rtinfo->invflags & ~IP6T_RT_INV_MASK) {
- pr_debug("unknown flags %X\n", rtinfo->invflags);
+ pr_info_ratelimited("unknown flags %X\n", rtinfo->invflags);
return -EINVAL;
}
if (rtinfo->addrnr > IP6T_RT_HOPS) {
- pr_debug("too many addresses specified\n");
+ pr_info_ratelimited("too many addresses specified\n");
return -EINVAL;
}
if ((rtinfo->flags & (IP6T_RT_RES | IP6T_RT_FST_MASK)) &&
(!(rtinfo->flags & IP6T_RT_TYP) ||
(rtinfo->rt_type != 0) ||
(rtinfo->invflags & IP6T_RT_INV_TYP))) {
- pr_debug("`--rt-type 0' required before `--rt-0-*'");
+ pr_info_ratelimited("`--rt-type 0' required before `--rt-0-*'");
return -EINVAL;
}
diff --git a/net/ipv6/netfilter/nf_tproxy_ipv6.c b/net/ipv6/netfilter/nf_tproxy_ipv6.c
index b2f59ed9d7cc0..12ec36a6be2e1 100644
--- a/net/ipv6/netfilter/nf_tproxy_ipv6.c
+++ b/net/ipv6/netfilter/nf_tproxy_ipv6.c
@@ -136,7 +136,7 @@ nf_tproxy_get_sock_v6(struct net *net, struct sk_buff *skb, int thoff,
}
break;
default:
- WARN_ON(1);
+ DEBUG_NET_WARN_ON_ONCE(1);
sk = NULL;
}
diff --git a/net/netfilter/nf_conncount.c b/net/netfilter/nf_conncount.c
index 85487f92af506..4292c3d9addde 100644
--- a/net/netfilter/nf_conncount.c
+++ b/net/netfilter/nf_conncount.c
@@ -251,7 +251,8 @@ static int __nf_conncount_add(struct net *net,
list->last_gc_count = list->count;
add_new_node:
- if (WARN_ON_ONCE(list->count > INT_MAX)) {
+ if (unlikely(list->count > INT_MAX)) {
+ DEBUG_NET_WARN_ON_ONCE(1);
err = -EOVERFLOW;
goto out_put;
}
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index c112ecc4fca32..5cee9e46cca4b 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -1978,7 +1978,7 @@ static int nft_dump_stats(struct sk_buff *skb, struct nft_stats __percpu *stats)
return -ENOSPC;
}
-static bool hook_is_prefix(struct nft_hook *hook)
+static bool hook_is_prefix(const struct nft_hook *hook)
{
return strlen(hook->ifname) >= hook->ifnamelen;
}
@@ -2445,8 +2445,11 @@ static struct nft_hook *nft_hook_list_find(struct list_head *hook_list,
struct nft_hook *hook;
list_for_each_entry(hook, hook_list, list) {
- if (!strncmp(hook->ifname, this->ifname,
- min(hook->ifnamelen, this->ifnamelen))) {
+ if (hook_is_prefix(hook) != hook_is_prefix(this))
+ continue;
+ if (hook->ifnamelen != this->ifnamelen)
+ continue;
+ if (!strncmp(hook->ifname, this->ifname, hook->ifnamelen)) {
if (hook->flags & NFT_HOOK_REMOVE)
continue;
@@ -6921,39 +6924,11 @@ static void nft_trans_elems_destroy(const struct nft_ctx *ctx,
nf_tables_set_elem_destroy(ctx, te->set, te->elems[i].priv);
}
-int nft_set_elem_expr_clone(const struct nft_ctx *ctx, struct nft_set *set,
- struct nft_expr *expr_array[])
-{
- struct nft_expr *expr;
- int err, i, k;
-
- for (i = 0; i < set->num_exprs; i++) {
- expr = kzalloc(set->exprs[i]->ops->size, GFP_KERNEL_ACCOUNT);
- if (!expr)
- goto err_expr;
-
- err = nft_expr_clone(expr, set->exprs[i], GFP_KERNEL_ACCOUNT);
- if (err < 0) {
- kfree(expr);
- goto err_expr;
- }
- expr_array[i] = expr;
- }
-
- return 0;
-
-err_expr:
- for (k = i - 1; k >= 0; k--)
- nft_expr_destroy(ctx, expr_array[k]);
-
- return -ENOMEM;
-}
-
static int nft_set_elem_expr_setup(struct nft_ctx *ctx,
const struct nft_set_ext_tmpl *tmpl,
const struct nft_set_ext *ext,
struct nft_expr *expr_array[],
- u32 num_exprs)
+ u32 num_exprs, bool override_exprs)
{
struct nft_set_elem_expr *elem_expr = nft_set_ext_expr(ext);
u32 len = sizeof(struct nft_set_elem_expr);
@@ -6976,7 +6951,8 @@ static int nft_set_elem_expr_setup(struct nft_ctx *ctx,
goto err_elem_expr_setup;
elem_expr->size += expr_array[i]->ops->size;
- nft_expr_destroy(ctx, expr_array[i]);
+ if (override_exprs)
+ nft_expr_destroy(ctx, expr_array[i]);
expr_array[i] = NULL;
}
@@ -6984,7 +6960,9 @@ static int nft_set_elem_expr_setup(struct nft_ctx *ctx,
err_elem_expr_setup:
for (; i < num_exprs; i++) {
- nft_expr_destroy(ctx, expr_array[i]);
+ if (override_exprs)
+ nft_expr_destroy(ctx, expr_array[i]);
+
expr_array[i] = NULL;
}
@@ -7280,6 +7258,7 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
struct nft_set_binding *binding;
struct nft_elem_priv *elem_priv;
struct nft_object *obj = NULL;
+ bool override_exprs = false;
struct nft_userdata *udata;
struct nft_data_desc desc;
enum nft_registers dreg;
@@ -7385,6 +7364,7 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
expr_array[0] = expr;
num_exprs = 1;
+ override_exprs = true;
if (set->num_exprs && set->exprs[0]->ops != expr->ops) {
err = -EOPNOTSUPP;
@@ -7413,6 +7393,7 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
}
expr_array[i] = expr;
num_exprs++;
+ override_exprs = true;
if (set->num_exprs && expr->ops != set->exprs[i]->ops) {
err = -EOPNOTSUPP;
@@ -7426,9 +7407,8 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
}
} else if (set->num_exprs > 0 &&
!(flags & NFT_SET_ELEM_INTERVAL_END)) {
- err = nft_set_elem_expr_clone(ctx, set, expr_array);
- if (err < 0)
- goto err_set_elem_expr_clone;
+ for (i = 0; i < set->num_exprs; i++)
+ expr_array[i] = set->exprs[i];
num_exprs = set->num_exprs;
}
@@ -7567,7 +7547,8 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
udata->len = ulen - 1;
nla_memcpy(&udata->data, nla[NFTA_SET_ELEM_USERDATA], ulen);
}
- err = nft_set_elem_expr_setup(ctx, &tmpl, ext, expr_array, num_exprs);
+ err = nft_set_elem_expr_setup(ctx, &tmpl, ext, expr_array, num_exprs,
+ override_exprs);
if (err < 0)
goto err_elem_free;
@@ -7675,9 +7656,11 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
err_parse_key:
nft_data_release(&elem.key.val, NFT_DATA_VALUE);
err_set_elem_expr:
- for (i = 0; i < num_exprs && expr_array[i]; i++)
- nft_expr_destroy(ctx, expr_array[i]);
-err_set_elem_expr_clone:
+ if (override_exprs) {
+ for (i = 0; i < num_exprs && expr_array[i]; i++)
+ nft_expr_destroy(ctx, expr_array[i]);
+ }
+
return err;
}
@@ -10894,6 +10877,10 @@ static void nft_set_commit_update(struct nft_ctx *ctx,
nft_ctx_update(ctx, trans);
switch (trans->msg_type) {
+ case NFT_MSG_DELSET:
+ case NFT_MSG_DESTROYSET:
+ nft_trans_set(trans)->dead = 1;
+ break;
case NFT_MSG_DELSETELEM:
te = nft_trans_container_elem(trans);
if (!te->set->ops->commit)
@@ -10982,10 +10969,6 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb)
return -EAGAIN;
}
- err = nft_flow_rule_offload_commit(net);
- if (err < 0)
- return err;
-
/* 1. Allocate space for next generation rules_gen_X[] */
list_for_each_entry_safe(trans, next, &nft_net->commit_list, list) {
struct nft_table *table = trans->table;
@@ -11010,6 +10993,16 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb)
}
}
+ /* must be last, so audit and chain blob set up does not leave hardware
+ * in consistent state.
+ */
+ err = nft_flow_rule_offload_commit(net);
+ if (err < 0) {
+ nf_tables_commit_chain_prepare_cancel(net);
+ nf_tables_commit_audit_free(&adl);
+ return err;
+ }
+
/* step 2. Make rules_gen_X visible to packet path */
nft_set_commit_update(&ctx, nft_net);
@@ -11305,7 +11298,6 @@ static int __nf_tables_abort(struct net *net, enum nfnl_abort_action action)
{
struct nftables_pernet *nft_net = nft_pernet(net);
struct nft_trans *trans, *next;
- LIST_HEAD(set_update_list);
struct nft_trans_elem *te;
struct nft_ctx ctx = {
.net = net,
diff --git a/net/netfilter/nft_dynset.c b/net/netfilter/nft_dynset.c
index ee9d3e7b1ecf1..fa4da694e92d8 100644
--- a/net/netfilter/nft_dynset.c
+++ b/net/netfilter/nft_dynset.c
@@ -19,7 +19,8 @@ struct nft_dynset {
u8 sreg_key;
u8 sreg_data;
bool invert;
- bool expr;
+ bool expr:1,
+ override_exprs:1;
u8 num_exprs;
u64 timeout;
struct nft_expr *expr_array[NFT_SET_EXPR_MAX];
@@ -257,6 +258,7 @@ static int nft_dynset_init(const struct nft_ctx *ctx,
priv->num_exprs++;
priv->expr_array[0] = dynset_expr;
+ priv->override_exprs = true;
if (set->num_exprs > 1 ||
(set->num_exprs == 1 &&
@@ -289,6 +291,7 @@ static int nft_dynset_init(const struct nft_ctx *ctx,
}
priv->expr_array[i] = dynset_expr;
priv->num_exprs++;
+ priv->override_exprs = true;
if (set->num_exprs) {
if (i >= set->num_exprs) {
@@ -307,9 +310,8 @@ static int nft_dynset_init(const struct nft_ctx *ctx,
goto err_expr_free;
}
} else if (set->num_exprs > 0) {
- err = nft_set_elem_expr_clone(ctx, set, priv->expr_array);
- if (err < 0)
- return err;
+ for (i = 0; i < set->num_exprs; i++)
+ priv->expr_array[i] = set->exprs[i];
priv->num_exprs = set->num_exprs;
}
@@ -339,8 +341,10 @@ static int nft_dynset_init(const struct nft_ctx *ctx,
return 0;
err_expr_free:
- for (i = 0; i < priv->num_exprs; i++)
- nft_expr_destroy(ctx, priv->expr_array[i]);
+ if (priv->override_exprs) {
+ for (i = 0; i < priv->num_exprs; i++)
+ nft_expr_destroy(ctx, priv->expr_array[i]);
+ }
return err;
}
@@ -367,9 +371,10 @@ static void nft_dynset_destroy(const struct nft_ctx *ctx,
struct nft_dynset *priv = nft_expr_priv(expr);
int i;
- for (i = 0; i < priv->num_exprs; i++)
- nft_expr_destroy(ctx, priv->expr_array[i]);
-
+ if (priv->override_exprs) {
+ for (i = 0; i < priv->num_exprs; i++)
+ nft_expr_destroy(ctx, priv->expr_array[i]);
+ }
nf_tables_destroy_set(ctx, priv->set);
}
@@ -393,7 +398,7 @@ static int nft_dynset_dump(struct sk_buff *skb,
nf_jiffies64_to_msecs(priv->timeout),
NFTA_DYNSET_PAD))
goto nla_put_failure;
- if (priv->set->num_exprs == 0) {
+ if (priv->set->num_exprs == 0 || priv->override_exprs) {
if (priv->num_exprs == 1) {
if (nft_expr_dump(skb, NFTA_DYNSET_EXPR,
priv->expr_array[0], reset))
diff --git a/net/netfilter/nft_set_pipapo_avx2.c b/net/netfilter/nft_set_pipapo_avx2.c
index b3f105520a85b..21f5be68c7036 100644
--- a/net/netfilter/nft_set_pipapo_avx2.c
+++ b/net/netfilter/nft_set_pipapo_avx2.c
@@ -1134,6 +1134,7 @@ struct nft_pipapo_elem *pipapo_get_avx2(const struct nft_pipapo_match *m,
struct nft_pipapo_scratch *scratch;
const struct nft_pipapo_field *f;
unsigned long *res, *fill, *map;
+ struct nft_pipapo_elem *e;
bool map_index;
int ret = 0;
int i;
@@ -1207,14 +1208,11 @@ struct nft_pipapo_elem *pipapo_get_avx2(const struct nft_pipapo_match *m,
next_match:
if (ret < 0) {
scratch->map_index = map_index;
- kernel_fpu_end();
- __local_unlock_nested_bh(&scratch->bh_lock);
- return NULL;
+ e = NULL;
+ goto out;
}
if (last) {
- struct nft_pipapo_elem *e;
-
e = f->mt[ret].e;
if (unlikely(__nft_set_elem_expired(&e->ext, tstamp) ||
!nft_set_elem_active(&e->ext, genmask))) {
@@ -1224,9 +1222,7 @@ struct nft_pipapo_elem *pipapo_get_avx2(const struct nft_pipapo_match *m,
}
scratch->map_index = map_index;
- kernel_fpu_end();
- __local_unlock_nested_bh(&scratch->bh_lock);
- return e;
+ goto out;
}
map_index = !map_index;
@@ -1234,9 +1230,12 @@ struct nft_pipapo_elem *pipapo_get_avx2(const struct nft_pipapo_match *m,
data += NFT_PIPAPO_GROUPS_PADDED_SIZE(f);
}
+ e = NULL;
+out:
+ asm volatile("vzeroupper");
kernel_fpu_end();
__local_unlock_nested_bh(&scratch->bh_lock);
- return NULL;
+ return e;
}
/**
diff --git a/net/netfilter/xt_IDLETIMER.c b/net/netfilter/xt_IDLETIMER.c
index bfcf2d44e93db..15b698ea98aa6 100644
--- a/net/netfilter/xt_IDLETIMER.c
+++ b/net/netfilter/xt_IDLETIMER.c
@@ -102,8 +102,6 @@ static void idletimer_tg_expired(struct timer_list *t)
{
struct idletimer_tg *timer = timer_container_of(timer, t, timer);
- pr_debug("timer %s expired\n", timer->attr.attr.name);
-
schedule_work(&timer->work);
}
@@ -111,7 +109,6 @@ static void idletimer_tg_alarmproc(struct alarm *alarm, ktime_t now)
{
struct idletimer_tg *timer = alarm->data;
- pr_debug("alarm %s expired\n", timer->attr.attr.name);
schedule_work(&timer->work);
}
@@ -171,7 +168,7 @@ static int idletimer_tg_create(struct idletimer_tg_info *info)
ret = sysfs_create_file(idletimer_tg_kobj, &info->timer->attr.attr);
if (ret < 0) {
- pr_debug("couldn't add file to sysfs");
+ pr_info_ratelimited("couldn't add file to sysfs");
goto out_free_attr;
}
@@ -220,7 +217,7 @@ static int idletimer_tg_create_v1(struct idletimer_tg_info_v1 *info)
ret = sysfs_create_file(idletimer_tg_kobj, &info->timer->attr.attr);
if (ret < 0) {
- pr_debug("couldn't add file to sysfs");
+ pr_info_ratelimited("couldn't add file to sysfs");
goto out_free_attr;
}
@@ -228,7 +225,6 @@ static int idletimer_tg_create_v1(struct idletimer_tg_info_v1 *info)
kobject_uevent(idletimer_tg_kobj,KOBJ_ADD);
list_add(&info->timer->entry, &idletimer_tg_list);
- pr_debug("timer type value is %u", info->timer_type);
info->timer->timer_type = info->timer_type;
info->timer->refcnt = 1;
@@ -263,9 +259,6 @@ static unsigned int idletimer_tg_target(struct sk_buff *skb,
{
const struct idletimer_tg_info *info = par->targinfo;
- pr_debug("resetting timer %s, timeout period %u\n",
- info->label, info->timeout);
-
mod_timer(&info->timer->timer,
secs_to_jiffies(info->timeout) + jiffies);
@@ -280,9 +273,6 @@ static unsigned int idletimer_tg_target_v1(struct sk_buff *skb,
{
const struct idletimer_tg_info_v1 *info = par->targinfo;
- pr_debug("resetting timer %s, timeout period %u\n",
- info->label, info->timeout);
-
if (info->timer->timer_type & XT_IDLETIMER_ALARM) {
idletimer_start_alarm_sec(info->timer, info->timeout);
} else {
@@ -296,17 +286,17 @@ static unsigned int idletimer_tg_target_v1(struct sk_buff *skb,
static int idletimer_tg_helper(struct idletimer_tg_info *info)
{
if (info->timeout == 0) {
- pr_debug("timeout value is zero\n");
+ pr_info_ratelimited("timeout value is zero\n");
return -EINVAL;
}
if (info->timeout >= INT_MAX / 1000) {
- pr_debug("timeout value is too big\n");
+ pr_info_ratelimited("timeout value is too big\n");
return -EINVAL;
}
if (info->label[0] == '\0' ||
strnlen(info->label,
MAX_IDLETIMER_LABEL_SIZE) == MAX_IDLETIMER_LABEL_SIZE) {
- pr_debug("label is empty or not nul-terminated\n");
+ pr_info_ratelimited("label is empty or not nul-terminated\n");
return -EINVAL;
}
return 0;
@@ -318,34 +308,25 @@ static int idletimer_tg_checkentry(const struct xt_tgchk_param *par)
struct idletimer_tg_info *info = par->targinfo;
int ret;
- pr_debug("checkentry targinfo%s\n", info->label);
-
ret = idletimer_tg_helper(info);
if(ret < 0)
- {
- pr_debug("checkentry helper return invalid\n");
return -EINVAL;
- }
mutex_lock(&list_mutex);
info->timer = __idletimer_tg_find_by_label(info->label);
if (info->timer) {
if (info->timer->timer_type & XT_IDLETIMER_ALARM) {
- pr_debug("Adding/Replacing rule with same label and different timer type is not allowed\n");
mutex_unlock(&list_mutex);
+ pr_info_ratelimited("Adding/Replacing rule with same label and different timer type is not allowed\n");
return -EINVAL;
}
info->timer->refcnt++;
mod_timer(&info->timer->timer,
secs_to_jiffies(info->timeout) + jiffies);
-
- pr_debug("increased refcnt of timer %s to %u\n",
- info->label, info->timer->refcnt);
} else {
ret = idletimer_tg_create(info);
if (ret < 0) {
- pr_debug("failed to create timer\n");
mutex_unlock(&list_mutex);
return ret;
}
@@ -360,30 +341,23 @@ static int idletimer_tg_checkentry_v1(const struct xt_tgchk_param *par)
struct idletimer_tg_info_v1 *info = par->targinfo;
int ret;
- pr_debug("checkentry targinfo%s\n", info->label);
-
if (info->send_nl_msg)
return -EOPNOTSUPP;
ret = idletimer_tg_helper((struct idletimer_tg_info *)info);
if(ret < 0)
- {
- pr_debug("checkentry helper return invalid\n");
return -EINVAL;
- }
- if (info->timer_type > XT_IDLETIMER_ALARM) {
- pr_debug("invalid value for timer type\n");
+ if (info->timer_type > XT_IDLETIMER_ALARM)
return -EINVAL;
- }
mutex_lock(&list_mutex);
info->timer = __idletimer_tg_find_by_label(info->label);
if (info->timer) {
if (info->timer->timer_type != info->timer_type) {
- pr_debug("Adding/Replacing rule with same label and different timer type is not allowed\n");
mutex_unlock(&list_mutex);
+ pr_info_ratelimited("Adding/Replacing rule with same label and different timer type is not allowed\n");
return -EINVAL;
}
@@ -393,21 +367,15 @@ static int idletimer_tg_checkentry_v1(const struct xt_tgchk_param *par)
ktime_t tout = alarm_expires_remaining(&info->timer->alarm);
struct timespec64 ktimespec = ktime_to_timespec64(tout);
- if (ktimespec.tv_sec > 0) {
- pr_debug("time_expiry_remaining %lld\n",
- ktimespec.tv_sec);
+ if (ktimespec.tv_sec > 0)
idletimer_start_alarm_ktime(info->timer, tout);
- }
} else {
mod_timer(&info->timer->timer,
secs_to_jiffies(info->timeout) + jiffies);
}
- pr_debug("increased refcnt of timer %s to %u\n",
- info->label, info->timer->refcnt);
} else {
ret = idletimer_tg_create_v1(info);
if (ret < 0) {
- pr_debug("failed to create timer\n");
mutex_unlock(&list_mutex);
return ret;
}
@@ -421,19 +389,13 @@ static void idletimer_tg_destroy(const struct xt_tgdtor_param *par)
{
const struct idletimer_tg_info *info = par->targinfo;
- pr_debug("destroy targinfo %s\n", info->label);
-
mutex_lock(&list_mutex);
if (--info->timer->refcnt > 0) {
- pr_debug("decreased refcnt of timer %s to %u\n",
- info->label, info->timer->refcnt);
mutex_unlock(&list_mutex);
return;
}
- pr_debug("deleting timer %s\n", info->label);
-
list_del(&info->timer->entry);
mutex_unlock(&list_mutex);
@@ -448,19 +410,13 @@ static void idletimer_tg_destroy_v1(const struct xt_tgdtor_param *par)
{
const struct idletimer_tg_info_v1 *info = par->targinfo;
- pr_debug("destroy targinfo %s\n", info->label);
-
mutex_lock(&list_mutex);
if (--info->timer->refcnt > 0) {
- pr_debug("decreased refcnt of timer %s to %u\n",
- info->label, info->timer->refcnt);
mutex_unlock(&list_mutex);
return;
}
- pr_debug("deleting timer %s\n", info->label);
-
list_del(&info->timer->entry);
mutex_unlock(&list_mutex);
@@ -534,7 +490,7 @@ static int __init idletimer_tg_init(void)
idletimer_tg_class = class_create("xt_idletimer");
err = PTR_ERR(idletimer_tg_class);
if (IS_ERR(idletimer_tg_class)) {
- pr_debug("couldn't register device class\n");
+ pr_info_ratelimited("couldn't register device class\n");
goto out;
}
@@ -542,7 +498,7 @@ static int __init idletimer_tg_init(void)
MKDEV(0, 0), NULL, "timers");
err = PTR_ERR(idletimer_tg_device);
if (IS_ERR(idletimer_tg_device)) {
- pr_debug("couldn't register system device\n");
+ pr_info_ratelimited("couldn't register system device\n");
goto out_class;
}
@@ -551,7 +507,7 @@ static int __init idletimer_tg_init(void)
err = xt_register_targets(idletimer_tg, ARRAY_SIZE(idletimer_tg));
if (err < 0) {
- pr_debug("couldn't register xt target\n");
+ pr_info_ratelimited("couldn't register xt target\n");
goto out_dev;
}
diff --git a/net/netfilter/xt_LOG.c b/net/netfilter/xt_LOG.c
index f39244f9c0ed9..de3f176792a07 100644
--- a/net/netfilter/xt_LOG.c
+++ b/net/netfilter/xt_LOG.c
@@ -50,12 +50,12 @@ static int log_tg_check(const struct xt_tgchk_param *par)
return -EINVAL;
if (loginfo->level >= 8) {
- pr_debug("level %u >= 8\n", loginfo->level);
+ pr_info_ratelimited("level %u >= 8\n", loginfo->level);
return -EINVAL;
}
if (loginfo->prefix[sizeof(loginfo->prefix)-1] != '\0') {
- pr_debug("prefix is not null-terminated\n");
+ pr_info_ratelimited("prefix is not null-terminated\n");
return -EINVAL;
}
diff --git a/net/netfilter/xt_MASQUERADE.c b/net/netfilter/xt_MASQUERADE.c
index eae05c1783367..cea488cec5445 100644
--- a/net/netfilter/xt_MASQUERADE.c
+++ b/net/netfilter/xt_MASQUERADE.c
@@ -21,11 +21,11 @@ static int masquerade_tg_check(const struct xt_tgchk_param *par)
const struct nf_nat_ipv4_multi_range_compat *mr = par->targinfo;
if (mr->range[0].flags & NF_NAT_RANGE_MAP_IPS) {
- pr_debug("bad MAP_IPS.\n");
+ pr_info_ratelimited("bad MAP_IPS.\n");
return -EINVAL;
}
if (mr->rangesize != 1) {
- pr_debug("bad rangesize %u\n", mr->rangesize);
+ pr_info_ratelimited("bad rangesize %u\n", mr->rangesize);
return -EINVAL;
}
return nf_ct_netns_get(par->net, par->family);
diff --git a/net/netfilter/xt_NETMAP.c b/net/netfilter/xt_NETMAP.c
index cb2ee80d84fa8..8c86d9a43373a 100644
--- a/net/netfilter/xt_NETMAP.c
+++ b/net/netfilter/xt_NETMAP.c
@@ -106,11 +106,11 @@ static int netmap_tg4_check(const struct xt_tgchk_param *par)
const struct nf_nat_ipv4_multi_range_compat *mr = par->targinfo;
if (!(mr->range[0].flags & NF_NAT_RANGE_MAP_IPS)) {
- pr_debug("bad MAP_IPS.\n");
+ pr_info_ratelimited("bad MAP_IPS.\n");
return -EINVAL;
}
if (mr->rangesize != 1) {
- pr_debug("bad rangesize %u.\n", mr->rangesize);
+ pr_info_ratelimited("bad rangesize %u.\n", mr->rangesize);
return -EINVAL;
}
return nf_ct_netns_get(par->net, par->family);
diff --git a/net/netfilter/xt_REDIRECT.c b/net/netfilter/xt_REDIRECT.c
index ff66b56a3f97d..27bc0545c4f74 100644
--- a/net/netfilter/xt_REDIRECT.c
+++ b/net/netfilter/xt_REDIRECT.c
@@ -51,11 +51,11 @@ static int redirect_tg4_check(const struct xt_tgchk_param *par)
const struct nf_nat_ipv4_multi_range_compat *mr = par->targinfo;
if (mr->range[0].flags & NF_NAT_RANGE_MAP_IPS) {
- pr_debug("bad MAP_IPS.\n");
+ pr_info_ratelimited("bad MAP_IPS.\n");
return -EINVAL;
}
if (mr->rangesize != 1) {
- pr_debug("bad rangesize %u.\n", mr->rangesize);
+ pr_info_ratelimited("bad rangesize %u.\n", mr->rangesize);
return -EINVAL;
}
return nf_ct_netns_get(par->net, par->family);
diff --git a/net/netfilter/xt_cgroup.c b/net/netfilter/xt_cgroup.c
index 43d2ae2be628d..ac1b7e71cd7f5 100644
--- a/net/netfilter/xt_cgroup.c
+++ b/net/netfilter/xt_cgroup.c
@@ -33,7 +33,7 @@ static int cgroup_mt_check_v0(const struct xt_mtchk_param *par)
return -EINVAL;
if (!IS_ENABLED(CONFIG_CGROUP_NET_CLASSID)) {
- pr_info(NET_CLS_CLASSID_INVALID_MSG);
+ pr_info_ratelimited(NET_CLS_CLASSID_INVALID_MSG);
return -EINVAL;
}
@@ -49,7 +49,7 @@ static int cgroup_mt_check_v1(const struct xt_mtchk_param *par)
return -EINVAL;
if (!info->has_path && !info->has_classid) {
- pr_info("xt_cgroup: no path or classid specified\n");
+ pr_info_ratelimited("xt_cgroup: no path or classid specified\n");
return -EINVAL;
}
@@ -59,7 +59,7 @@ static int cgroup_mt_check_v1(const struct xt_mtchk_param *par)
}
if (info->has_classid && !IS_ENABLED(CONFIG_CGROUP_NET_CLASSID)) {
- pr_info(NET_CLS_CLASSID_INVALID_MSG);
+ pr_info_ratelimited(NET_CLS_CLASSID_INVALID_MSG);
return -EINVAL;
}
@@ -89,7 +89,7 @@ static int cgroup_mt_check_v2(const struct xt_mtchk_param *par)
return -EINVAL;
if (!info->has_path && !info->has_classid) {
- pr_info("xt_cgroup: no path or classid specified\n");
+ pr_info_ratelimited("xt_cgroup: no path or classid specified\n");
return -EINVAL;
}
@@ -99,7 +99,7 @@ static int cgroup_mt_check_v2(const struct xt_mtchk_param *par)
}
if (info->has_classid && !IS_ENABLED(CONFIG_CGROUP_NET_CLASSID)) {
- pr_info(NET_CLS_CLASSID_INVALID_MSG);
+ pr_info_ratelimited(NET_CLS_CLASSID_INVALID_MSG);
return -EINVAL;
}
diff --git a/net/netfilter/xt_esp.c b/net/netfilter/xt_esp.c
index 2a1c0ad0ff079..68fd75884268a 100644
--- a/net/netfilter/xt_esp.c
+++ b/net/netfilter/xt_esp.c
@@ -25,12 +25,7 @@ MODULE_ALIAS("ip6t_esp");
static inline bool
spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, bool invert)
{
- bool r;
- pr_debug("spi_match:%c 0x%x <= 0x%x <= 0x%x\n",
- invert ? '!' : ' ', min, spi, max);
- r = (spi >= min && spi <= max) ^ invert;
- pr_debug(" result %s\n", r ? "PASS" : "FAILED");
- return r;
+ return (spi >= min && spi <= max) ^ invert;
}
static bool esp_mt(const struct sk_buff *skb, struct xt_action_param *par)
@@ -48,7 +43,6 @@ static bool esp_mt(const struct sk_buff *skb, struct xt_action_param *par)
/* We've been asked to examine this packet, and we
* can't. Hence, no choice but to drop.
*/
- pr_debug("Dropping evil ESP tinygram.\n");
par->hotdrop = true;
return false;
}
@@ -62,7 +56,7 @@ static int esp_mt_check(const struct xt_mtchk_param *par)
const struct xt_esp *espinfo = par->matchinfo;
if (espinfo->invflags & ~XT_ESP_INV_MASK) {
- pr_debug("unknown flags %X\n", espinfo->invflags);
+ pr_info_ratelimited("unknown flags %X\n", espinfo->invflags);
return -EINVAL;
}
diff --git a/net/netfilter/xt_ipcomp.c b/net/netfilter/xt_ipcomp.c
index 472da639a32e2..3299c1ea60f9e 100644
--- a/net/netfilter/xt_ipcomp.c
+++ b/net/netfilter/xt_ipcomp.c
@@ -29,12 +29,7 @@ MODULE_ALIAS("ip6t_ipcomp");
static inline bool
spi_match(u_int32_t min, u_int32_t max, u_int32_t spi, bool invert)
{
- bool r;
- pr_debug("spi_match:%c 0x%x <= 0x%x <= 0x%x\n",
- invert ? '!' : ' ', min, spi, max);
- r = (spi >= min && spi <= max) ^ invert;
- pr_debug(" result %s\n", r ? "PASS" : "FAILED");
- return r;
+ return (spi >= min && spi <= max) ^ invert;
}
static bool comp_mt(const struct sk_buff *skb, struct xt_action_param *par)
@@ -52,7 +47,6 @@ static bool comp_mt(const struct sk_buff *skb, struct xt_action_param *par)
/* We've been asked to examine this packet, and we
* can't. Hence, no choice but to drop.
*/
- pr_debug("Dropping evil IPComp tinygram.\n");
par->hotdrop = true;
return false;
}
diff --git a/net/netfilter/xt_iprange.c b/net/netfilter/xt_iprange.c
index 0c9e014e30b49..bf61141fb7850 100644
--- a/net/netfilter/xt_iprange.c
+++ b/net/netfilter/xt_iprange.c
@@ -24,27 +24,15 @@ iprange_mt4(const struct sk_buff *skb, struct xt_action_param *par)
m = ntohl(iph->saddr) < ntohl(info->src_min.ip);
m |= ntohl(iph->saddr) > ntohl(info->src_max.ip);
m ^= !!(info->flags & IPRANGE_SRC_INV);
- if (m) {
- pr_debug("src IP %pI4 NOT in range %s%pI4-%pI4\n",
- &iph->saddr,
- (info->flags & IPRANGE_SRC_INV) ? "(INV) " : "",
- &info->src_min.ip,
- &info->src_max.ip);
+ if (m)
return false;
- }
}
if (info->flags & IPRANGE_DST) {
m = ntohl(iph->daddr) < ntohl(info->dst_min.ip);
m |= ntohl(iph->daddr) > ntohl(info->dst_max.ip);
m ^= !!(info->flags & IPRANGE_DST_INV);
- if (m) {
- pr_debug("dst IP %pI4 NOT in range %s%pI4-%pI4\n",
- &iph->daddr,
- (info->flags & IPRANGE_DST_INV) ? "(INV) " : "",
- &info->dst_min.ip,
- &info->dst_max.ip);
+ if (m)
return false;
- }
}
return true;
}
@@ -73,27 +61,15 @@ iprange_mt6(const struct sk_buff *skb, struct xt_action_param *par)
m = iprange_ipv6_lt(&iph->saddr, &info->src_min.in6);
m |= iprange_ipv6_lt(&info->src_max.in6, &iph->saddr);
m ^= !!(info->flags & IPRANGE_SRC_INV);
- if (m) {
- pr_debug("src IP %pI6 NOT in range %s%pI6-%pI6\n",
- &iph->saddr,
- (info->flags & IPRANGE_SRC_INV) ? "(INV) " : "",
- &info->src_min.in6,
- &info->src_max.in6);
+ if (m)
return false;
- }
}
if (info->flags & IPRANGE_DST) {
m = iprange_ipv6_lt(&iph->daddr, &info->dst_min.in6);
m |= iprange_ipv6_lt(&info->dst_max.in6, &iph->daddr);
m ^= !!(info->flags & IPRANGE_DST_INV);
- if (m) {
- pr_debug("dst IP %pI6 NOT in range %s%pI6-%pI6\n",
- &iph->daddr,
- (info->flags & IPRANGE_DST_INV) ? "(INV) " : "",
- &info->dst_min.in6,
- &info->dst_max.in6);
+ if (m)
return false;
- }
}
return true;
}
diff --git a/net/netfilter/xt_ipvs.c b/net/netfilter/xt_ipvs.c
index 253c71cc9a634..e13c0ffb73a9a 100644
--- a/net/netfilter/xt_ipvs.c
+++ b/net/netfilter/xt_ipvs.c
@@ -148,7 +148,6 @@ ipvs_mt(const struct sk_buff *skb, struct xt_action_param *par)
out_put_cp:
__ip_vs_conn_put(cp);
out:
- pr_debug("match=%d\n", match);
return match;
}
diff --git a/net/netfilter/xt_multiport.c b/net/netfilter/xt_multiport.c
index a1691ff405d3c..bff5f53a9befb 100644
--- a/net/netfilter/xt_multiport.c
+++ b/net/netfilter/xt_multiport.c
@@ -37,7 +37,6 @@ ports_match_v1(const struct xt_multiport_v1 *minfo,
if (minfo->pflags[i]) {
/* range port matching */
e = minfo->ports[++i];
- pr_debug("src or dst matches with %d-%d?\n", s, e);
switch (minfo->flags) {
case XT_MULTIPORT_SOURCE:
@@ -58,8 +57,6 @@ ports_match_v1(const struct xt_multiport_v1 *minfo,
}
} else {
/* exact port matching */
- pr_debug("src or dst matches with %d?\n", s);
-
switch (minfo->flags) {
case XT_MULTIPORT_SOURCE:
if (src == s)
@@ -97,7 +94,6 @@ multiport_mt(const struct sk_buff *skb, struct xt_action_param *par)
/* We've been asked to examine this packet, and we
* can't. Hence, no choice but to drop.
*/
- pr_debug("Dropping evil offset=0 tinygram.\n");
par->hotdrop = true;
return false;
}
diff --git a/net/netfilter/xt_sctp.c b/net/netfilter/xt_sctp.c
index b46a6a5120583..d35c21d9651b0 100644
--- a/net/netfilter/xt_sctp.c
+++ b/net/netfilter/xt_sctp.c
@@ -48,30 +48,17 @@ match_packet(const struct sk_buff *skb,
const struct xt_sctp_flag_info *flag_info = info->flag_info;
int flag_count = info->flag_count;
-#ifdef DEBUG
- int i = 0;
-#endif
-
if (chunk_match_type == SCTP_CHUNK_MATCH_ALL)
SCTP_CHUNKMAP_COPY(chunkmapcopy, info->chunkmap);
do {
sch = skb_header_pointer(skb, offset, sizeof(_sch), &_sch);
if (sch == NULL || sch->length == 0) {
- pr_debug("Dropping invalid SCTP packet.\n");
*hotdrop = true;
return false;
}
-#ifdef DEBUG
- pr_debug("Chunk num: %d\toffset: %d\ttype: %d\tlength: %d"
- "\tflags: %x\n",
- ++i, offset, sch->type, htons(sch->length),
- sch->flags);
-#endif
offset += SCTP_PAD4(ntohs(sch->length));
- pr_debug("skb->len: %d\toffset: %d\n", skb->len, offset);
-
if (SCTP_CHUNKMAP_IS_SET(info->chunkmap, sch->type)) {
switch (chunk_match_type) {
case SCTP_CHUNK_MATCH_ANY:
@@ -121,18 +108,14 @@ sctp_mt(const struct sk_buff *skb, struct xt_action_param *par)
const struct sctphdr *sh;
struct sctphdr _sh;
- if (par->fragoff != 0) {
- pr_debug("Dropping non-first fragment.. FIXME\n");
+ if (par->fragoff != 0)
return false;
- }
sh = skb_header_pointer(skb, par->thoff, sizeof(_sh), &_sh);
if (sh == NULL) {
- pr_debug("Dropping evil TCP offset=0 tinygram.\n");
par->hotdrop = true;
return false;
}
- pr_debug("spt: %d\tdpt: %d\n", ntohs(sh->source), ntohs(sh->dest));
return SCCHECK(ntohs(sh->source) >= info->spts[0]
&& ntohs(sh->source) <= info->spts[1],
diff --git a/net/netfilter/xt_tcpudp.c b/net/netfilter/xt_tcpudp.c
index f76cf18f1a244..70608b8d06ab2 100644
--- a/net/netfilter/xt_tcpudp.c
+++ b/net/netfilter/xt_tcpudp.c
@@ -44,8 +44,6 @@ tcp_find_option(u_int8_t option,
u_int8_t _opt[60 - sizeof(struct tcphdr)];
unsigned int i;
- pr_debug("finding option\n");
-
if (!optlen)
return invert;
@@ -81,10 +79,8 @@ static bool tcp_mt(const struct sk_buff *skb, struct xt_action_param *par)
causes this. Its a cracker trying to break in by doing a
flag overwrite to pass the direction checks.
*/
- if (par->fragoff == 1) {
- pr_debug("Dropping evil TCP offset=1 frag.\n");
+ if (par->fragoff == 1)
par->hotdrop = true;
- }
/* Must not be a fragment. */
return false;
}
@@ -93,7 +89,6 @@ static bool tcp_mt(const struct sk_buff *skb, struct xt_action_param *par)
if (th == NULL) {
/* We've been asked to examine this packet, and we
can't. Hence, no choice but to drop. */
- pr_debug("Dropping evil TCP offset=0 tinygram.\n");
par->hotdrop = true;
return false;
}
@@ -145,7 +140,6 @@ static bool udp_mt(const struct sk_buff *skb, struct xt_action_param *par)
if (uh == NULL) {
/* We've been asked to examine this packet, and we
can't. Hence, no choice but to drop. */
- pr_debug("Dropping evil UDP tinygram.\n");
par->hotdrop = true;
return false;
}
|
| 35/3 | 2026/08/21 16:40 | llm | kmsan-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 20948 output: 342 thoughts: 1782 Thoughts: **KMSAN Fuzzing Session Assessment** Okay, so I need to decide if we need a dedicated KMSAN fuzzing session for this patch series. Let's break down the changes. It looks like the core of the patch involves refactoring, particularly around expression cloning in `nf_tables` and `nft_dynset`. Specifically, `nft_set_elem_expr_clone` is gone, and `nft_set_elem_expr_setup` now uses an `override_exprs` boolean. `nft_add_set_elem` and `nft_dynset_init` are updated to either take ownership or reuse expressions, which feels like a good change – potentially fixing memory leaks or use-after-free scenarios. I'm thinking, are there any uninitialized memory risks here? Let's trace it. The `nft_dynset` struct gets a bitfield `override_exprs:1`. Hmm, let me check where that's initialized... Ah, it's part of the private data (`nft_expr_priv`) of an expression allocated with `kzalloc`. So, it *should* be zero-initialized. I should double check that in `nft_set_elem_expr_setup` though. Yes, that makes sense. It takes `override_exprs`. Okay, the other changes are mostly straightforward: removing `pr_debug` statements, replacing `WARN_ON` with `DEBUG_NET_WARN_ON_ONCE` (good for debugging), and fixing the string comparison in `nft_hook_list_find` to prevent potential incorrect prefix matching. The refactoring of `pipapo_get_avx2` to ensure `vzeroupper` is called is good hygiene. And the `nf_tables_commit` reordering seems benign. Now, does anything here expose uninitialized memory to user space? I see in `nft_dynset_dump` there's a check using `override_exprs`. It *appears* safe; it's just dumping the expression, not using any uninitialized data in a conditional branch. So, taking stock: the major changes focus on *preventing* memory errors, not introducing them. The expression cloning changes are all about safer memory handling. The `override_exprs` bitfield is initialized. The other fixes are just logic or debugging improvements. There's no introduction of new complex data structures going to userspace without clear initialization. My conclusion is that I don't see any exposed uninitialized memory being used in a conditional path. The changes mostly involve logic fixes, memory leak fixes, and reducing the verbosity of debug prints. Any memory-safety issues related to these changes will be caught by KASAN. **Therefore, I'm confident that a dedicated KMSAN fuzzing session is not necessary for this patch series.** |
| 36/3 | 2026/08/21 16:40 | tool | set-results |
0mArgs:{
"KMSANReasoning": "The patch series primarily consists of:\n1. Removal of `pr_debug` statements and conversion of some to `pr_info_ratelimited` across various netfilter modules.\n2. Conversion of `WARN_ON` to `DEBUG_NET_WARN_ON_ONCE`.\n3. Refactoring of expression cloning (`nft_set_elem_expr_clone`) in `nf_tables_api.c` and `nft_dynset.c` to manage expression ownership using an `override_exprs` flag, likely addressing memory leaks or use-after-free issues.\n4. A logic fix in `nft_hook_list_find` for interface name string comparison.\n5. A fix in `pipapo_get_avx2` to ensure `vzeroupper` is called on all return paths.\n6. Reordering of `nft_flow_rule_offload_commit` in `nf_tables_commit`.\n\nNone of these changes introduce new allocations of complex data structures sent to userspace without initialization, nor do they introduce conditional logic based on potentially uninitialized memory. The `override_exprs` bitfield added to `struct nft_dynset` is part of a zero-allocated structure (via `nft_expr_init`). Any memory safety issues related to the modified expression management (such as use-after-free or double free) will be effectively caught by standard KASAN. Therefore, a dedicated KMSAN fuzzing session is not required.",
"NeedsKMSAN": false
}Results: {
"KMSANReasoning": "The patch series primarily consists of:\n1. Removal of `pr_debug` statements and conversion of some to `pr_info_ratelimited` across various netfilter modules.\n2. Conversion of `WARN_ON` to `DEBUG_NET_WARN_ON_ONCE`.\n3. Refactoring of expression cloning (`nft_set_elem_expr_clone`) in `nf_tables_api.c` and `nft_dynset.c` to manage expression ownership using an `override_exprs` flag, likely addressing memory leaks or use-after-free issues.\n4. A logic fix in `nft_hook_list_find` for interface name string comparison.\n5. A fix in `pipapo_get_avx2` to ensure `vzeroupper` is called on all return paths.\n6. Reordering of `nft_flow_rule_offload_commit` in `nf_tables_commit`.\n\nNone of these changes introduce new allocations of complex data structures sent to userspace without initialization, nor do they introduce conditional logic based on potentially uninitialized memory. The `override_exprs` bitfield added to `struct nft_dynset` is part of a zero-allocated structure (via `nft_expr_init`). Any memory safety issues related to the modified expression management (such as use-after-free or double free) will be effectively caught by standard KASAN. Therefore, a dedicated KMSAN fuzzing session is not required.",
"NeedsKMSAN": false
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|