| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/11/15 14:37 | flow | patch-triage |
2mArgs:null Results: {
"EnableConfigs": [
"IP_VS",
"IP_VS_IPV6",
"IP_VS_PROTO_TCP",
"IP_VS_PROTO_UDP",
"IP_VS_PROTO_SCTP",
"IP_VS_PROTO_AH",
"IP_VS_PROTO_ESP",
"NETFILTER"
],
"FocusSymbols": [
"ip_vs_null_xmit_v6",
"ip_vs_null_xmit",
"ip_vs_nat_xmit",
"ip_vs_nat_xmit_v6",
"ip_vs_tunnel_xmit",
"ip_vs_tunnel_xmit_v6",
"ip_vs_dr_xmit",
"ip_vs_dr_xmit_v6",
"ip_vs_icmp_xmit",
"ip_vs_icmp_xmit_v6",
"ip_vs_in_hook",
"ip_vs_leave",
"tcp_conn_schedule",
"udp_conn_schedule",
"sctp_conn_schedule"
],
"KMSANReasoning": "The patch series updates IPVS (IP Virtual Server) packet transmission paths to properly handle Path MTU (PMTU) updates by passing the Netfilter hook state (`nf_hook_state`) down to `maybe_update_pmtu()` and packet transmitter functions, fixing IPv6 localnode transmitter binding, and passing NULL socket to `ip_local_out`/`ip6_local_out` during tunnel transmission.\n\nThese changes involve passing an existing fully-initialized hook state pointer from the netfilter core down the call stack, updating PMTU condition checks, and binding the appropriate transmitter function. The patch introduces no memory allocations, no reads of uninitialized stack or heap variables, no modifications to kernel-to-user data copies, and no changes to data length or buffer boundaries that could expose uninitialized memory. Any potential issues introduced by these changes (such as NULL pointer dereferences or socket state issues) are covered by standard kernel sanitizers (KASAN, standard bug checks). Therefore, a dedicated KMSAN fuzzing session is not warranted.",
"NeedsKMSAN": false,
"Reasoning": "The patch modifies core IPVS (IP Virtual Server) network stack code. It threads `struct nf_hook_state` through protocol connection scheduling, ICMP handling, and packet transmitters. It also modifies PMTU updates in `maybe_update_pmtu`, fixes IPv6 LOCALNODE packet transmission binding by adding and using `ip_vs_null_xmit_v6`, and alters socket parameter passing in `ip_vs_tunnel_xmit` and `ip_vs_tunnel_xmit_v6`. This code is fully reachable in standard QEMU environments via network sockets, netlink, and netfilter hooks.",
"WorthFuzzing": true
} |
| 1/1 | 2026/11/15 14:37 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 4820c4a56fc31dc751a6f8cd1791bfc538820726\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Sun Nov 15 14:37:32 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/include/net/ip_vs.h b/include/net/ip_vs.h\nindex 9a83bff32569da..398d748f01ec88 100644\n--- a/include/net/ip_vs.h\n+++ b/include/net/ip_vs.h\n@@ -731,7 +731,8 @@ struct ip_vs_protocol {\n \t\t\t int af, struct sk_buff *skb,\n \t\t\t struct ip_vs_proto_data *pd,\n \t\t\t int *verdict, struct ip_vs_conn **cpp,\n-\t\t\t struct ip_vs_iphdr *iph);\n+\t\t\t struct ip_vs_iphdr *iph,\n+\t\t\t const struct nf_hook_state *state);\n \n \tstruct ip_vs_conn *\n \t(*conn_in_get)(struct netns_ipvs *ipvs,\n@@ -872,7 +873,8 @@ struct ip_vs_conn {\n \t * NF_ACCEPT can be returned when destination is local.\n \t */\n \tint (*packet_xmit)(struct sk_buff *skb, struct ip_vs_conn *cp,\n-\t\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);\n+\t\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,\n+\t\t\t const struct nf_hook_state *state);\n \n \tstruct rcu_head\t\trcu_head;\n };\n@@ -1871,7 +1873,8 @@ ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb,\n \t struct ip_vs_proto_data *pd, int *ignored,\n \t struct ip_vs_iphdr *iph);\n int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,\n-\t\tstruct ip_vs_proto_data *pd, struct ip_vs_iphdr *iph);\n+\t\tstruct ip_vs_proto_data *pd, struct ip_vs_iphdr *iph,\n+\t\tconst struct nf_hook_state *state);\n \n void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg);\n \n@@ -1986,32 +1989,46 @@ static inline int ip_vs_est_max_threads(struct netns_ipvs *ipvs)\n \n /* Various IPVS packet transmitters (from ip_vs_xmit.c) */\n int ip_vs_null_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,\n-\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);\n+\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,\n+\t\t const struct nf_hook_state *state);\n int ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,\n-\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);\n+\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,\n+\t\t const struct nf_hook_state *state);\n int ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,\n-\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);\n+\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,\n+\t\t const struct nf_hook_state *state);\n int ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,\n-\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);\n+\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,\n+\t\t const struct nf_hook_state *state);\n int ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,\n-\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);\n+\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,\n+\t\t const struct nf_hook_state *state);\n int ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,\n \t\t struct ip_vs_protocol *pp, unsigned int toff,\n-\t\t unsigned int hooknum, struct ip_vs_iphdr *ciph);\n+\t\t const struct nf_hook_state *state,\n+\t\t struct ip_vs_iphdr *ciph);\n void ip_vs_dest_dst_rcu_free(struct rcu_head *head);\n \n #ifdef CONFIG_IP_VS_IPV6\n+int ip_vs_null_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,\n+\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,\n+\t\t const struct nf_hook_state *state);\n int ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,\n-\t\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);\n+\t\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,\n+\t\t\t const struct nf_hook_state *state);\n int ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,\n-\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);\n+\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,\n+\t\t const struct nf_hook_state *state);\n int ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,\n-\t\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);\n+\t\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,\n+\t\t\t const struct nf_hook_state *state);\n int ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,\n-\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);\n+\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,\n+\t\t const struct nf_hook_state *state);\n int ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,\n \t\t struct ip_vs_protocol *pp, unsigned int toff,\n-\t\t unsigned int hooknum, struct ip_vs_iphdr *ciph);\n+\t\t const struct nf_hook_state *state,\n+\t\t struct ip_vs_iphdr *ciph);\n #endif\n \n #ifdef CONFIG_SYSCTL\ndiff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c\nindex 94f25fb7d87e45..0c2eeb987f008f 100644\n--- a/net/netfilter/ipvs/ip_vs_conn.c\n+++ b/net/netfilter/ipvs/ip_vs_conn.c\n@@ -1070,7 +1070,7 @@ static inline void ip_vs_bind_xmit_v6(struct ip_vs_conn *cp)\n \t\tbreak;\n \n \tcase IP_VS_CONN_F_LOCALNODE:\n-\t\tcp-\u003epacket_xmit = ip_vs_null_xmit;\n+\t\tcp-\u003epacket_xmit = ip_vs_null_xmit_v6;\n \t\tbreak;\n \n \tcase IP_VS_CONN_F_BYPASS:\ndiff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c\nindex fd503f0efb5783..bb649a9f00c7c6 100644\n--- a/net/netfilter/ipvs/ip_vs_core.c\n+++ b/net/netfilter/ipvs/ip_vs_core.c\n@@ -760,7 +760,8 @@ static inline int ip_vs_addr_is_unicast(struct net *net, int af,\n * no destination is available for a new connection.\n */\n int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,\n-\t\tstruct ip_vs_proto_data *pd, struct ip_vs_iphdr *iph)\n+\t\tstruct ip_vs_proto_data *pd, struct ip_vs_iphdr *iph,\n+\t\tconst struct nf_hook_state *state)\n {\n \t__be16 _ports[2], *pptr, dport;\n \tstruct netns_ipvs *ipvs = svc-\u003eipvs;\n@@ -805,7 +806,7 @@ int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,\n \t\tip_vs_set_state(cp, IP_VS_DIR_INPUT, skb, pd, iph-\u003elen);\n \n \t\t/* transmit the first SYN packet */\n-\t\tret = cp-\u003epacket_xmit(skb, cp, pd-\u003epp, iph);\n+\t\tret = cp-\u003epacket_xmit(skb, cp, pd-\u003epp, iph, state);\n \t\t/* do not touch skb anymore */\n \n \t\tif ((cp-\u003eflags \u0026 IP_VS_CONN_F_ONE_PACKET) \u0026\u0026 cp-\u003econtrol)\n@@ -1647,7 +1648,8 @@ static unsigned int\n ip_vs_try_to_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,\n \t\t struct ip_vs_proto_data *pd,\n \t\t int *verdict, struct ip_vs_conn **cpp,\n-\t\t struct ip_vs_iphdr *iph)\n+\t\t struct ip_vs_iphdr *iph,\n+\t\t const struct nf_hook_state *state)\n {\n \tstruct ip_vs_protocol *pp = pd-\u003epp;\n \n@@ -1657,7 +1659,8 @@ ip_vs_try_to_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,\n \t\t */\n \n \t\t/* Schedule and create new connection entry into cpp */\n-\t\tif (!pp-\u003econn_schedule(ipvs, af, skb, pd, verdict, cpp, iph))\n+\t\tif (!pp-\u003econn_schedule(ipvs, af, skb, pd, verdict, cpp, iph,\n+\t\t\t\t state))\n \t\t\treturn 0;\n \t}\n \n@@ -1757,7 +1760,7 @@ static int ipvs_gre_decap(struct netns_ipvs *ipvs, struct sk_buff *skb,\n */\n static int\n ip_vs_in_icmp(struct netns_ipvs *ipvs, struct sk_buff *skb, int *related,\n-\t unsigned int hooknum, struct ip_vs_iphdr *iph)\n+\t const struct nf_hook_state *state, struct ip_vs_iphdr *iph)\n {\n \tstruct icmphdr\t_icmph, *ic;\n \tstruct iphdr\t_ciph, *cih;\t/* The ip header contained within the ICMP */\n@@ -1776,7 +1779,8 @@ ip_vs_in_icmp(struct netns_ipvs *ipvs, struct sk_buff *skb, int *related,\n \n \t/* reassemble IP fragments */\n \tif (ip_is_fragment(ip_hdr(skb))) {\n-\t\tif (ip_vs_gather_frags(ipvs, skb, ip_vs_defrag_user(hooknum)))\n+\t\tif (ip_vs_gather_frags(ipvs, skb,\n+\t\t\t\t ip_vs_defrag_user(state-\u003ehook)))\n \t\t\treturn NF_STOLEN;\n \t\tif (!ip_vs_fill_iph_skb(AF_INET, skb, false, iph))\n \t\t\treturn NF_ACCEPT;\n@@ -1893,7 +1897,8 @@ ip_vs_in_icmp(struct netns_ipvs *ipvs, struct sk_buff *skb, int *related,\n \t\tif (tunnel || !sysctl_schedule_icmp(ipvs))\n \t\t\treturn NF_ACCEPT;\n \n-\t\tif (!ip_vs_try_to_schedule(ipvs, AF_INET, skb, pd, \u0026v, \u0026cp, \u0026ciph))\n+\t\tif (!ip_vs_try_to_schedule(ipvs, AF_INET, skb, pd, \u0026v, \u0026cp,\n+\t\t\t\t\t \u0026ciph, state))\n \t\t\treturn v;\n \t\tnew_cp = true;\n \t}\n@@ -1981,7 +1986,7 @@ ip_vs_in_icmp(struct netns_ipvs *ipvs, struct sk_buff *skb, int *related,\n \n \t/* do the statistics and put it back */\n \tip_vs_in_stats(cp, skb);\n-\tverdict = ip_vs_icmp_xmit(skb, cp, pp, iph-\u003elen, hooknum, \u0026ciph);\n+\tverdict = ip_vs_icmp_xmit(skb, cp, pp, iph-\u003elen, state, \u0026ciph);\n \n out:\n \tif (likely(!new_cp))\n@@ -1994,7 +1999,7 @@ ip_vs_in_icmp(struct netns_ipvs *ipvs, struct sk_buff *skb, int *related,\n \n #ifdef CONFIG_IP_VS_IPV6\n static int ip_vs_in_icmp_v6(struct netns_ipvs *ipvs, struct sk_buff *skb,\n-\t\t\t int *related, unsigned int hooknum,\n+\t\t\t int *related, const struct nf_hook_state *state,\n \t\t\t struct ip_vs_iphdr *iph)\n {\n \tstruct icmp6hdr\t_icmph, *ic;\n@@ -2060,7 +2065,8 @@ static int ip_vs_in_icmp_v6(struct netns_ipvs *ipvs, struct sk_buff *skb,\n \t\tif (!sysctl_schedule_icmp(ipvs))\n \t\t\treturn NF_ACCEPT;\n \n-\t\tif (!ip_vs_try_to_schedule(ipvs, AF_INET6, skb, pd, \u0026v, \u0026cp, \u0026ciph))\n+\t\tif (!ip_vs_try_to_schedule(ipvs, AF_INET6, skb, pd, \u0026v, \u0026cp,\n+\t\t\t\t\t \u0026ciph, state))\n \t\t\treturn v;\n \n \t\tnew_cp = true;\n@@ -2081,7 +2087,7 @@ static int ip_vs_in_icmp_v6(struct netns_ipvs *ipvs, struct sk_buff *skb,\n \t/* do the statistics and put it back */\n \tip_vs_in_stats(cp, skb);\n \n-\tverdict = ip_vs_icmp_xmit_v6(skb, cp, pp, iph-\u003elen, hooknum, \u0026ciph);\n+\tverdict = ip_vs_icmp_xmit_v6(skb, cp, pp, iph-\u003elen, state, \u0026ciph);\n \n out:\n \tif (likely(!new_cp))\n@@ -2150,7 +2156,7 @@ ip_vs_in_hook(void *priv, struct sk_buff *skb, const struct nf_hook_state *state\n \t\tif (unlikely(iph.protocol == IPPROTO_ICMPV6)) {\n \t\t\tint related;\n \t\t\tint verdict = ip_vs_in_icmp_v6(ipvs, skb, \u0026related,\n-\t\t\t\t\t\t hooknum, \u0026iph);\n+\t\t\t\t\t\t state, \u0026iph);\n \n \t\t\tif (related)\n \t\t\t\treturn verdict;\n@@ -2160,7 +2166,7 @@ ip_vs_in_hook(void *priv, struct sk_buff *skb, const struct nf_hook_state *state\n \t\tif (unlikely(iph.protocol == IPPROTO_ICMP)) {\n \t\t\tint related;\n \t\t\tint verdict = ip_vs_in_icmp(ipvs, skb, \u0026related,\n-\t\t\t\t\t\t hooknum, \u0026iph);\n+\t\t\t\t\t\t state, \u0026iph);\n \n \t\t\tif (related)\n \t\t\t\treturn verdict;\n@@ -2248,7 +2254,8 @@ ip_vs_in_hook(void *priv, struct sk_buff *skb, const struct nf_hook_state *state\n \tif (unlikely(!cp)) {\n \t\tint v;\n \n-\t\tif (!ip_vs_try_to_schedule(ipvs, af, skb, pd, \u0026v, \u0026cp, \u0026iph))\n+\t\tif (!ip_vs_try_to_schedule(ipvs, af, skb, pd, \u0026v, \u0026cp, \u0026iph,\n+\t\t\t\t\t state))\n \t\t\treturn v;\n \t}\n \n@@ -2257,7 +2264,7 @@ ip_vs_in_hook(void *priv, struct sk_buff *skb, const struct nf_hook_state *state\n \tip_vs_in_stats(cp, skb);\n \tip_vs_set_state(cp, IP_VS_DIR_INPUT, skb, pd, iph.len);\n \tif (cp-\u003epacket_xmit)\n-\t\tret = cp-\u003epacket_xmit(skb, cp, pp, \u0026iph);\n+\t\tret = cp-\u003epacket_xmit(skb, cp, pp, \u0026iph, state);\n \t\t/* do not touch skb anymore */\n \telse {\n \t\tIP_VS_DBG_RL(\"warning: packet_xmit is null\");\n@@ -2320,11 +2327,11 @@ ip_vs_forward_icmp(void *priv, struct sk_buff *skb,\n \t\tif (iphdr.protocol != IPPROTO_ICMPV6)\n \t\t\treturn NF_ACCEPT;\n \n-\t\treturn ip_vs_in_icmp_v6(ipvs, skb, \u0026r, state-\u003ehook, \u0026iphdr);\n+\t\treturn ip_vs_in_icmp_v6(ipvs, skb, \u0026r, state, \u0026iphdr);\n #endif\n \t}\n \n-\treturn ip_vs_in_icmp(ipvs, skb, \u0026r, state-\u003ehook, \u0026iphdr);\n+\treturn ip_vs_in_icmp(ipvs, skb, \u0026r, state, \u0026iphdr);\n }\n \n static const struct nf_hook_ops ip_vs_ops4[] = {\ndiff --git a/net/netfilter/ipvs/ip_vs_proto_ah_esp.c b/net/netfilter/ipvs/ip_vs_proto_ah_esp.c\nindex 44e14acc187ee3..c7f90b29be51b3 100644\n--- a/net/netfilter/ipvs/ip_vs_proto_ah_esp.c\n+++ b/net/netfilter/ipvs/ip_vs_proto_ah_esp.c\n@@ -102,7 +102,7 @@ static int\n ah_esp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,\n \t\t struct ip_vs_proto_data *pd,\n \t\t int *verdict, struct ip_vs_conn **cpp,\n-\t\t struct ip_vs_iphdr *iph)\n+\t\t struct ip_vs_iphdr *iph, const struct nf_hook_state *state)\n {\n \t/*\n \t * AH/ESP is only related traffic. Pass the packet to IP stack.\ndiff --git a/net/netfilter/ipvs/ip_vs_proto_sctp.c b/net/netfilter/ipvs/ip_vs_proto_sctp.c\nindex fb8af6b15a3999..c5810f86846efe 100644\n--- a/net/netfilter/ipvs/ip_vs_proto_sctp.c\n+++ b/net/netfilter/ipvs/ip_vs_proto_sctp.c\n@@ -17,7 +17,7 @@ static int\n sctp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,\n \t\t struct ip_vs_proto_data *pd,\n \t\t int *verdict, struct ip_vs_conn **cpp,\n-\t\t struct ip_vs_iphdr *iph)\n+\t\t struct ip_vs_iphdr *iph, const struct nf_hook_state *state)\n {\n \tstruct ip_vs_service *svc;\n \tstruct sctp_chunkhdr _schunkh, *sch;\n@@ -71,7 +71,8 @@ sctp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,\n \t\t*cpp = ip_vs_schedule(svc, skb, pd, \u0026ignored, iph);\n \t\tif (!*cpp \u0026\u0026 ignored \u003c= 0) {\n \t\t\tif (!ignored)\n-\t\t\t\t*verdict = ip_vs_leave(svc, skb, pd, iph);\n+\t\t\t\t*verdict = ip_vs_leave(svc, skb, pd, iph,\n+\t\t\t\t\t\t state);\n \t\t\telse\n \t\t\t\t*verdict = NF_DROP;\n \t\t\treturn 0;\ndiff --git a/net/netfilter/ipvs/ip_vs_proto_tcp.c b/net/netfilter/ipvs/ip_vs_proto_tcp.c\nindex fec0e8b47b7165..66ae924b04f3ab 100644\n--- a/net/netfilter/ipvs/ip_vs_proto_tcp.c\n+++ b/net/netfilter/ipvs/ip_vs_proto_tcp.c\n@@ -35,7 +35,7 @@ static int\n tcp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,\n \t\t struct ip_vs_proto_data *pd,\n \t\t int *verdict, struct ip_vs_conn **cpp,\n-\t\t struct ip_vs_iphdr *iph)\n+\t\t struct ip_vs_iphdr *iph, const struct nf_hook_state *state)\n {\n \tstruct ip_vs_service *svc;\n \tstruct tcphdr _tcph, *th;\n@@ -90,7 +90,8 @@ tcp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,\n \t\t*cpp = ip_vs_schedule(svc, skb, pd, \u0026ignored, iph);\n \t\tif (!*cpp \u0026\u0026 ignored \u003c= 0) {\n \t\t\tif (!ignored)\n-\t\t\t\t*verdict = ip_vs_leave(svc, skb, pd, iph);\n+\t\t\t\t*verdict = ip_vs_leave(svc, skb, pd, iph,\n+\t\t\t\t\t\t state);\n \t\t\telse\n \t\t\t\t*verdict = NF_DROP;\n \t\t\treturn 0;\ndiff --git a/net/netfilter/ipvs/ip_vs_proto_udp.c b/net/netfilter/ipvs/ip_vs_proto_udp.c\nindex f32785682402dd..58b880c8421680 100644\n--- a/net/netfilter/ipvs/ip_vs_proto_udp.c\n+++ b/net/netfilter/ipvs/ip_vs_proto_udp.c\n@@ -31,7 +31,7 @@ static int\n udp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,\n \t\t struct ip_vs_proto_data *pd,\n \t\t int *verdict, struct ip_vs_conn **cpp,\n-\t\t struct ip_vs_iphdr *iph)\n+\t\t struct ip_vs_iphdr *iph, const struct nf_hook_state *state)\n {\n \tstruct ip_vs_service *svc;\n \tstruct udphdr _udph, *uh;\n@@ -78,7 +78,8 @@ udp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,\n \t\t*cpp = ip_vs_schedule(svc, skb, pd, \u0026ignored, iph);\n \t\tif (!*cpp \u0026\u0026 ignored \u003c= 0) {\n \t\t\tif (!ignored)\n-\t\t\t\t*verdict = ip_vs_leave(svc, skb, pd, iph);\n+\t\t\t\t*verdict = ip_vs_leave(svc, skb, pd, iph,\n+\t\t\t\t\t\t state);\n \t\t\telse\n \t\t\t\t*verdict = NF_DROP;\n \t\t\treturn 0;\ndiff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c\nindex ebc6b697ae5160..c777493eee7493 100644\n--- a/net/netfilter/ipvs/ip_vs_xmit.c\n+++ b/net/netfilter/ipvs/ip_vs_xmit.c\n@@ -205,13 +205,24 @@ static inline bool crosses_local_route_boundary(int skb_af, struct sk_buff *skb,\n \treturn false;\n }\n \n-static inline void maybe_update_pmtu(int skb_af, struct sk_buff *skb, int mtu)\n+static inline void maybe_update_pmtu(int skb_af, struct sk_buff *skb, int mtu,\n+\t\t\t\t const struct nf_hook_state *state)\n {\n-\tstruct sock *sk = skb-\u003esk;\n-\tstruct rtable *ort = skb_rtable(skb);\n-\n-\tif (!skb-\u003edev \u0026\u0026 sk \u0026\u0026 sk_fullsock(sk))\n-\t\tort-\u003edst.ops-\u003eupdate_pmtu(\u0026ort-\u003edst, sk, NULL, mtu, true);\n+\tstruct dst_entry *dst = skb_dst(skb);\n+\tstruct sock *sk = state-\u003esk;\n+\n+\t/* The update_pmtu handlers are missing some checks for:\n+\t * - skb-\u003edev: present for tunnels, not for IPVS, so we do not\n+\t * provide skb, only sk\n+\t * - present daddr: so, we require TCP_ESTABLISHED (connected socket)\n+\t *\n+\t * In some states the senders ignore the PMTU events:\n+\t * - sk_fullsock(): so use the TCP_ESTABLISHED check\n+\t */\n+\tif (sk \u0026\u0026 sk-\u003esk_state == TCP_ESTABLISHED \u0026\u0026\n+\t state-\u003ehook == NF_INET_LOCAL_OUT \u0026\u0026\n+\t sk-\u003esk_family == dst-\u003eops-\u003efamily)\n+\t\tdst-\u003eops-\u003eupdate_pmtu(dst, sk, NULL, mtu, false);\n }\n \n static inline bool ensure_mtu_is_adequate(struct netns_ipvs *ipvs, int skb_af,\n@@ -316,7 +327,7 @@ static int\n __ip_vs_get_out_rt(struct netns_ipvs *ipvs, int skb_af, struct sk_buff *skb,\n \t\t struct ip_vs_dest *dest,\n \t\t __be32 daddr, int rt_mode, __be32 *ret_saddr,\n-\t\t struct ip_vs_iphdr *ipvsh)\n+\t\t struct ip_vs_iphdr *ipvsh, const struct nf_hook_state *state)\n {\n \tstruct net *net = ipvs-\u003enet;\n \tstruct ip_vs_dest_dst *dest_dst;\n@@ -417,7 +428,7 @@ __ip_vs_get_out_rt(struct netns_ipvs *ipvs, int skb_af, struct sk_buff *skb,\n \t\t\tIP_VS_DBG_RL(\"%s(): mtu less than 68\\n\", __func__);\n \t\t\tgoto err_put;\n \t\t}\n-\t\tmaybe_update_pmtu(skb_af, skb, mtu);\n+\t\tmaybe_update_pmtu(skb_af, skb, mtu, state);\n \t}\n \n \tif (!ensure_mtu_is_adequate(ipvs, skb_af, rt_mode, ipvsh, skb, mtu))\n@@ -489,7 +500,8 @@ static int\n __ip_vs_get_out_rt_v6(struct netns_ipvs *ipvs, int skb_af, struct sk_buff *skb,\n \t\t struct ip_vs_dest *dest,\n \t\t struct in6_addr *daddr, struct in6_addr *ret_saddr,\n-\t\t struct ip_vs_iphdr *ipvsh, int do_xfrm, int rt_mode)\n+\t\t struct ip_vs_iphdr *ipvsh, int do_xfrm, int rt_mode,\n+\t\t const struct nf_hook_state *state)\n {\n \tstruct net *net = ipvs-\u003enet;\n \tstruct ip_vs_dest_dst *dest_dst;\n@@ -596,7 +608,7 @@ __ip_vs_get_out_rt_v6(struct netns_ipvs *ipvs, int skb_af, struct sk_buff *skb,\n \t\t\t\t IPV6_MIN_MTU);\n \t\t\tgoto err_put;\n \t\t}\n-\t\tmaybe_update_pmtu(skb_af, skb, mtu);\n+\t\tmaybe_update_pmtu(skb_af, skb, mtu, state);\n \t}\n \n \tif (!ensure_mtu_is_adequate(ipvs, skb_af, rt_mode, ipvsh, skb, mtu))\n@@ -720,12 +732,26 @@ static inline int ip_vs_send_or_cont(int pf, struct sk_buff *skb,\n */\n int\n ip_vs_null_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,\n-\t\tstruct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)\n+\t\tstruct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,\n+\t\tconst struct nf_hook_state *state)\n {\n \t/* we do not touch skb and do not need pskb ptr */\n \treturn ip_vs_send_or_cont(NFPROTO_IPV4, skb, cp, 1);\n }\n \n+#ifdef CONFIG_IP_VS_IPV6\n+/*\n+ * NULL transmitter (do nothing except return NF_ACCEPT)\n+ */\n+int\n+ip_vs_null_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,\n+\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,\n+\t\t const struct nf_hook_state *state)\n+{\n+\t/* we do not touch skb and do not need pskb ptr */\n+\treturn ip_vs_send_or_cont(NFPROTO_IPV6, skb, cp, 1);\n+}\n+#endif\n \n /*\n * Bypass transmitter\n@@ -734,10 +760,11 @@ ip_vs_null_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,\n */\n int\n ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,\n-\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)\n+\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,\n+\t\t const struct nf_hook_state *state)\n {\n \tif (__ip_vs_get_out_rt(cp-\u003eipvs, cp-\u003eaf, skb, NULL, ip_hdr(skb)-\u003edaddr,\n-\t\t\t IP_VS_RT_MODE_NON_LOCAL, NULL, ipvsh) \u003c 0)\n+\t\t\t IP_VS_RT_MODE_NON_LOCAL, NULL, ipvsh, state) \u003c 0)\n \t\tgoto tx_error;\n \n \tip_send_check(ip_hdr(skb));\n@@ -757,13 +784,15 @@ ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,\n #ifdef CONFIG_IP_VS_IPV6\n int\n ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,\n-\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)\n+\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,\n+\t\t const struct nf_hook_state *state)\n {\n \tstruct ipv6hdr *iph = ipv6_hdr(skb);\n \n \tif (__ip_vs_get_out_rt_v6(cp-\u003eipvs, cp-\u003eaf, skb, NULL,\n \t\t\t\t \u0026iph-\u003edaddr, NULL,\n-\t\t\t\t ipvsh, 0, IP_VS_RT_MODE_NON_LOCAL) \u003c 0)\n+\t\t\t\t ipvsh, 0, IP_VS_RT_MODE_NON_LOCAL,\n+\t\t\t\t state) \u003c 0)\n \t\tgoto tx_error;\n \n \t/* Another hack: avoid icmp_send in ip_fragment */\n@@ -785,7 +814,8 @@ ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,\n */\n int\n ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,\n-\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)\n+\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,\n+\t const struct nf_hook_state *state)\n {\n \tstruct rtable *rt;\t\t/* Route to the other host */\n \tint local, rc, was_input;\n@@ -805,7 +835,7 @@ ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,\n \tlocal = __ip_vs_get_out_rt(cp-\u003eipvs, cp-\u003eaf, skb, cp-\u003edest, cp-\u003edaddr.ip,\n \t\t\t\t IP_VS_RT_MODE_LOCAL |\n \t\t\t\t IP_VS_RT_MODE_NON_LOCAL |\n-\t\t\t\t IP_VS_RT_MODE_RDR, NULL, ipvsh);\n+\t\t\t\t IP_VS_RT_MODE_RDR, NULL, ipvsh, state);\n \tif (local \u003c 0)\n \t\tgoto tx_error;\n \trt = skb_rtable(skb);\n@@ -869,7 +899,8 @@ ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,\n #ifdef CONFIG_IP_VS_IPV6\n int\n ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,\n-\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)\n+\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,\n+\t\t const struct nf_hook_state *state)\n {\n \tstruct rt6_info *rt;\t\t/* Route to the other host */\n \tint local, rc;\n@@ -889,7 +920,7 @@ ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,\n \t\t\t\t NULL, ipvsh, 0,\n \t\t\t\t IP_VS_RT_MODE_LOCAL |\n \t\t\t\t IP_VS_RT_MODE_NON_LOCAL |\n-\t\t\t\t IP_VS_RT_MODE_RDR);\n+\t\t\t\t IP_VS_RT_MODE_RDR, state);\n \tif (local \u003c 0)\n \t\tgoto tx_error;\n \trt = dst_rt6_info(skb_dst(skb));\n@@ -1145,7 +1176,8 @@ ipvs_gre_encap(struct net *net, struct sk_buff *skb,\n */\n int\n ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,\n-\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)\n+\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,\n+\t\t const struct nf_hook_state *state)\n {\n \tstruct netns_ipvs *ipvs = cp-\u003eipvs;\n \tstruct net *net = ipvs-\u003enet;\n@@ -1167,7 +1199,7 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,\n \t\t\t\t IP_VS_RT_MODE_LOCAL |\n \t\t\t\t IP_VS_RT_MODE_NON_LOCAL |\n \t\t\t\t IP_VS_RT_MODE_CONNECT |\n-\t\t\t\t IP_VS_RT_MODE_TUNNEL, \u0026saddr, ipvsh);\n+\t\t\t\t IP_VS_RT_MODE_TUNNEL, \u0026saddr, ipvsh, state);\n \tif (local \u003c 0)\n \t\tgoto tx_error;\n \tif (local)\n@@ -1276,7 +1308,7 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,\n \n \tret = ip_vs_tunnel_xmit_prepare(skb, cp);\n \tif (ret == NF_ACCEPT)\n-\t\tip_local_out(net, skb-\u003esk, skb);\n+\t\tip_local_out(net, NULL, skb);\n \telse if (ret == NF_DROP)\n \t\tkfree_skb(skb);\n \n@@ -1290,7 +1322,8 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,\n #ifdef CONFIG_IP_VS_IPV6\n int\n ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,\n-\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)\n+\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,\n+\t\t const struct nf_hook_state *state)\n {\n \tstruct netns_ipvs *ipvs = cp-\u003eipvs;\n \tstruct net *net = ipvs-\u003enet;\n@@ -1312,7 +1345,7 @@ ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,\n \t\t\t\t \u0026saddr, ipvsh, 1,\n \t\t\t\t IP_VS_RT_MODE_LOCAL |\n \t\t\t\t IP_VS_RT_MODE_NON_LOCAL |\n-\t\t\t\t IP_VS_RT_MODE_TUNNEL);\n+\t\t\t\t IP_VS_RT_MODE_TUNNEL, state);\n \tif (local \u003c 0)\n \t\tgoto tx_error;\n \tif (local)\n@@ -1418,7 +1451,7 @@ ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,\n \n \tret = ip_vs_tunnel_xmit_prepare(skb, cp);\n \tif (ret == NF_ACCEPT)\n-\t\tip6_local_out(net, skb-\u003esk, skb);\n+\t\tip6_local_out(net, NULL, skb);\n \telse if (ret == NF_DROP)\n \t\tkfree_skb(skb);\n \n@@ -1437,14 +1470,15 @@ ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,\n */\n int\n ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,\n-\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)\n+\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,\n+\t const struct nf_hook_state *state)\n {\n \tint local;\n \n \tlocal = __ip_vs_get_out_rt(cp-\u003eipvs, cp-\u003eaf, skb, cp-\u003edest, cp-\u003edaddr.ip,\n \t\t\t\t IP_VS_RT_MODE_LOCAL |\n \t\t\t\t IP_VS_RT_MODE_NON_LOCAL |\n-\t\t\t\t IP_VS_RT_MODE_KNOWN_NH, NULL, ipvsh);\n+\t\t\t\t IP_VS_RT_MODE_KNOWN_NH, NULL, ipvsh, state);\n \tif (local \u003c 0)\n \t\tgoto tx_error;\n \tif (local)\n@@ -1467,7 +1501,8 @@ ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,\n #ifdef CONFIG_IP_VS_IPV6\n int\n ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,\n-\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)\n+\t\t struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,\n+\t\t const struct nf_hook_state *state)\n {\n \tint local;\n \n@@ -1476,7 +1511,7 @@ ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,\n \t\t\t\t NULL, ipvsh, 0,\n \t\t\t\t IP_VS_RT_MODE_LOCAL |\n \t\t\t\t IP_VS_RT_MODE_NON_LOCAL |\n-\t\t\t\t IP_VS_RT_MODE_KNOWN_NH);\n+\t\t\t\t IP_VS_RT_MODE_KNOWN_NH, state);\n \tif (local \u003c 0)\n \t\tgoto tx_error;\n \tif (local)\n@@ -1503,7 +1538,7 @@ ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,\n int\n ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,\n \t\tstruct ip_vs_protocol *pp, unsigned int toff,\n-\t\tunsigned int hooknum, struct ip_vs_iphdr *ciph)\n+\t\tconst struct nf_hook_state *state, struct ip_vs_iphdr *ciph)\n {\n \tstruct rtable\t*rt;\t/* Route to the other host */\n \tint rc;\n@@ -1517,7 +1552,7 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,\n \t translate address/port back */\n \tif (IP_VS_FWD_METHOD(cp) != IP_VS_CONN_F_MASQ) {\n \t\tif (cp-\u003epacket_xmit)\n-\t\t\trc = cp-\u003epacket_xmit(skb, cp, pp, ciph);\n+\t\t\trc = cp-\u003epacket_xmit(skb, cp, pp, ciph, state);\n \t\telse\n \t\t\trc = NF_ACCEPT;\n \t\t/* do not touch skb anymore */\n@@ -1531,11 +1566,11 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,\n \twas_input = rt_is_input_route(skb_rtable(skb));\n \n \t/* LOCALNODE from FORWARD hook is not supported */\n-\trt_mode = (hooknum != NF_INET_FORWARD) ?\n+\trt_mode = (state-\u003ehook != NF_INET_FORWARD) ?\n \t\t IP_VS_RT_MODE_LOCAL | IP_VS_RT_MODE_NON_LOCAL |\n \t\t IP_VS_RT_MODE_RDR : IP_VS_RT_MODE_NON_LOCAL;\n-\tlocal = __ip_vs_get_out_rt(cp-\u003eipvs, cp-\u003eaf, skb, cp-\u003edest, cp-\u003edaddr.ip, rt_mode,\n-\t\t\t\t NULL, ciph);\n+\tlocal = __ip_vs_get_out_rt(cp-\u003eipvs, cp-\u003eaf, skb, cp-\u003edest,\n+\t\t\t\t cp-\u003edaddr.ip, rt_mode, NULL, ciph, state);\n \tif (local \u003c 0)\n \t\tgoto tx_error;\n \trt = skb_rtable(skb);\n@@ -1597,8 +1632,8 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,\n #ifdef CONFIG_IP_VS_IPV6\n int\n ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,\n-\t\tstruct ip_vs_protocol *pp, unsigned int toff,\n-\t\tunsigned int hooknum, struct ip_vs_iphdr *ciph)\n+\t\t struct ip_vs_protocol *pp, unsigned int toff,\n+\t\t const struct nf_hook_state *state, struct ip_vs_iphdr *ciph)\n {\n \tbool has_ports = false;\n \tstruct rt6_info\t*rt;\t/* Route to the other host */\n@@ -1612,7 +1647,7 @@ ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,\n \t translate address/port back */\n \tif (IP_VS_FWD_METHOD(cp) != IP_VS_CONN_F_MASQ) {\n \t\tif (cp-\u003epacket_xmit)\n-\t\t\trc = cp-\u003epacket_xmit(skb, cp, pp, ciph);\n+\t\t\trc = cp-\u003epacket_xmit(skb, cp, pp, ciph, state);\n \t\telse\n \t\t\trc = NF_ACCEPT;\n \t\t/* do not touch skb anymore */\n@@ -1625,11 +1660,12 @@ ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,\n \t */\n \n \t/* LOCALNODE from FORWARD hook is not supported */\n-\trt_mode = (hooknum != NF_INET_FORWARD) ?\n+\trt_mode = (state-\u003ehook != NF_INET_FORWARD) ?\n \t\t IP_VS_RT_MODE_LOCAL | IP_VS_RT_MODE_NON_LOCAL |\n \t\t IP_VS_RT_MODE_RDR : IP_VS_RT_MODE_NON_LOCAL;\n \tlocal = __ip_vs_get_out_rt_v6(cp-\u003eipvs, cp-\u003eaf, skb, cp-\u003edest,\n-\t\t\t\t \u0026cp-\u003edaddr.in6, NULL, ciph, 0, rt_mode);\n+\t\t\t\t \u0026cp-\u003edaddr.in6, NULL, ciph, 0, rt_mode,\n+\t\t\t\t state);\n \tif (local \u003c 0)\n \t\tgoto tx_error;\n \trt = dst_rt6_info(skb_dst(skb));\n"
} |
| 2/1 | 2026/11/15 14:37 | agent | patch-evaluator |
1mModel:core Args: null Results: {
"EnableConfigs": [
"IP_VS",
"IP_VS_IPV6",
"IP_VS_PROTO_TCP",
"IP_VS_PROTO_UDP",
"IP_VS_PROTO_SCTP",
"IP_VS_PROTO_AH",
"IP_VS_PROTO_ESP",
"NETFILTER"
],
"FocusSymbols": [
"ip_vs_null_xmit_v6",
"ip_vs_null_xmit",
"ip_vs_nat_xmit",
"ip_vs_nat_xmit_v6",
"ip_vs_tunnel_xmit",
"ip_vs_tunnel_xmit_v6",
"ip_vs_dr_xmit",
"ip_vs_dr_xmit_v6",
"ip_vs_icmp_xmit",
"ip_vs_icmp_xmit_v6",
"ip_vs_in_hook",
"ip_vs_leave",
"tcp_conn_schedule",
"udp_conn_schedule",
"sctp_conn_schedule"
],
"Reasoning": "The patch modifies core IPVS (IP Virtual Server) network stack code. It threads `struct nf_hook_state` through protocol connection scheduling, ICMP handling, and packet transmitters. It also modifies PMTU updates in `maybe_update_pmtu`, fixes IPv6 LOCALNODE packet transmission binding by adding and using `ip_vs_null_xmit_v6`, and alters socket parameter passing in `ip_vs_tunnel_xmit` and `ip_vs_tunnel_xmit_v6`. This code is fully reachable in standard QEMU environments via network sockets, netlink, and netfilter hooks.",
"WorthFuzzing": true
}Instruction: You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.
IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.
================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.
- REACHABILITY IS THE PRIMARY GATE:
Fuzzing can only discover bugs in code that can actually execute in standard virtualized
environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
regardless of whether it adds assertions or complex logic.
- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
Patch authors routinely label changes as "cleanups", "refactorings", or state
"No functional change intended". Do NOT take these claims at face value.
Code refactorings that rearrange logic, introduce helper functions, or alter state management
in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
If reachable executable code is modified or refactored, it MUST be fuzzed.
- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
Even if the author believes the invariant always holds, fuzzing is essential to verify whether
an unusual sequence of operations can violate it.
================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:
- Non-kernel and non-executable changes:
* Modifications to Documentation/, comments, or spelling fixes.
* User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
that do not affect the compiled kernel image (vmlinux) or kernel modules.
* Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
that do not alter control flow or data structures.
* Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
* Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
* Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
physical PCI hot-unplug or manual sysfs driver unbinding.
* Code paths exclusive to architectures other than the target architecture.
================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
* Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
* Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
* Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
* Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).
================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:
- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
Do NOT list generic, ubiquitous functions called by almost every program in the corpus
(including, but not limited to: general memory allocators and deallocators, page fault
and trap handlers, or core synchronization primitives; this is not an exhaustive list).
Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
which severely dilutes fuzzing effort away from the actual changes.
- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
List functions that specifically implement the logic being added or altered, or direct API entrypoints
for the subsystem feature under review.
- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).
================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any '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: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit 4820c4a56fc31dc751a6f8cd1791bfc538820726
Author: syz-cluster <triage@syzkaller.com>
Date: Sun Nov 15 14:37:32 2026 +0000
syz-cluster: applied patch under review
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 9a83bff32569da..398d748f01ec88 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -731,7 +731,8 @@ struct ip_vs_protocol {
int af, struct sk_buff *skb,
struct ip_vs_proto_data *pd,
int *verdict, struct ip_vs_conn **cpp,
- struct ip_vs_iphdr *iph);
+ struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
struct ip_vs_conn *
(*conn_in_get)(struct netns_ipvs *ipvs,
@@ -872,7 +873,8 @@ struct ip_vs_conn {
* NF_ACCEPT can be returned when destination is local.
*/
int (*packet_xmit)(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
struct rcu_head rcu_head;
};
@@ -1871,7 +1873,8 @@ ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb,
struct ip_vs_proto_data *pd, int *ignored,
struct ip_vs_iphdr *iph);
int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
- struct ip_vs_proto_data *pd, struct ip_vs_iphdr *iph);
+ struct ip_vs_proto_data *pd, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg);
@@ -1986,32 +1989,46 @@ static inline int ip_vs_est_max_threads(struct netns_ipvs *ipvs)
/* Various IPVS packet transmitters (from ip_vs_xmit.c) */
int ip_vs_null_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
int ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
int ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
int ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
int ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
int ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
struct ip_vs_protocol *pp, unsigned int toff,
- unsigned int hooknum, struct ip_vs_iphdr *ciph);
+ const struct nf_hook_state *state,
+ struct ip_vs_iphdr *ciph);
void ip_vs_dest_dst_rcu_free(struct rcu_head *head);
#ifdef CONFIG_IP_VS_IPV6
+int ip_vs_null_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
int ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
int ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
int ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
int ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
int ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
struct ip_vs_protocol *pp, unsigned int toff,
- unsigned int hooknum, struct ip_vs_iphdr *ciph);
+ const struct nf_hook_state *state,
+ struct ip_vs_iphdr *ciph);
#endif
#ifdef CONFIG_SYSCTL
diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index 94f25fb7d87e45..0c2eeb987f008f 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -1070,7 +1070,7 @@ static inline void ip_vs_bind_xmit_v6(struct ip_vs_conn *cp)
break;
case IP_VS_CONN_F_LOCALNODE:
- cp->packet_xmit = ip_vs_null_xmit;
+ cp->packet_xmit = ip_vs_null_xmit_v6;
break;
case IP_VS_CONN_F_BYPASS:
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index fd503f0efb5783..bb649a9f00c7c6 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -760,7 +760,8 @@ static inline int ip_vs_addr_is_unicast(struct net *net, int af,
* no destination is available for a new connection.
*/
int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
- struct ip_vs_proto_data *pd, struct ip_vs_iphdr *iph)
+ struct ip_vs_proto_data *pd, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state)
{
__be16 _ports[2], *pptr, dport;
struct netns_ipvs *ipvs = svc->ipvs;
@@ -805,7 +806,7 @@ int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
ip_vs_set_state(cp, IP_VS_DIR_INPUT, skb, pd, iph->len);
/* transmit the first SYN packet */
- ret = cp->packet_xmit(skb, cp, pd->pp, iph);
+ ret = cp->packet_xmit(skb, cp, pd->pp, iph, state);
/* do not touch skb anymore */
if ((cp->flags & IP_VS_CONN_F_ONE_PACKET) && cp->control)
@@ -1647,7 +1648,8 @@ static unsigned int
ip_vs_try_to_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,
struct ip_vs_proto_data *pd,
int *verdict, struct ip_vs_conn **cpp,
- struct ip_vs_iphdr *iph)
+ struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state)
{
struct ip_vs_protocol *pp = pd->pp;
@@ -1657,7 +1659,8 @@ ip_vs_try_to_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,
*/
/* Schedule and create new connection entry into cpp */
- if (!pp->conn_schedule(ipvs, af, skb, pd, verdict, cpp, iph))
+ if (!pp->conn_schedule(ipvs, af, skb, pd, verdict, cpp, iph,
+ state))
return 0;
}
@@ -1757,7 +1760,7 @@ static int ipvs_gre_decap(struct netns_ipvs *ipvs, struct sk_buff *skb,
*/
static int
ip_vs_in_icmp(struct netns_ipvs *ipvs, struct sk_buff *skb, int *related,
- unsigned int hooknum, struct ip_vs_iphdr *iph)
+ const struct nf_hook_state *state, struct ip_vs_iphdr *iph)
{
struct icmphdr _icmph, *ic;
struct iphdr _ciph, *cih; /* The ip header contained within the ICMP */
@@ -1776,7 +1779,8 @@ ip_vs_in_icmp(struct netns_ipvs *ipvs, struct sk_buff *skb, int *related,
/* reassemble IP fragments */
if (ip_is_fragment(ip_hdr(skb))) {
- if (ip_vs_gather_frags(ipvs, skb, ip_vs_defrag_user(hooknum)))
+ if (ip_vs_gather_frags(ipvs, skb,
+ ip_vs_defrag_user(state->hook)))
return NF_STOLEN;
if (!ip_vs_fill_iph_skb(AF_INET, skb, false, iph))
return NF_ACCEPT;
@@ -1893,7 +1897,8 @@ ip_vs_in_icmp(struct netns_ipvs *ipvs, struct sk_buff *skb, int *related,
if (tunnel || !sysctl_schedule_icmp(ipvs))
return NF_ACCEPT;
- if (!ip_vs_try_to_schedule(ipvs, AF_INET, skb, pd, &v, &cp, &ciph))
+ if (!ip_vs_try_to_schedule(ipvs, AF_INET, skb, pd, &v, &cp,
+ &ciph, state))
return v;
new_cp = true;
}
@@ -1981,7 +1986,7 @@ ip_vs_in_icmp(struct netns_ipvs *ipvs, struct sk_buff *skb, int *related,
/* do the statistics and put it back */
ip_vs_in_stats(cp, skb);
- verdict = ip_vs_icmp_xmit(skb, cp, pp, iph->len, hooknum, &ciph);
+ verdict = ip_vs_icmp_xmit(skb, cp, pp, iph->len, state, &ciph);
out:
if (likely(!new_cp))
@@ -1994,7 +1999,7 @@ ip_vs_in_icmp(struct netns_ipvs *ipvs, struct sk_buff *skb, int *related,
#ifdef CONFIG_IP_VS_IPV6
static int ip_vs_in_icmp_v6(struct netns_ipvs *ipvs, struct sk_buff *skb,
- int *related, unsigned int hooknum,
+ int *related, const struct nf_hook_state *state,
struct ip_vs_iphdr *iph)
{
struct icmp6hdr _icmph, *ic;
@@ -2060,7 +2065,8 @@ static int ip_vs_in_icmp_v6(struct netns_ipvs *ipvs, struct sk_buff *skb,
if (!sysctl_schedule_icmp(ipvs))
return NF_ACCEPT;
- if (!ip_vs_try_to_schedule(ipvs, AF_INET6, skb, pd, &v, &cp, &ciph))
+ if (!ip_vs_try_to_schedule(ipvs, AF_INET6, skb, pd, &v, &cp,
+ &ciph, state))
return v;
new_cp = true;
@@ -2081,7 +2087,7 @@ static int ip_vs_in_icmp_v6(struct netns_ipvs *ipvs, struct sk_buff *skb,
/* do the statistics and put it back */
ip_vs_in_stats(cp, skb);
- verdict = ip_vs_icmp_xmit_v6(skb, cp, pp, iph->len, hooknum, &ciph);
+ verdict = ip_vs_icmp_xmit_v6(skb, cp, pp, iph->len, state, &ciph);
out:
if (likely(!new_cp))
@@ -2150,7 +2156,7 @@ ip_vs_in_hook(void *priv, struct sk_buff *skb, const struct nf_hook_state *state
if (unlikely(iph.protocol == IPPROTO_ICMPV6)) {
int related;
int verdict = ip_vs_in_icmp_v6(ipvs, skb, &related,
- hooknum, &iph);
+ state, &iph);
if (related)
return verdict;
@@ -2160,7 +2166,7 @@ ip_vs_in_hook(void *priv, struct sk_buff *skb, const struct nf_hook_state *state
if (unlikely(iph.protocol == IPPROTO_ICMP)) {
int related;
int verdict = ip_vs_in_icmp(ipvs, skb, &related,
- hooknum, &iph);
+ state, &iph);
if (related)
return verdict;
@@ -2248,7 +2254,8 @@ ip_vs_in_hook(void *priv, struct sk_buff *skb, const struct nf_hook_state *state
if (unlikely(!cp)) {
int v;
- if (!ip_vs_try_to_schedule(ipvs, af, skb, pd, &v, &cp, &iph))
+ if (!ip_vs_try_to_schedule(ipvs, af, skb, pd, &v, &cp, &iph,
+ state))
return v;
}
@@ -2257,7 +2264,7 @@ ip_vs_in_hook(void *priv, struct sk_buff *skb, const struct nf_hook_state *state
ip_vs_in_stats(cp, skb);
ip_vs_set_state(cp, IP_VS_DIR_INPUT, skb, pd, iph.len);
if (cp->packet_xmit)
- ret = cp->packet_xmit(skb, cp, pp, &iph);
+ ret = cp->packet_xmit(skb, cp, pp, &iph, state);
/* do not touch skb anymore */
else {
IP_VS_DBG_RL("warning: packet_xmit is null");
@@ -2320,11 +2327,11 @@ ip_vs_forward_icmp(void *priv, struct sk_buff *skb,
if (iphdr.protocol != IPPROTO_ICMPV6)
return NF_ACCEPT;
- return ip_vs_in_icmp_v6(ipvs, skb, &r, state->hook, &iphdr);
+ return ip_vs_in_icmp_v6(ipvs, skb, &r, state, &iphdr);
#endif
}
- return ip_vs_in_icmp(ipvs, skb, &r, state->hook, &iphdr);
+ return ip_vs_in_icmp(ipvs, skb, &r, state, &iphdr);
}
static const struct nf_hook_ops ip_vs_ops4[] = {
diff --git a/net/netfilter/ipvs/ip_vs_proto_ah_esp.c b/net/netfilter/ipvs/ip_vs_proto_ah_esp.c
index 44e14acc187ee3..c7f90b29be51b3 100644
--- a/net/netfilter/ipvs/ip_vs_proto_ah_esp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_ah_esp.c
@@ -102,7 +102,7 @@ static int
ah_esp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,
struct ip_vs_proto_data *pd,
int *verdict, struct ip_vs_conn **cpp,
- struct ip_vs_iphdr *iph)
+ struct ip_vs_iphdr *iph, const struct nf_hook_state *state)
{
/*
* AH/ESP is only related traffic. Pass the packet to IP stack.
diff --git a/net/netfilter/ipvs/ip_vs_proto_sctp.c b/net/netfilter/ipvs/ip_vs_proto_sctp.c
index fb8af6b15a3999..c5810f86846efe 100644
--- a/net/netfilter/ipvs/ip_vs_proto_sctp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_sctp.c
@@ -17,7 +17,7 @@ static int
sctp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,
struct ip_vs_proto_data *pd,
int *verdict, struct ip_vs_conn **cpp,
- struct ip_vs_iphdr *iph)
+ struct ip_vs_iphdr *iph, const struct nf_hook_state *state)
{
struct ip_vs_service *svc;
struct sctp_chunkhdr _schunkh, *sch;
@@ -71,7 +71,8 @@ sctp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,
*cpp = ip_vs_schedule(svc, skb, pd, &ignored, iph);
if (!*cpp && ignored <= 0) {
if (!ignored)
- *verdict = ip_vs_leave(svc, skb, pd, iph);
+ *verdict = ip_vs_leave(svc, skb, pd, iph,
+ state);
else
*verdict = NF_DROP;
return 0;
diff --git a/net/netfilter/ipvs/ip_vs_proto_tcp.c b/net/netfilter/ipvs/ip_vs_proto_tcp.c
index fec0e8b47b7165..66ae924b04f3ab 100644
--- a/net/netfilter/ipvs/ip_vs_proto_tcp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_tcp.c
@@ -35,7 +35,7 @@ static int
tcp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,
struct ip_vs_proto_data *pd,
int *verdict, struct ip_vs_conn **cpp,
- struct ip_vs_iphdr *iph)
+ struct ip_vs_iphdr *iph, const struct nf_hook_state *state)
{
struct ip_vs_service *svc;
struct tcphdr _tcph, *th;
@@ -90,7 +90,8 @@ tcp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,
*cpp = ip_vs_schedule(svc, skb, pd, &ignored, iph);
if (!*cpp && ignored <= 0) {
if (!ignored)
- *verdict = ip_vs_leave(svc, skb, pd, iph);
+ *verdict = ip_vs_leave(svc, skb, pd, iph,
+ state);
else
*verdict = NF_DROP;
return 0;
diff --git a/net/netfilter/ipvs/ip_vs_proto_udp.c b/net/netfilter/ipvs/ip_vs_proto_udp.c
index f32785682402dd..58b880c8421680 100644
--- a/net/netfilter/ipvs/ip_vs_proto_udp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_udp.c
@@ -31,7 +31,7 @@ static int
udp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,
struct ip_vs_proto_data *pd,
int *verdict, struct ip_vs_conn **cpp,
- struct ip_vs_iphdr *iph)
+ struct ip_vs_iphdr *iph, const struct nf_hook_state *state)
{
struct ip_vs_service *svc;
struct udphdr _udph, *uh;
@@ -78,7 +78,8 @@ udp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,
*cpp = ip_vs_schedule(svc, skb, pd, &ignored, iph);
if (!*cpp && ignored <= 0) {
if (!ignored)
- *verdict = ip_vs_leave(svc, skb, pd, iph);
+ *verdict = ip_vs_leave(svc, skb, pd, iph,
+ state);
else
*verdict = NF_DROP;
return 0;
diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
index ebc6b697ae5160..c777493eee7493 100644
--- a/net/netfilter/ipvs/ip_vs_xmit.c
+++ b/net/netfilter/ipvs/ip_vs_xmit.c
@@ -205,13 +205,24 @@ static inline bool crosses_local_route_boundary(int skb_af, struct sk_buff *skb,
return false;
}
-static inline void maybe_update_pmtu(int skb_af, struct sk_buff *skb, int mtu)
+static inline void maybe_update_pmtu(int skb_af, struct sk_buff *skb, int mtu,
+ const struct nf_hook_state *state)
{
- struct sock *sk = skb->sk;
- struct rtable *ort = skb_rtable(skb);
-
- if (!skb->dev && sk && sk_fullsock(sk))
- ort->dst.ops->update_pmtu(&ort->dst, sk, NULL, mtu, true);
+ struct dst_entry *dst = skb_dst(skb);
+ struct sock *sk = state->sk;
+
+ /* The update_pmtu handlers are missing some checks for:
+ * - skb->dev: present for tunnels, not for IPVS, so we do not
+ * provide skb, only sk
+ * - present daddr: so, we require TCP_ESTABLISHED (connected socket)
+ *
+ * In some states the senders ignore the PMTU events:
+ * - sk_fullsock(): so use the TCP_ESTABLISHED check
+ */
+ if (sk && sk->sk_state == TCP_ESTABLISHED &&
+ state->hook == NF_INET_LOCAL_OUT &&
+ sk->sk_family == dst->ops->family)
+ dst->ops->update_pmtu(dst, sk, NULL, mtu, false);
}
static inline bool ensure_mtu_is_adequate(struct netns_ipvs *ipvs, int skb_af,
@@ -316,7 +327,7 @@ static int
__ip_vs_get_out_rt(struct netns_ipvs *ipvs, int skb_af, struct sk_buff *skb,
struct ip_vs_dest *dest,
__be32 daddr, int rt_mode, __be32 *ret_saddr,
- struct ip_vs_iphdr *ipvsh)
+ struct ip_vs_iphdr *ipvsh, const struct nf_hook_state *state)
{
struct net *net = ipvs->net;
struct ip_vs_dest_dst *dest_dst;
@@ -417,7 +428,7 @@ __ip_vs_get_out_rt(struct netns_ipvs *ipvs, int skb_af, struct sk_buff *skb,
IP_VS_DBG_RL("%s(): mtu less than 68\n", __func__);
goto err_put;
}
- maybe_update_pmtu(skb_af, skb, mtu);
+ maybe_update_pmtu(skb_af, skb, mtu, state);
}
if (!ensure_mtu_is_adequate(ipvs, skb_af, rt_mode, ipvsh, skb, mtu))
@@ -489,7 +500,8 @@ static int
__ip_vs_get_out_rt_v6(struct netns_ipvs *ipvs, int skb_af, struct sk_buff *skb,
struct ip_vs_dest *dest,
struct in6_addr *daddr, struct in6_addr *ret_saddr,
- struct ip_vs_iphdr *ipvsh, int do_xfrm, int rt_mode)
+ struct ip_vs_iphdr *ipvsh, int do_xfrm, int rt_mode,
+ const struct nf_hook_state *state)
{
struct net *net = ipvs->net;
struct ip_vs_dest_dst *dest_dst;
@@ -596,7 +608,7 @@ __ip_vs_get_out_rt_v6(struct netns_ipvs *ipvs, int skb_af, struct sk_buff *skb,
IPV6_MIN_MTU);
goto err_put;
}
- maybe_update_pmtu(skb_af, skb, mtu);
+ maybe_update_pmtu(skb_af, skb, mtu, state);
}
if (!ensure_mtu_is_adequate(ipvs, skb_af, rt_mode, ipvsh, skb, mtu))
@@ -720,12 +732,26 @@ static inline int ip_vs_send_or_cont(int pf, struct sk_buff *skb,
*/
int
ip_vs_null_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,
+ const struct nf_hook_state *state)
{
/* we do not touch skb and do not need pskb ptr */
return ip_vs_send_or_cont(NFPROTO_IPV4, skb, cp, 1);
}
+#ifdef CONFIG_IP_VS_IPV6
+/*
+ * NULL transmitter (do nothing except return NF_ACCEPT)
+ */
+int
+ip_vs_null_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,
+ const struct nf_hook_state *state)
+{
+ /* we do not touch skb and do not need pskb ptr */
+ return ip_vs_send_or_cont(NFPROTO_IPV6, skb, cp, 1);
+}
+#endif
/*
* Bypass transmitter
@@ -734,10 +760,11 @@ ip_vs_null_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
*/
int
ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,
+ const struct nf_hook_state *state)
{
if (__ip_vs_get_out_rt(cp->ipvs, cp->af, skb, NULL, ip_hdr(skb)->daddr,
- IP_VS_RT_MODE_NON_LOCAL, NULL, ipvsh) < 0)
+ IP_VS_RT_MODE_NON_LOCAL, NULL, ipvsh, state) < 0)
goto tx_error;
ip_send_check(ip_hdr(skb));
@@ -757,13 +784,15 @@ ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
#ifdef CONFIG_IP_VS_IPV6
int
ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,
+ const struct nf_hook_state *state)
{
struct ipv6hdr *iph = ipv6_hdr(skb);
if (__ip_vs_get_out_rt_v6(cp->ipvs, cp->af, skb, NULL,
&iph->daddr, NULL,
- ipvsh, 0, IP_VS_RT_MODE_NON_LOCAL) < 0)
+ ipvsh, 0, IP_VS_RT_MODE_NON_LOCAL,
+ state) < 0)
goto tx_error;
/* Another hack: avoid icmp_send in ip_fragment */
@@ -785,7 +814,8 @@ ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
*/
int
ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,
+ const struct nf_hook_state *state)
{
struct rtable *rt; /* Route to the other host */
int local, rc, was_input;
@@ -805,7 +835,7 @@ ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
local = __ip_vs_get_out_rt(cp->ipvs, cp->af, skb, cp->dest, cp->daddr.ip,
IP_VS_RT_MODE_LOCAL |
IP_VS_RT_MODE_NON_LOCAL |
- IP_VS_RT_MODE_RDR, NULL, ipvsh);
+ IP_VS_RT_MODE_RDR, NULL, ipvsh, state);
if (local < 0)
goto tx_error;
rt = skb_rtable(skb);
@@ -869,7 +899,8 @@ ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
#ifdef CONFIG_IP_VS_IPV6
int
ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,
+ const struct nf_hook_state *state)
{
struct rt6_info *rt; /* Route to the other host */
int local, rc;
@@ -889,7 +920,7 @@ ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
NULL, ipvsh, 0,
IP_VS_RT_MODE_LOCAL |
IP_VS_RT_MODE_NON_LOCAL |
- IP_VS_RT_MODE_RDR);
+ IP_VS_RT_MODE_RDR, state);
if (local < 0)
goto tx_error;
rt = dst_rt6_info(skb_dst(skb));
@@ -1145,7 +1176,8 @@ ipvs_gre_encap(struct net *net, struct sk_buff *skb,
*/
int
ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,
+ const struct nf_hook_state *state)
{
struct netns_ipvs *ipvs = cp->ipvs;
struct net *net = ipvs->net;
@@ -1167,7 +1199,7 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
IP_VS_RT_MODE_LOCAL |
IP_VS_RT_MODE_NON_LOCAL |
IP_VS_RT_MODE_CONNECT |
- IP_VS_RT_MODE_TUNNEL, &saddr, ipvsh);
+ IP_VS_RT_MODE_TUNNEL, &saddr, ipvsh, state);
if (local < 0)
goto tx_error;
if (local)
@@ -1276,7 +1308,7 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
ret = ip_vs_tunnel_xmit_prepare(skb, cp);
if (ret == NF_ACCEPT)
- ip_local_out(net, skb->sk, skb);
+ ip_local_out(net, NULL, skb);
else if (ret == NF_DROP)
kfree_skb(skb);
@@ -1290,7 +1322,8 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
#ifdef CONFIG_IP_VS_IPV6
int
ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,
+ const struct nf_hook_state *state)
{
struct netns_ipvs *ipvs = cp->ipvs;
struct net *net = ipvs->net;
@@ -1312,7 +1345,7 @@ ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
&saddr, ipvsh, 1,
IP_VS_RT_MODE_LOCAL |
IP_VS_RT_MODE_NON_LOCAL |
- IP_VS_RT_MODE_TUNNEL);
+ IP_VS_RT_MODE_TUNNEL, state);
if (local < 0)
goto tx_error;
if (local)
@@ -1418,7 +1451,7 @@ ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
ret = ip_vs_tunnel_xmit_prepare(skb, cp);
if (ret == NF_ACCEPT)
- ip6_local_out(net, skb->sk, skb);
+ ip6_local_out(net, NULL, skb);
else if (ret == NF_DROP)
kfree_skb(skb);
@@ -1437,14 +1470,15 @@ ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
*/
int
ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,
+ const struct nf_hook_state *state)
{
int local;
local = __ip_vs_get_out_rt(cp->ipvs, cp->af, skb, cp->dest, cp->daddr.ip,
IP_VS_RT_MODE_LOCAL |
IP_VS_RT_MODE_NON_LOCAL |
- IP_VS_RT_MODE_KNOWN_NH, NULL, ipvsh);
+ IP_VS_RT_MODE_KNOWN_NH, NULL, ipvsh, state);
if (local < 0)
goto tx_error;
if (local)
@@ -1467,7 +1501,8 @@ ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
#ifdef CONFIG_IP_VS_IPV6
int
ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,
+ const struct nf_hook_state *state)
{
int local;
@@ -1476,7 +1511,7 @@ ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
NULL, ipvsh, 0,
IP_VS_RT_MODE_LOCAL |
IP_VS_RT_MODE_NON_LOCAL |
- IP_VS_RT_MODE_KNOWN_NH);
+ IP_VS_RT_MODE_KNOWN_NH, state);
if (local < 0)
goto tx_error;
if (local)
@@ -1503,7 +1538,7 @@ ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
int
ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
struct ip_vs_protocol *pp, unsigned int toff,
- unsigned int hooknum, struct ip_vs_iphdr *ciph)
+ const struct nf_hook_state *state, struct ip_vs_iphdr *ciph)
{
struct rtable *rt; /* Route to the other host */
int rc;
@@ -1517,7 +1552,7 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
translate address/port back */
if (IP_VS_FWD_METHOD(cp) != IP_VS_CONN_F_MASQ) {
if (cp->packet_xmit)
- rc = cp->packet_xmit(skb, cp, pp, ciph);
+ rc = cp->packet_xmit(skb, cp, pp, ciph, state);
else
rc = NF_ACCEPT;
/* do not touch skb anymore */
@@ -1531,11 +1566,11 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
was_input = rt_is_input_route(skb_rtable(skb));
/* LOCALNODE from FORWARD hook is not supported */
- rt_mode = (hooknum != NF_INET_FORWARD) ?
+ rt_mode = (state->hook != NF_INET_FORWARD) ?
IP_VS_RT_MODE_LOCAL | IP_VS_RT_MODE_NON_LOCAL |
IP_VS_RT_MODE_RDR : IP_VS_RT_MODE_NON_LOCAL;
- local = __ip_vs_get_out_rt(cp->ipvs, cp->af, skb, cp->dest, cp->daddr.ip, rt_mode,
- NULL, ciph);
+ local = __ip_vs_get_out_rt(cp->ipvs, cp->af, skb, cp->dest,
+ cp->daddr.ip, rt_mode, NULL, ciph, state);
if (local < 0)
goto tx_error;
rt = skb_rtable(skb);
@@ -1597,8 +1632,8 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
#ifdef CONFIG_IP_VS_IPV6
int
ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, unsigned int toff,
- unsigned int hooknum, struct ip_vs_iphdr *ciph)
+ struct ip_vs_protocol *pp, unsigned int toff,
+ const struct nf_hook_state *state, struct ip_vs_iphdr *ciph)
{
bool has_ports = false;
struct rt6_info *rt; /* Route to the other host */
@@ -1612,7 +1647,7 @@ ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
translate address/port back */
if (IP_VS_FWD_METHOD(cp) != IP_VS_CONN_F_MASQ) {
if (cp->packet_xmit)
- rc = cp->packet_xmit(skb, cp, pp, ciph);
+ rc = cp->packet_xmit(skb, cp, pp, ciph, state);
else
rc = NF_ACCEPT;
/* do not touch skb anymore */
@@ -1625,11 +1660,12 @@ ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
*/
/* LOCALNODE from FORWARD hook is not supported */
- rt_mode = (hooknum != NF_INET_FORWARD) ?
+ rt_mode = (state->hook != NF_INET_FORWARD) ?
IP_VS_RT_MODE_LOCAL | IP_VS_RT_MODE_NON_LOCAL |
IP_VS_RT_MODE_RDR : IP_VS_RT_MODE_NON_LOCAL;
local = __ip_vs_get_out_rt_v6(cp->ipvs, cp->af, skb, cp->dest,
- &cp->daddr.in6, NULL, ciph, 0, rt_mode);
+ &cp->daddr.in6, NULL, ciph, 0, rt_mode,
+ state);
if (local < 0)
goto tx_error;
rt = dst_rt6_info(skb_dst(skb));
|
| 3/2 | 2026/11/15 14:37 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 14727 output: 23 thoughts: 946 Thoughts: **Analyzing the IPVS Kernel Patch Series** Okay, so I've got a patch series here targeting the amd64 architecture, and it's touching the IPVS (IP Virtual Server) code within the kernel. Let's dig in. It's primarily focused on `net/netfilter/ipvs` and seems to be touching the core header and a bunch of the protocol-specific files, the connection management, and the transmission functions. I need to understand the intent and if there are any subtle side-effects. First impression: looks like a fairly broad refactor. The commit diffs indicate the key change is threading `const struct nf_hook_state *state` through a significant portion of the IPVS packet processing path. Specifically, `conn_schedule`, `packet_xmit`, and `ip_vs_leave` are taking this new parameter. I see a notable bug fix in `net/netfilter/ipvs/ip_vs_conn.c`. Previously, the IPv6 LOCALNODE path was incorrectly using `ip_vs_null_xmit`, which assumed IPv4. The patch corrects this by using `ip_vs_null_xmit_v6` in the appropriate condition. Good catch there! The `maybe_update_pmtu` function has also been updated. It now takes `state` as an argument. The logic also seems to have been refined. My initial thought is the conditional based on TCP_ESTABLISHED, NF_INET_LOCAL_OUT, and the sk_family is a move to improve the path. The change from `skb->sk` to `state->sk` will likely be a functional change. Then, there are changes to `ip_vs_tunnel_xmit` and `ip_vs_tunnel_xmit_v6`. It looks like the patch is removing the `skb->sk` parameter from `ip_local_out` and `ip6_local_out`, respectively, in favor of a `NULL` value. I'm curious as to *why* they decided to do this. I'll need to explore the consequences of sending NULL as the sk_ptr. I can see this being passed down to `maybe_update_pmtu` too. Finally, the patch is also passing `state` to all the transmitter functions like `ip_vs_null_xmit`, `ip_vs_null_xmit_v6`, and the like. This is likely an attempt at unifying the code paths. I need to check the git log and the commit message now. This threading of `nf_hook_state` is intriguing and I need the context. I anticipate this will be related to improvements in Netfilter integration, allowing more informed decisions based on hook information. I want to see how these changes are tied to the broader kernel goals and if they introduce any potential regressions. I need to check for any impacts on performance or stability too. |
| 4/2 | 2026/11/15 14:37 | tool | grepper |
0mArgs:{
"Expression": "syz-cluster: applied patch under review"
}Results: {
"Output": "no matches"
} |
| 5/2 | 2026/11/15 14:37 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 16331 output: 33 thoughts: 722 Thoughts: **Analyzing the WorthFuzzing Criteria for an IPVS Patch**
Okay, let's break this down. First, I need to figure out if this patch is "WorthFuzzing" based on the provided criteria. I can't directly use `git show` here, but the patch diff is right in front of me, which should be sufficient.
The immediate question is: Is IPVS reachable in standard environments like QEMU or syzkaller? The answer is a resounding *yes*. It's part of core networking/netfilter, accessible through sockets, netlink, iptables, and so on.
Now, let's go through the "WorthFuzzing=true" criteria:
* **Does it touch reachable executable code?** Absolutely. IPVS is part of core networking.
* **Does it modify any of the core subsystems?** Yes! IPVS falls under "core networking."
* **Is there restructuring of data structures, abstractions, or algorithm flows?** Yes, it seems there are quite a few refactorings in here:
* The `maybe_update_pmtu` logic was completely rewritten. Different `sk` structures are now being used.
* `ip_vs_bind_xmit_v6` now binds to a different function.
* Changes to how `ip_local_out` is called in `ip_vs_tunnel_xmit` and `ip_vs_tunnel_xmit_v6`
* Function signatures refactored to use `nf_hook_state`.
* **Is there introduction or alteration of assertions?** That's not immediately apparent from the information here, but it's not a deal-breaker if not.
* **Does it involve reachable drivers or protocols?** Yes, the IPVS subsystem can be reached via syzkaller through netlink, sockopts, and other hooks.
Looking at the patch itself, I can see significant logic modifications: `maybe_update_pmtu` got a full overhaul, calls to network transmission functions got altered, and there's refactoring with `nf_hook_state`.
To confirm the reachability, I need to consider whether the relevant Kconfig flags are set, so, I'll check `net/netfilter/ipvs/Kconfig` and `Makefile`. However, given the nature of the changes, this patch clearly touches reachable, executable code within a core networking subsystem with considerable restructuring. Therefore, this patch is *definitely* WorthFuzzing.
|
| 6/2 | 2026/11/15 14:38 | tool | grepper |
0mArgs:{
"Expression": "ip_vs",
"PathPrefixes": [
"net/netfilter/ipvs/Makefile"
]
}Results: {
"Output": "net/netfilter/ipvs/Makefile-6-# IPVS transport protocol load balancing support\nnet/netfilter/ipvs/Makefile:7:ip_vs_proto-objs-y :=\nnet/netfilter/ipvs/Makefile:8:ip_vs_proto-objs-$(CONFIG_IP_VS_PROTO_TCP) += ip_vs_proto_tcp.o\nnet/netfilter/ipvs/Makefile:9:ip_vs_proto-objs-$(CONFIG_IP_VS_PROTO_UDP) += ip_vs_proto_udp.o\nnet/netfilter/ipvs/Makefile:10:ip_vs_proto-objs-$(CONFIG_IP_VS_PROTO_AH_ESP) += ip_vs_proto_ah_esp.o\nnet/netfilter/ipvs/Makefile:11:ip_vs_proto-objs-$(CONFIG_IP_VS_PROTO_SCTP) += ip_vs_proto_sctp.o\nnet/netfilter/ipvs/Makefile-12-\nnet/netfilter/ipvs/Makefile:13:ip_vs-extra_objs-y :=\nnet/netfilter/ipvs/Makefile:14:ip_vs-extra_objs-$(CONFIG_IP_VS_NFCT) += ip_vs_nfct.o\nnet/netfilter/ipvs/Makefile-15-\nnet/netfilter/ipvs/Makefile:16:ip_vs-objs :=\tip_vs_conn.o ip_vs_core.o ip_vs_ctl.o ip_vs_sched.o\t \\\nnet/netfilter/ipvs/Makefile:17:\t\tip_vs_xmit.o ip_vs_app.o ip_vs_sync.o\t \t\t \\\nnet/netfilter/ipvs/Makefile:18:\t\tip_vs_est.o ip_vs_proto.o ip_vs_pe.o\t\t\t \\\nnet/netfilter/ipvs/Makefile:19:\t\t$(ip_vs_proto-objs-y) $(ip_vs-extra_objs-y)\nnet/netfilter/ipvs/Makefile-20-\n--\nnet/netfilter/ipvs/Makefile-22-# IPVS core\nnet/netfilter/ipvs/Makefile:23:obj-$(CONFIG_IP_VS) += ip_vs.o\nnet/netfilter/ipvs/Makefile-24-\nnet/netfilter/ipvs/Makefile-25-# IPVS schedulers\nnet/netfilter/ipvs/Makefile:26:obj-$(CONFIG_IP_VS_RR) += ip_vs_rr.o\nnet/netfilter/ipvs/Makefile:27:obj-$(CONFIG_IP_VS_WRR) += ip_vs_wrr.o\nnet/netfilter/ipvs/Makefile:28:obj-$(CONFIG_IP_VS_LC) += ip_vs_lc.o\nnet/netfilter/ipvs/Makefile:29:obj-$(CONFIG_IP_VS_WLC) += ip_vs_wlc.o\nnet/netfilter/ipvs/Makefile:30:obj-$(CONFIG_IP_VS_FO) += ip_vs_fo.o\nnet/netfilter/ipvs/Makefile:31:obj-$(CONFIG_IP_VS_OVF) += ip_vs_ovf.o\nnet/netfilter/ipvs/Makefile:32:obj-$(CONFIG_IP_VS_LBLC) += ip_vs_lblc.o\nnet/netfilter/ipvs/Makefile:33:obj-$(CONFIG_IP_VS_LBLCR) += ip_vs_lblcr.o\nnet/netfilter/ipvs/Makefile:34:obj-$(CONFIG_IP_VS_DH) += ip_vs_dh.o\nnet/netfilter/ipvs/Makefile:35:obj-$(CONFIG_IP_VS_SH) += ip_vs_sh.o\nnet/netfilter/ipvs/Makefile:36:obj-$(CONFIG_IP_VS_MH) += ip_vs_mh.o\nnet/netfilter/ipvs/Makefile:37:obj-$(CONFIG_IP_VS_SED) += ip_vs_sed.o\nnet/netfilter/ipvs/Makefile:38:obj-$(CONFIG_IP_VS_NQ) += ip_vs_nq.o\nnet/netfilter/ipvs/Makefile:39:obj-$(CONFIG_IP_VS_TWOS) += ip_vs_twos.o\nnet/netfilter/ipvs/Makefile-40-\nnet/netfilter/ipvs/Makefile-41-# IPVS application helpers\nnet/netfilter/ipvs/Makefile:42:obj-$(CONFIG_IP_VS_FTP) += ip_vs_ftp.o\nnet/netfilter/ipvs/Makefile-43-\nnet/netfilter/ipvs/Makefile-44-# IPVS connection template retrievers\nnet/netfilter/ipvs/Makefile:45:obj-$(CONFIG_IP_VS_PE_SIP) += ip_vs_pe_sip.o\nnet/netfilter/ipvs/Makefile-46-ifdef CONFIG_GCOV_PROFILE_IPVS\n"
} |
| 7/2 | 2026/11/15 14:38 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 18857 output: 36 thoughts: 29 Thoughts: Okay, let's dive into this. Here's my summary, presented as my own thought process: **Diving into IPVS Configuration** Alright, I need to get a clear picture of how IPVS and its related features are configured within the kernel. The most logical place to start digging is the Kconfig file, specifically `net/netfilter/ipvs/Kconfig`. I need to figure out the dependencies for `IP_VS` itself and any configuration options that hinge on it. This should reveal the relationships between various IPVS components and other kernel modules or options. Knowing these dependencies is essential for understanding how to enable, disable, and tailor IPVS to a specific networking environment. Time to see what that Kconfig file has to say. |
| 8/2 | 2026/11/15 14:38 | tool | grepper |
0mArgs:{
"Expression": "menuconfig IP_VS",
"PathPrefixes": [
"net/netfilter/ipvs/Kconfig"
]
}Results: {
"Output": "net/netfilter/ipvs/Kconfig-4-#\nnet/netfilter/ipvs/Kconfig:5:menuconfig IP_VS\nnet/netfilter/ipvs/Kconfig-6-\ttristate \"IP virtual server support\"\n"
} |
| 9/2 | 2026/11/15 14:38 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 19148 output: 36 thoughts: 25 Thoughts: Okay, here's my interpretation of reading the first 100 lines of `net/netfilter/ipvs/Kconfig`, summarized in the first person as if they were my thoughts: **Dissecting the IPVS Kconfig File** Alright, let's dive into the `Kconfig` file for IPVS. Specifically, I need to understand lines 1 to 100. This should set the stage for how the IP Virtual Server configuration options are presented to the user during kernel configuration. I'm expecting to see the standard Kconfig syntax: `config`, `bool`, `tristate`, `depends on`, `select`, `help`, and potentially some `range` and `default` directives. My immediate goal is to get a feel for the major features and dependencies exposed in this section. I'm looking for a high-level view of what's *configurable* regarding IPVS. I want to see if there are clear feature divisions, perhaps relating to different load-balancing algorithms, connection tracking, or other important aspects. I need to note any dependencies on other kernel features or modules, as these are critical for understanding the integration of IPVS within the broader network stack. I'm also hoping to see the default settings for the main IPVS options, because this helps me evaluate the project's defaults, and evaluate how to best tune these settings. I need to ensure that the settings presented are accurate and consistent with the intended functionality. Finally, I'll be looking for any hints about the organizational structure of this file. Does it use includes or multiple sections? Understanding the organization will allow me to quickly navigate it. |
| 10/2 | 2026/11/15 14:38 | tool | read-file |
0mArgs:{
"File": "net/netfilter/ipvs/Kconfig",
"FirstLine": 1,
"LineCount": 80
}Results: {
"Contents": " 1:\t# SPDX-License-Identifier: GPL-2.0-only\n 2:\t#\n 3:\t# IP Virtual Server configuration\n 4:\t#\n 5:\tmenuconfig IP_VS\n 6:\t\ttristate \"IP virtual server support\"\n 7:\t\tdepends on INET \u0026\u0026 NETFILTER\n 8:\t\tdepends on (NF_CONNTRACK || NF_CONNTRACK=n)\n 9:\t\thelp\n 10:\t\t IP Virtual Server support will let you build a high-performance\n 11:\t\t virtual server based on cluster of two or more real servers. This\n 12:\t\t option must be enabled for at least one of the clustered computers\n 13:\t\t that will take care of intercepting incoming connections to a\n 14:\t\t single IP address and scheduling them to real servers.\n 15:\t\n 16:\t\t Three request dispatching techniques are implemented, they are\n 17:\t\t virtual server via NAT, virtual server via tunneling and virtual\n 18:\t\t server via direct routing. The several scheduling algorithms can\n 19:\t\t be used to choose which server the connection is directed to,\n 20:\t\t thus load balancing can be achieved among the servers. For more\n 21:\t\t information and its administration program, please visit the\n 22:\t\t following URL: \u003chttp://www.linuxvirtualserver.org/\u003e.\n 23:\t\n 24:\t\t If you want to compile it in kernel, say Y. To compile it as a\n 25:\t\t module, choose M here. If unsure, say N.\n 26:\t\n 27:\tif IP_VS\n 28:\t\n 29:\tconfig\tIP_VS_IPV6\n 30:\t\tbool \"IPv6 support for IPVS\"\n 31:\t\tdepends on IPV6 = y || IP_VS = IPV6\n 32:\t\tselect NF_DEFRAG_IPV6\n 33:\t\thelp\n 34:\t\t Add IPv6 support to IPVS.\n 35:\t\n 36:\t\t Say Y if unsure.\n 37:\t\n 38:\tconfig\tIP_VS_DEBUG\n 39:\t\tbool \"IP virtual server debugging\"\n 40:\t\thelp\n 41:\t\t Say Y here if you want to get additional messages useful in\n 42:\t\t debugging the IP virtual server code. You can change the debug\n 43:\t\t level in /proc/sys/net/ipv4/vs/debug_level\n 44:\t\n 45:\tconfig\tIP_VS_TAB_BITS\n 46:\t\tint \"IPVS connection table size (the Nth power of 2)\"\n 47:\t\trange 8 20 if !64BIT\n 48:\t\trange 8 27 if 64BIT\n 49:\t\tdefault 12\n 50:\t\thelp\n 51:\t\t The IPVS connection hash table uses the chaining scheme to handle\n 52:\t\t hash collisions. Using a big IPVS connection hash table will greatly\n 53:\t\t reduce conflicts when there are hundreds of thousands of connections\n 54:\t\t in the hash table.\n 55:\t\n 56:\t\t Note the table size must be power of 2. The table size will be the\n 57:\t\t value of 2 to the your input number power. The number to choose is\n 58:\t\t from 8 to 27 for 64BIT(20 otherwise), the default number is 12,\n 59:\t\t which means the table size is 4096. Don't input the number too\n 60:\t\t small, otherwise you will lose performance on it. You can adapt the\n 61:\t\t table size yourself, according to your virtual server application.\n 62:\t\t It is good to set the table size not far less than the number of\n 63:\t\t connections per second multiplying average lasting time of\n 64:\t\t connection in the table. For example, your virtual server gets 200\n 65:\t\t connections per second, the connection lasts for 200 seconds in\n 66:\t\t average in the connection table, the table size should be not far\n 67:\t\t less than 200x200, it is good to set the table size 32768 (2**15).\n 68:\t\n 69:\t\t Another note that each connection occupies 128 bytes effectively and\n 70:\t\t each hash entry uses 8 bytes, so you can estimate how much memory is\n 71:\t\t needed for your box.\n 72:\t\n 73:\t\t You can overwrite this number setting conn_tab_bits module parameter\n 74:\t\t or by appending ip_vs.conn_tab_bits=? to the kernel command line if\n 75:\t\t IP VS was compiled built-in.\n 76:\t\n 77:\tcomment \"IPVS transport protocol load balancing support\"\n 78:\t\n 79:\tconfig\tIP_VS_PROTO_TCP\n 80:\t\tbool \"TCP load balancing support\"\n"
} |
| 11/2 | 2026/11/15 14:38 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 20809 output: 37 thoughts: 254 Thoughts: **Analyzing the Patch's Configuration Impact** Okay, let's dissect this patch and pinpoint exactly which configurations it touches. First, I see that `CONFIG_IP_VS` is definitely affected, which is expected since it's the core component. Then, it dives into IPv6 with `CONFIG_IP_VS_IPV6`. Given that conditional `#ifdef`, I understand this patch likely modifies IPv6-specific transmission functions like `ip_vs_null_xmit_v6`, `ip_vs_bypass_xmit_v6`, and so on. Moving on, this patch clearly has an impact on the various protocol handlers. I'm seeing it touch the TCP, UDP, SCTP, and AH/ESP handlers, specifically in their respective `ip_vs_proto_*.c` files. I'll need to dig deeper into the actual code changes within those files to understand the nature of the adjustments, but this gives me a solid starting point for where to focus my analysis. I also need to go back and examine the surrounding lines in the `Kconfig` files for each affected protocol, to be completely thorough. |
| 12/2 | 2026/11/15 14:38 | tool | read-file |
0mArgs:{
"File": "net/netfilter/ipvs/Kconfig",
"FirstLine": 81,
"LineCount": 60
}Results: {
"Contents": " 81:\t\thelp\n 82:\t\t This option enables support for load balancing TCP transport\n 83:\t\t protocol. Say Y if unsure.\n 84:\t\n 85:\tconfig\tIP_VS_PROTO_UDP\n 86:\t\tbool \"UDP load balancing support\"\n 87:\t\thelp\n 88:\t\t This option enables support for load balancing UDP transport\n 89:\t\t protocol. Say Y if unsure.\n 90:\t\n 91:\tconfig\tIP_VS_PROTO_AH_ESP\n 92:\t\tdef_bool IP_VS_PROTO_ESP || IP_VS_PROTO_AH\n 93:\t\n 94:\tconfig\tIP_VS_PROTO_ESP\n 95:\t\tbool \"ESP load balancing support\"\n 96:\t\thelp\n 97:\t\t This option enables support for load balancing ESP (Encapsulation\n 98:\t\t Security Payload) transport protocol. Say Y if unsure.\n 99:\t\n 100:\tconfig\tIP_VS_PROTO_AH\n 101:\t\tbool \"AH load balancing support\"\n 102:\t\thelp\n 103:\t\t This option enables support for load balancing AH (Authentication\n 104:\t\t Header) transport protocol. Say Y if unsure.\n 105:\t\n 106:\tconfig IP_VS_PROTO_SCTP\n 107:\t\tbool \"SCTP load balancing support\"\n 108:\t\tselect NET_CRC32C\n 109:\t\thelp\n 110:\t\t This option enables support for load balancing SCTP transport\n 111:\t\t protocol. Say Y if unsure.\n 112:\t\n 113:\tcomment \"IPVS scheduler\"\n 114:\t\n 115:\tconfig\tIP_VS_RR\n 116:\t\ttristate \"round-robin scheduling\"\n 117:\t\thelp\n 118:\t\t The robin-robin scheduling algorithm simply directs network\n 119:\t\t connections to different real servers in a round-robin manner.\n 120:\t\n 121:\t\t If you want to compile it in kernel, say Y. To compile it as a\n 122:\t\t module, choose M here. If unsure, say N.\n 123:\t \n 124:\tconfig\tIP_VS_WRR\n 125:\t\ttristate \"weighted round-robin scheduling\"\n 126:\t\thelp\n 127:\t\t The weighted robin-robin scheduling algorithm directs network\n 128:\t\t connections to different real servers based on server weights\n 129:\t\t in a round-robin manner. Servers with higher weights receive\n 130:\t\t new connections first than those with less weights, and servers\n 131:\t\t with higher weights get more connections than those with less\n 132:\t\t weights and servers with equal weights get equal connections.\n 133:\t\n 134:\t\t If you want to compile it in kernel, say Y. To compile it as a\n 135:\t\t module, choose M here. If unsure, say N.\n 136:\t\n 137:\tconfig\tIP_VS_LC\n 138:\t\ttristate \"least-connection scheduling\"\n 139:\t\thelp\n 140:\t\t The least-connection scheduling algorithm directs network\n"
} |
| 13/2 | 2026/11/15 14:38 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 22185 output: 44 thoughts: 899 Thoughts: **Focusing the Fuzzer on IPVS Changes** Okay, so we're diving into how to best guide the fuzzer for the IPVS changes. First, I've got a mental checklist of relevant IPVS symbols: `IP_VS`, `IP_VS_IPV6`, the TCP, UDP, SCTP, AH, and ESP protocol constants. Good, that's the baseline. Now, according to the document, the key is preventing the fuzzer from being diluted. That means avoiding ubiquitous functions – things like memory allocators or synchronization primitives – because focusing on those would be a massive waste of resources. We need to zero in on the specific feature logic and entry points. And, a crucial point: if the changes are *mostly* inside static inline functions within the headers, we have to look at the non-static functions in the `.c` files that *use* them. The inline functions themselves won't have symbol addresses. Got it. Alright, let's see what's actually changed. I know `maybe_update_pmtu` is static inline within `ip_vs_xmit.c`. Its callers within that file are `__ip_vs_get_out_rt` and `__ip_vs_get_out_rt_v6`, which are *also* static. The transmitter functions, like `ip_vs_bypass_xmit`, `ip_vs_nat_xmit`, all the `*xmit*` functions (for both IPv4 and IPv6) are what *use* those static helpers. These, then, become our targets. Next, we have the protocol scheduling functions – `tcp_conn_schedule`, `udp_conn_schedule`, `sctp_conn_schedule`, and `ah_esp_conn_schedule`. These are function pointers within their respective protocol files. Got it. Finally, we've got core functions to consider. `ip_vs_leave` is an exported function in `ip_vs_core.c` and is non-static. Then, we have the netfilter hook functions: `ip_vs_in_hook` and `ip_vs_forward_icmp` which are also in `ip_vs_core.c`. I should probably double-check if `ip_vs_in_hook` is static or non-static, just to be sure. I'll check around line 2150 in the source code file `ip_vs_core.c` to confirm. |
| 14/2 | 2026/11/15 14:38 | tool | read-file |
0mArgs:{
"File": "net/netfilter/ipvs/ip_vs_core.c",
"FirstLine": 2135,
"LineCount": 40
}Results: {
"Contents": "2135:\t\t\t\t skb-\u003epkt_type, iph.protocol,\n2136:\t\t\t\t IP_VS_DBG_ADDR(af, \u0026iph.daddr), hooknum);\n2137:\t\t\treturn NF_ACCEPT;\n2138:\t\t}\n2139:\t\t/* ipvs enabled in this netns ? */\n2140:\t\tif (unlikely(sysctl_backup_only(ipvs)))\n2141:\t\t\treturn NF_ACCEPT;\n2142:\t\n2143:\t\tip_vs_fill_iph_skb(af, skb, false, \u0026iph);\n2144:\t\n2145:\t\t/* Bad... Do not break raw sockets */\n2146:\t\tsk = skb_to_full_sk(skb);\n2147:\t\tif (unlikely(sk \u0026\u0026 hooknum == NF_INET_LOCAL_OUT \u0026\u0026\n2148:\t\t\t af == AF_INET)) {\n2149:\t\n2150:\t\t\tif (sk-\u003esk_family == PF_INET \u0026\u0026 inet_test_bit(NODEFRAG, sk))\n2151:\t\t\t\treturn NF_ACCEPT;\n2152:\t\t}\n2153:\t\n2154:\t#ifdef CONFIG_IP_VS_IPV6\n2155:\t\tif (af == AF_INET6) {\n2156:\t\t\tif (unlikely(iph.protocol == IPPROTO_ICMPV6)) {\n2157:\t\t\t\tint related;\n2158:\t\t\t\tint verdict = ip_vs_in_icmp_v6(ipvs, skb, \u0026related,\n2159:\t\t\t\t\t\t\t state, \u0026iph);\n2160:\t\n2161:\t\t\t\tif (related)\n2162:\t\t\t\t\treturn verdict;\n2163:\t\t\t}\n2164:\t\t} else\n2165:\t#endif\n2166:\t\t\tif (unlikely(iph.protocol == IPPROTO_ICMP)) {\n2167:\t\t\t\tint related;\n2168:\t\t\t\tint verdict = ip_vs_in_icmp(ipvs, skb, \u0026related,\n2169:\t\t\t\t\t\t\t state, \u0026iph);\n2170:\t\n2171:\t\t\t\tif (related)\n2172:\t\t\t\t\treturn verdict;\n2173:\t\t\t}\n2174:\t\n"
} |
| 15/2 | 2026/11/15 14:38 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 24263 output: 43 thoughts: 26 Thoughts: Okay, let's dive into this. Here's how I'd approach that snippet of code and what I'd be thinking: **Examining `ip_vs_in_hook` in `ip_vs_core.c`** Alright, the task is to familiarize myself with `ip_vs_in_hook`. My first instinct, as always, is to navigate directly to the source. Let's see... I'm heading over to `ip_vs_core.c` now to find the declaration. I need to understand how this hook is defined – its signature, its context, what it expects as input, and what it's supposed to do. Are there any specific data structures it interacts with that are important to track down? I'll probably start scanning the code for function prototypes and any inline comments that might explain its purpose. More specifically, I'm expecting to look for its arguments: what are the parameters passed to this hook? Are there any significant data structures it manipulates, or perhaps global variables it accesses? This information will tell me a lot. Once I locate the declaration, I can begin to unravel its role within the larger IPVS framework. I'm looking for a clear description of its purpose and how it fits into the overall packet processing flow. |
| 16/2 | 2026/11/15 14:38 | tool | grepper |
0mArgs:{
"Expression": "ip_vs_in_hook",
"PathPrefixes": [
"net/netfilter/ipvs/ip_vs_core.c"
]
}Results: {
"Output": "net/netfilter/ipvs/ip_vs_core.c=2107=static unsigned int\nnet/netfilter/ipvs/ip_vs_core.c:2108:ip_vs_in_hook(void *priv, struct sk_buff *skb, const struct nf_hook_state *state)\nnet/netfilter/ipvs/ip_vs_core.c-2109-{\n--\nnet/netfilter/ipvs/ip_vs_core.c=2337=static const struct nf_hook_ops ip_vs_ops4[] = {\n--\nnet/netfilter/ipvs/ip_vs_core.c-2348-\t{\nnet/netfilter/ipvs/ip_vs_core.c:2349:\t\t.hook\t\t= ip_vs_in_hook,\nnet/netfilter/ipvs/ip_vs_core.c-2350-\t\t.pf\t\t= NFPROTO_IPV4,\n--\nnet/netfilter/ipvs/ip_vs_core.c-2362-\t{\nnet/netfilter/ipvs/ip_vs_core.c:2363:\t\t.hook\t\t= ip_vs_in_hook,\nnet/netfilter/ipvs/ip_vs_core.c-2364-\t\t.pf\t\t= NFPROTO_IPV4,\n--\nnet/netfilter/ipvs/ip_vs_core.c=2386=static const struct nf_hook_ops ip_vs_ops6[] = {\n--\nnet/netfilter/ipvs/ip_vs_core.c-2397-\t{\nnet/netfilter/ipvs/ip_vs_core.c:2398:\t\t.hook\t\t= ip_vs_in_hook,\nnet/netfilter/ipvs/ip_vs_core.c-2399-\t\t.pf\t\t= NFPROTO_IPV6,\n--\nnet/netfilter/ipvs/ip_vs_core.c-2411-\t{\nnet/netfilter/ipvs/ip_vs_core.c:2412:\t\t.hook\t\t= ip_vs_in_hook,\nnet/netfilter/ipvs/ip_vs_core.c-2413-\t\t.pf\t\t= NFPROTO_IPV6,\n"
} |
| 17/2 | 2026/11/15 14:38 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 25172 output: 40 thoughts: 519 Thoughts: **Analyzing IPVS Symbol Visibility** Okay, so I'm digging into the symbol visibility within the IPVS (IP Virtual Server) module. My initial thought is that `ip_vs_in_hook` is definitely going to be a visible symbol, right? It's the primary hook callback in both `ip_vs_ops4` and `ip_vs_ops6`, and because its address is used within those structures, the compiler won't be inlining it. That means it *has* to be present as a symbol in vmlinux and `ip_vs.ko`. I'm also remembering that `ip_vs_forward_icmp` is in the same boat, it's a hook callback as well, so it'll also be visible. Now, I need to expand the scope a bit. What other non-static functions have been modified or are relevant? Let me list them: In `ip_vs_xmit.c`, I have: * `ip_vs_null_xmit` * `ip_vs_null_xmit_v6` * `ip_vs_bypass_xmit` * `ip_vs_bypass_xmit_v6` * `ip_vs_nat_xmit` * `ip_vs_nat_xmit_v6` * `ip_vs_tunnel_xmit` * `ip_vs_tunnel_xmit_v6` * `ip_vs_dr_xmit` * `ip_vs_dr_xmit_v6` * `ip_vs_icmp_xmit` * `ip_vs_icmp_xmit_v6` From `ip_vs_core.c`: * `ip_vs_leave` * `ip_vs_in_hook` * `ip_vs_forward_icmp` And finally, from the protocol-specific files: * In `ip_vs_proto_tcp.c`, `tcp_conn_schedule` (its address is taken in an `ip_vs_protocol` struct). * In `ip_vs_proto_udp.c`, `udp_conn_schedule` (similarly, its address is taken). * In `ip_vs_proto_sctp.c`, `sctp_conn_schedule` (again, address taken). Okay, one last thing: I'm just quickly checking on `ip_vs_bind_xmit_v6`, which is in `ip_vs_conn.c` within `net/netfilter/ipvs`. I should really find out what *calls* `ip_vs_bind_xmit_v6`, so I will grep for that. |
| 18/2 | 2026/11/15 14:38 | tool | grepper |
0mArgs:{
"Expression": "ip_vs_bind_xmit_v6",
"PathPrefixes": [
"net/netfilter/ipvs/"
]
}Results: {
"Output": "net/netfilter/ipvs/ip_vs_conn.c=1023=static inline void ip_vs_bind_xmit(struct ip_vs_conn *cp)\n--\nnet/netfilter/ipvs/ip_vs_conn.c-1053-#ifdef CONFIG_IP_VS_IPV6\nnet/netfilter/ipvs/ip_vs_conn.c:1054:static inline void ip_vs_bind_xmit_v6(struct ip_vs_conn *cp)\nnet/netfilter/ipvs/ip_vs_conn.c-1055-{\n--\nnet/netfilter/ipvs/ip_vs_conn.c=1170=void ip_vs_try_bind_dest(struct ip_vs_conn *cp)\n--\nnet/netfilter/ipvs/ip_vs_conn.c-1205-\t\tif (cp-\u003eaf == AF_INET6)\nnet/netfilter/ipvs/ip_vs_conn.c:1206:\t\t\tip_vs_bind_xmit_v6(cp);\nnet/netfilter/ipvs/ip_vs_conn.c-1207-\t\telse\n--\nnet/netfilter/ipvs/ip_vs_conn.c=1447=ip_vs_conn_new(const struct ip_vs_conn_param *p, int dest_af,\n--\nnet/netfilter/ipvs/ip_vs_conn.c-1538-\tif (p-\u003eaf == AF_INET6)\nnet/netfilter/ipvs/ip_vs_conn.c:1539:\t\tip_vs_bind_xmit_v6(cp);\nnet/netfilter/ipvs/ip_vs_conn.c-1540-\telse\n"
} |
| 19/2 | 2026/11/15 14:38 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 26792 output: 401 thoughts: 2575 Thoughts: **IPVS Patch Analysis and Fuzzing Strategy** Okay, let's break this down. My initial observation is that `ip_vs_null_xmit_v6` is a brand-new function. This immediately piques my interest. I need to understand its purpose and how it's used within the IPVS framework, especially since it's now exported in the header file. This is crucial for understanding the impact of this change. I'm seeing that several functions, `ip_vs_conn_new`, `ip_vs_try_bind_dest` call the new function and that the existing v4 counterpart gets the NFPROTO arg, and it's being used in association with `IP_VS_CONN_F_LOCALNODE`, which previously wasn't handled correctly for IPv6. I need to read the commit message or examine changes in detail. The next thing that jumps out is the alteration of `maybe_update_pmtu`. The change in how the socket `sk` is accessed, now via `state->sk` instead of `skb->sk`, suggests a fundamental shift in how PMTU updates are handled within netfilter hooks. This implies a potential fix for socket mismatches, or better flow of PMTU info through different netfilter contexts. Similarly, the change in `ip_vs_tunnel_xmit` and `ip_vs_tunnel_xmit_v6` where `skb->sk` is replaced with `NULL` in `ip_local_out` calls is significant. This is a subtle but critical correction to prevent socket ownership issues during encapsulation, potential for crashes or incorrect accounting. In the case of `IP_VS_CONN_F_LOCALNODE`, it's clear that IPv6 LOCALNODE connections are now receiving the intended behavior, with `ip_vs_null_xmit_v6` replacing the older (incorrect) call to `ip_vs_null_xmit`. Now, I'm thinking about fuzzing and which functions are relevant. Following the guidelines for FocusSymbols, I need to identify the feature-specific functions and entrypoints. I've compiled a list of key functions modified or directly exercising the changes: `ip_vs_null_xmit`, `ip_vs_null_xmit_v6`, and the relevant transmit functions (`ip_vs_*_xmit`, including the bypass, NAT, tunnel, DR, and ICMP variants). The functions that schedule connection events like `tcp_conn_schedule`, `udp_conn_schedule`, `sctp_conn_schedule` are also relevant. `ip_vs_in_hook` is the main entrypoint and it's important to include and of course, `ip_vs_leave`. Importantly, none of these are ubiquitous. They are all specific to IPVS. I need to double-check that they are actually symbols for fuzzing. They are! Finally, I need to define the relevant configurations. The dependencies for IPVS are `IP_VS`, `IP_VS_IPV6`, `IP_VS_PROTO_TCP`, `IP_VS_PROTO_UDP`, `IP_VS_PROTO_SCTP` along with their parents and support functions. Considering the changes, including changes to core networking logic (PMTU updates, socket handling in tunnels, IPv6 connection binding and netfilter hook context), this is *absolutely* worth fuzzing. These features are easily reachable via network syscalls and netlink, which make them ideal fuzzing targets. All set. |
| 20/2 | 2026/11/15 14:39 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"IP_VS",
"IP_VS_IPV6",
"IP_VS_PROTO_TCP",
"IP_VS_PROTO_UDP",
"IP_VS_PROTO_SCTP",
"IP_VS_PROTO_AH",
"IP_VS_PROTO_ESP",
"NETFILTER"
],
"FocusSymbols": [
"ip_vs_null_xmit_v6",
"ip_vs_null_xmit",
"ip_vs_nat_xmit",
"ip_vs_nat_xmit_v6",
"ip_vs_tunnel_xmit",
"ip_vs_tunnel_xmit_v6",
"ip_vs_dr_xmit",
"ip_vs_dr_xmit_v6",
"ip_vs_icmp_xmit",
"ip_vs_icmp_xmit_v6",
"ip_vs_in_hook",
"ip_vs_leave",
"tcp_conn_schedule",
"udp_conn_schedule",
"sctp_conn_schedule"
],
"Reasoning": "The patch modifies core IPVS (IP Virtual Server) network stack code. It threads `struct nf_hook_state` through protocol connection scheduling, ICMP handling, and packet transmitters. It also modifies PMTU updates in `maybe_update_pmtu`, fixes IPv6 LOCALNODE packet transmission binding by adding and using `ip_vs_null_xmit_v6`, and alters socket parameter passing in `ip_vs_tunnel_xmit` and `ip_vs_tunnel_xmit_v6`. This code is fully reachable in standard QEMU environments via network sockets, netlink, and netfilter hooks.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"IP_VS",
"IP_VS_IPV6",
"IP_VS_PROTO_TCP",
"IP_VS_PROTO_UDP",
"IP_VS_PROTO_SCTP",
"IP_VS_PROTO_AH",
"IP_VS_PROTO_ESP",
"NETFILTER"
],
"FocusSymbols": [
"ip_vs_null_xmit_v6",
"ip_vs_null_xmit",
"ip_vs_nat_xmit",
"ip_vs_nat_xmit_v6",
"ip_vs_tunnel_xmit",
"ip_vs_tunnel_xmit_v6",
"ip_vs_dr_xmit",
"ip_vs_dr_xmit_v6",
"ip_vs_icmp_xmit",
"ip_vs_icmp_xmit_v6",
"ip_vs_in_hook",
"ip_vs_leave",
"tcp_conn_schedule",
"udp_conn_schedule",
"sctp_conn_schedule"
],
"Reasoning": "The patch modifies core IPVS (IP Virtual Server) network stack code. It threads `struct nf_hook_state` through protocol connection scheduling, ICMP handling, and packet transmitters. It also modifies PMTU updates in `maybe_update_pmtu`, fixes IPv6 LOCALNODE packet transmission binding by adding and using `ip_vs_null_xmit_v6`, and alters socket parameter passing in `ip_vs_tunnel_xmit` and `ip_vs_tunnel_xmit_v6`. This code is fully reachable in standard QEMU environments via network sockets, netlink, and netfilter hooks.",
"WorthFuzzing": true
} |
| 21/1 | 2026/11/15 14:39 | action | If |
0mArgs:{
"WorthFuzzing": true
}Results: null |
| 22/2 | 2026/11/15 14:39 | agent | kmsan-evaluator |
0mModel:core Args: null Results: {
"KMSANReasoning": "The patch series updates IPVS (IP Virtual Server) packet transmission paths to properly handle Path MTU (PMTU) updates by passing the Netfilter hook state (`nf_hook_state`) down to `maybe_update_pmtu()` and packet transmitter functions, fixing IPv6 localnode transmitter binding, and passing NULL socket to `ip_local_out`/`ip6_local_out` during tunnel transmission.\n\nThese changes involve passing an existing fully-initialized hook state pointer from the netfilter core down the call stack, updating PMTU condition checks, and binding the appropriate transmitter function. The patch introduces no memory allocations, no reads of uninitialized stack or heap variables, no modifications to kernel-to-user data copies, and no changes to data length or buffer boundaries that could expose uninitialized memory. Any potential issues introduced by these changes (such as NULL pointer dereferences or socket state issues) are covered by standard kernel sanitizers (KASAN, standard bug checks). Therefore, a dedicated KMSAN fuzzing session is not warranted.",
"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: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit 4820c4a56fc31dc751a6f8cd1791bfc538820726
Author: syz-cluster <triage@syzkaller.com>
Date: Sun Nov 15 14:37:32 2026 +0000
syz-cluster: applied patch under review
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 9a83bff32569da..398d748f01ec88 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -731,7 +731,8 @@ struct ip_vs_protocol {
int af, struct sk_buff *skb,
struct ip_vs_proto_data *pd,
int *verdict, struct ip_vs_conn **cpp,
- struct ip_vs_iphdr *iph);
+ struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
struct ip_vs_conn *
(*conn_in_get)(struct netns_ipvs *ipvs,
@@ -872,7 +873,8 @@ struct ip_vs_conn {
* NF_ACCEPT can be returned when destination is local.
*/
int (*packet_xmit)(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
struct rcu_head rcu_head;
};
@@ -1871,7 +1873,8 @@ ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb,
struct ip_vs_proto_data *pd, int *ignored,
struct ip_vs_iphdr *iph);
int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
- struct ip_vs_proto_data *pd, struct ip_vs_iphdr *iph);
+ struct ip_vs_proto_data *pd, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg);
@@ -1986,32 +1989,46 @@ static inline int ip_vs_est_max_threads(struct netns_ipvs *ipvs)
/* Various IPVS packet transmitters (from ip_vs_xmit.c) */
int ip_vs_null_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
int ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
int ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
int ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
int ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
int ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
struct ip_vs_protocol *pp, unsigned int toff,
- unsigned int hooknum, struct ip_vs_iphdr *ciph);
+ const struct nf_hook_state *state,
+ struct ip_vs_iphdr *ciph);
void ip_vs_dest_dst_rcu_free(struct rcu_head *head);
#ifdef CONFIG_IP_VS_IPV6
+int ip_vs_null_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
int ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
int ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
int ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
int ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state);
int ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
struct ip_vs_protocol *pp, unsigned int toff,
- unsigned int hooknum, struct ip_vs_iphdr *ciph);
+ const struct nf_hook_state *state,
+ struct ip_vs_iphdr *ciph);
#endif
#ifdef CONFIG_SYSCTL
diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index 94f25fb7d87e45..0c2eeb987f008f 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -1070,7 +1070,7 @@ static inline void ip_vs_bind_xmit_v6(struct ip_vs_conn *cp)
break;
case IP_VS_CONN_F_LOCALNODE:
- cp->packet_xmit = ip_vs_null_xmit;
+ cp->packet_xmit = ip_vs_null_xmit_v6;
break;
case IP_VS_CONN_F_BYPASS:
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index fd503f0efb5783..bb649a9f00c7c6 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -760,7 +760,8 @@ static inline int ip_vs_addr_is_unicast(struct net *net, int af,
* no destination is available for a new connection.
*/
int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
- struct ip_vs_proto_data *pd, struct ip_vs_iphdr *iph)
+ struct ip_vs_proto_data *pd, struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state)
{
__be16 _ports[2], *pptr, dport;
struct netns_ipvs *ipvs = svc->ipvs;
@@ -805,7 +806,7 @@ int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
ip_vs_set_state(cp, IP_VS_DIR_INPUT, skb, pd, iph->len);
/* transmit the first SYN packet */
- ret = cp->packet_xmit(skb, cp, pd->pp, iph);
+ ret = cp->packet_xmit(skb, cp, pd->pp, iph, state);
/* do not touch skb anymore */
if ((cp->flags & IP_VS_CONN_F_ONE_PACKET) && cp->control)
@@ -1647,7 +1648,8 @@ static unsigned int
ip_vs_try_to_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,
struct ip_vs_proto_data *pd,
int *verdict, struct ip_vs_conn **cpp,
- struct ip_vs_iphdr *iph)
+ struct ip_vs_iphdr *iph,
+ const struct nf_hook_state *state)
{
struct ip_vs_protocol *pp = pd->pp;
@@ -1657,7 +1659,8 @@ ip_vs_try_to_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,
*/
/* Schedule and create new connection entry into cpp */
- if (!pp->conn_schedule(ipvs, af, skb, pd, verdict, cpp, iph))
+ if (!pp->conn_schedule(ipvs, af, skb, pd, verdict, cpp, iph,
+ state))
return 0;
}
@@ -1757,7 +1760,7 @@ static int ipvs_gre_decap(struct netns_ipvs *ipvs, struct sk_buff *skb,
*/
static int
ip_vs_in_icmp(struct netns_ipvs *ipvs, struct sk_buff *skb, int *related,
- unsigned int hooknum, struct ip_vs_iphdr *iph)
+ const struct nf_hook_state *state, struct ip_vs_iphdr *iph)
{
struct icmphdr _icmph, *ic;
struct iphdr _ciph, *cih; /* The ip header contained within the ICMP */
@@ -1776,7 +1779,8 @@ ip_vs_in_icmp(struct netns_ipvs *ipvs, struct sk_buff *skb, int *related,
/* reassemble IP fragments */
if (ip_is_fragment(ip_hdr(skb))) {
- if (ip_vs_gather_frags(ipvs, skb, ip_vs_defrag_user(hooknum)))
+ if (ip_vs_gather_frags(ipvs, skb,
+ ip_vs_defrag_user(state->hook)))
return NF_STOLEN;
if (!ip_vs_fill_iph_skb(AF_INET, skb, false, iph))
return NF_ACCEPT;
@@ -1893,7 +1897,8 @@ ip_vs_in_icmp(struct netns_ipvs *ipvs, struct sk_buff *skb, int *related,
if (tunnel || !sysctl_schedule_icmp(ipvs))
return NF_ACCEPT;
- if (!ip_vs_try_to_schedule(ipvs, AF_INET, skb, pd, &v, &cp, &ciph))
+ if (!ip_vs_try_to_schedule(ipvs, AF_INET, skb, pd, &v, &cp,
+ &ciph, state))
return v;
new_cp = true;
}
@@ -1981,7 +1986,7 @@ ip_vs_in_icmp(struct netns_ipvs *ipvs, struct sk_buff *skb, int *related,
/* do the statistics and put it back */
ip_vs_in_stats(cp, skb);
- verdict = ip_vs_icmp_xmit(skb, cp, pp, iph->len, hooknum, &ciph);
+ verdict = ip_vs_icmp_xmit(skb, cp, pp, iph->len, state, &ciph);
out:
if (likely(!new_cp))
@@ -1994,7 +1999,7 @@ ip_vs_in_icmp(struct netns_ipvs *ipvs, struct sk_buff *skb, int *related,
#ifdef CONFIG_IP_VS_IPV6
static int ip_vs_in_icmp_v6(struct netns_ipvs *ipvs, struct sk_buff *skb,
- int *related, unsigned int hooknum,
+ int *related, const struct nf_hook_state *state,
struct ip_vs_iphdr *iph)
{
struct icmp6hdr _icmph, *ic;
@@ -2060,7 +2065,8 @@ static int ip_vs_in_icmp_v6(struct netns_ipvs *ipvs, struct sk_buff *skb,
if (!sysctl_schedule_icmp(ipvs))
return NF_ACCEPT;
- if (!ip_vs_try_to_schedule(ipvs, AF_INET6, skb, pd, &v, &cp, &ciph))
+ if (!ip_vs_try_to_schedule(ipvs, AF_INET6, skb, pd, &v, &cp,
+ &ciph, state))
return v;
new_cp = true;
@@ -2081,7 +2087,7 @@ static int ip_vs_in_icmp_v6(struct netns_ipvs *ipvs, struct sk_buff *skb,
/* do the statistics and put it back */
ip_vs_in_stats(cp, skb);
- verdict = ip_vs_icmp_xmit_v6(skb, cp, pp, iph->len, hooknum, &ciph);
+ verdict = ip_vs_icmp_xmit_v6(skb, cp, pp, iph->len, state, &ciph);
out:
if (likely(!new_cp))
@@ -2150,7 +2156,7 @@ ip_vs_in_hook(void *priv, struct sk_buff *skb, const struct nf_hook_state *state
if (unlikely(iph.protocol == IPPROTO_ICMPV6)) {
int related;
int verdict = ip_vs_in_icmp_v6(ipvs, skb, &related,
- hooknum, &iph);
+ state, &iph);
if (related)
return verdict;
@@ -2160,7 +2166,7 @@ ip_vs_in_hook(void *priv, struct sk_buff *skb, const struct nf_hook_state *state
if (unlikely(iph.protocol == IPPROTO_ICMP)) {
int related;
int verdict = ip_vs_in_icmp(ipvs, skb, &related,
- hooknum, &iph);
+ state, &iph);
if (related)
return verdict;
@@ -2248,7 +2254,8 @@ ip_vs_in_hook(void *priv, struct sk_buff *skb, const struct nf_hook_state *state
if (unlikely(!cp)) {
int v;
- if (!ip_vs_try_to_schedule(ipvs, af, skb, pd, &v, &cp, &iph))
+ if (!ip_vs_try_to_schedule(ipvs, af, skb, pd, &v, &cp, &iph,
+ state))
return v;
}
@@ -2257,7 +2264,7 @@ ip_vs_in_hook(void *priv, struct sk_buff *skb, const struct nf_hook_state *state
ip_vs_in_stats(cp, skb);
ip_vs_set_state(cp, IP_VS_DIR_INPUT, skb, pd, iph.len);
if (cp->packet_xmit)
- ret = cp->packet_xmit(skb, cp, pp, &iph);
+ ret = cp->packet_xmit(skb, cp, pp, &iph, state);
/* do not touch skb anymore */
else {
IP_VS_DBG_RL("warning: packet_xmit is null");
@@ -2320,11 +2327,11 @@ ip_vs_forward_icmp(void *priv, struct sk_buff *skb,
if (iphdr.protocol != IPPROTO_ICMPV6)
return NF_ACCEPT;
- return ip_vs_in_icmp_v6(ipvs, skb, &r, state->hook, &iphdr);
+ return ip_vs_in_icmp_v6(ipvs, skb, &r, state, &iphdr);
#endif
}
- return ip_vs_in_icmp(ipvs, skb, &r, state->hook, &iphdr);
+ return ip_vs_in_icmp(ipvs, skb, &r, state, &iphdr);
}
static const struct nf_hook_ops ip_vs_ops4[] = {
diff --git a/net/netfilter/ipvs/ip_vs_proto_ah_esp.c b/net/netfilter/ipvs/ip_vs_proto_ah_esp.c
index 44e14acc187ee3..c7f90b29be51b3 100644
--- a/net/netfilter/ipvs/ip_vs_proto_ah_esp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_ah_esp.c
@@ -102,7 +102,7 @@ static int
ah_esp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,
struct ip_vs_proto_data *pd,
int *verdict, struct ip_vs_conn **cpp,
- struct ip_vs_iphdr *iph)
+ struct ip_vs_iphdr *iph, const struct nf_hook_state *state)
{
/*
* AH/ESP is only related traffic. Pass the packet to IP stack.
diff --git a/net/netfilter/ipvs/ip_vs_proto_sctp.c b/net/netfilter/ipvs/ip_vs_proto_sctp.c
index fb8af6b15a3999..c5810f86846efe 100644
--- a/net/netfilter/ipvs/ip_vs_proto_sctp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_sctp.c
@@ -17,7 +17,7 @@ static int
sctp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,
struct ip_vs_proto_data *pd,
int *verdict, struct ip_vs_conn **cpp,
- struct ip_vs_iphdr *iph)
+ struct ip_vs_iphdr *iph, const struct nf_hook_state *state)
{
struct ip_vs_service *svc;
struct sctp_chunkhdr _schunkh, *sch;
@@ -71,7 +71,8 @@ sctp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,
*cpp = ip_vs_schedule(svc, skb, pd, &ignored, iph);
if (!*cpp && ignored <= 0) {
if (!ignored)
- *verdict = ip_vs_leave(svc, skb, pd, iph);
+ *verdict = ip_vs_leave(svc, skb, pd, iph,
+ state);
else
*verdict = NF_DROP;
return 0;
diff --git a/net/netfilter/ipvs/ip_vs_proto_tcp.c b/net/netfilter/ipvs/ip_vs_proto_tcp.c
index fec0e8b47b7165..66ae924b04f3ab 100644
--- a/net/netfilter/ipvs/ip_vs_proto_tcp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_tcp.c
@@ -35,7 +35,7 @@ static int
tcp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,
struct ip_vs_proto_data *pd,
int *verdict, struct ip_vs_conn **cpp,
- struct ip_vs_iphdr *iph)
+ struct ip_vs_iphdr *iph, const struct nf_hook_state *state)
{
struct ip_vs_service *svc;
struct tcphdr _tcph, *th;
@@ -90,7 +90,8 @@ tcp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,
*cpp = ip_vs_schedule(svc, skb, pd, &ignored, iph);
if (!*cpp && ignored <= 0) {
if (!ignored)
- *verdict = ip_vs_leave(svc, skb, pd, iph);
+ *verdict = ip_vs_leave(svc, skb, pd, iph,
+ state);
else
*verdict = NF_DROP;
return 0;
diff --git a/net/netfilter/ipvs/ip_vs_proto_udp.c b/net/netfilter/ipvs/ip_vs_proto_udp.c
index f32785682402dd..58b880c8421680 100644
--- a/net/netfilter/ipvs/ip_vs_proto_udp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_udp.c
@@ -31,7 +31,7 @@ static int
udp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,
struct ip_vs_proto_data *pd,
int *verdict, struct ip_vs_conn **cpp,
- struct ip_vs_iphdr *iph)
+ struct ip_vs_iphdr *iph, const struct nf_hook_state *state)
{
struct ip_vs_service *svc;
struct udphdr _udph, *uh;
@@ -78,7 +78,8 @@ udp_conn_schedule(struct netns_ipvs *ipvs, int af, struct sk_buff *skb,
*cpp = ip_vs_schedule(svc, skb, pd, &ignored, iph);
if (!*cpp && ignored <= 0) {
if (!ignored)
- *verdict = ip_vs_leave(svc, skb, pd, iph);
+ *verdict = ip_vs_leave(svc, skb, pd, iph,
+ state);
else
*verdict = NF_DROP;
return 0;
diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
index ebc6b697ae5160..c777493eee7493 100644
--- a/net/netfilter/ipvs/ip_vs_xmit.c
+++ b/net/netfilter/ipvs/ip_vs_xmit.c
@@ -205,13 +205,24 @@ static inline bool crosses_local_route_boundary(int skb_af, struct sk_buff *skb,
return false;
}
-static inline void maybe_update_pmtu(int skb_af, struct sk_buff *skb, int mtu)
+static inline void maybe_update_pmtu(int skb_af, struct sk_buff *skb, int mtu,
+ const struct nf_hook_state *state)
{
- struct sock *sk = skb->sk;
- struct rtable *ort = skb_rtable(skb);
-
- if (!skb->dev && sk && sk_fullsock(sk))
- ort->dst.ops->update_pmtu(&ort->dst, sk, NULL, mtu, true);
+ struct dst_entry *dst = skb_dst(skb);
+ struct sock *sk = state->sk;
+
+ /* The update_pmtu handlers are missing some checks for:
+ * - skb->dev: present for tunnels, not for IPVS, so we do not
+ * provide skb, only sk
+ * - present daddr: so, we require TCP_ESTABLISHED (connected socket)
+ *
+ * In some states the senders ignore the PMTU events:
+ * - sk_fullsock(): so use the TCP_ESTABLISHED check
+ */
+ if (sk && sk->sk_state == TCP_ESTABLISHED &&
+ state->hook == NF_INET_LOCAL_OUT &&
+ sk->sk_family == dst->ops->family)
+ dst->ops->update_pmtu(dst, sk, NULL, mtu, false);
}
static inline bool ensure_mtu_is_adequate(struct netns_ipvs *ipvs, int skb_af,
@@ -316,7 +327,7 @@ static int
__ip_vs_get_out_rt(struct netns_ipvs *ipvs, int skb_af, struct sk_buff *skb,
struct ip_vs_dest *dest,
__be32 daddr, int rt_mode, __be32 *ret_saddr,
- struct ip_vs_iphdr *ipvsh)
+ struct ip_vs_iphdr *ipvsh, const struct nf_hook_state *state)
{
struct net *net = ipvs->net;
struct ip_vs_dest_dst *dest_dst;
@@ -417,7 +428,7 @@ __ip_vs_get_out_rt(struct netns_ipvs *ipvs, int skb_af, struct sk_buff *skb,
IP_VS_DBG_RL("%s(): mtu less than 68\n", __func__);
goto err_put;
}
- maybe_update_pmtu(skb_af, skb, mtu);
+ maybe_update_pmtu(skb_af, skb, mtu, state);
}
if (!ensure_mtu_is_adequate(ipvs, skb_af, rt_mode, ipvsh, skb, mtu))
@@ -489,7 +500,8 @@ static int
__ip_vs_get_out_rt_v6(struct netns_ipvs *ipvs, int skb_af, struct sk_buff *skb,
struct ip_vs_dest *dest,
struct in6_addr *daddr, struct in6_addr *ret_saddr,
- struct ip_vs_iphdr *ipvsh, int do_xfrm, int rt_mode)
+ struct ip_vs_iphdr *ipvsh, int do_xfrm, int rt_mode,
+ const struct nf_hook_state *state)
{
struct net *net = ipvs->net;
struct ip_vs_dest_dst *dest_dst;
@@ -596,7 +608,7 @@ __ip_vs_get_out_rt_v6(struct netns_ipvs *ipvs, int skb_af, struct sk_buff *skb,
IPV6_MIN_MTU);
goto err_put;
}
- maybe_update_pmtu(skb_af, skb, mtu);
+ maybe_update_pmtu(skb_af, skb, mtu, state);
}
if (!ensure_mtu_is_adequate(ipvs, skb_af, rt_mode, ipvsh, skb, mtu))
@@ -720,12 +732,26 @@ static inline int ip_vs_send_or_cont(int pf, struct sk_buff *skb,
*/
int
ip_vs_null_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,
+ const struct nf_hook_state *state)
{
/* we do not touch skb and do not need pskb ptr */
return ip_vs_send_or_cont(NFPROTO_IPV4, skb, cp, 1);
}
+#ifdef CONFIG_IP_VS_IPV6
+/*
+ * NULL transmitter (do nothing except return NF_ACCEPT)
+ */
+int
+ip_vs_null_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,
+ const struct nf_hook_state *state)
+{
+ /* we do not touch skb and do not need pskb ptr */
+ return ip_vs_send_or_cont(NFPROTO_IPV6, skb, cp, 1);
+}
+#endif
/*
* Bypass transmitter
@@ -734,10 +760,11 @@ ip_vs_null_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
*/
int
ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,
+ const struct nf_hook_state *state)
{
if (__ip_vs_get_out_rt(cp->ipvs, cp->af, skb, NULL, ip_hdr(skb)->daddr,
- IP_VS_RT_MODE_NON_LOCAL, NULL, ipvsh) < 0)
+ IP_VS_RT_MODE_NON_LOCAL, NULL, ipvsh, state) < 0)
goto tx_error;
ip_send_check(ip_hdr(skb));
@@ -757,13 +784,15 @@ ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
#ifdef CONFIG_IP_VS_IPV6
int
ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,
+ const struct nf_hook_state *state)
{
struct ipv6hdr *iph = ipv6_hdr(skb);
if (__ip_vs_get_out_rt_v6(cp->ipvs, cp->af, skb, NULL,
&iph->daddr, NULL,
- ipvsh, 0, IP_VS_RT_MODE_NON_LOCAL) < 0)
+ ipvsh, 0, IP_VS_RT_MODE_NON_LOCAL,
+ state) < 0)
goto tx_error;
/* Another hack: avoid icmp_send in ip_fragment */
@@ -785,7 +814,8 @@ ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
*/
int
ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,
+ const struct nf_hook_state *state)
{
struct rtable *rt; /* Route to the other host */
int local, rc, was_input;
@@ -805,7 +835,7 @@ ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
local = __ip_vs_get_out_rt(cp->ipvs, cp->af, skb, cp->dest, cp->daddr.ip,
IP_VS_RT_MODE_LOCAL |
IP_VS_RT_MODE_NON_LOCAL |
- IP_VS_RT_MODE_RDR, NULL, ipvsh);
+ IP_VS_RT_MODE_RDR, NULL, ipvsh, state);
if (local < 0)
goto tx_error;
rt = skb_rtable(skb);
@@ -869,7 +899,8 @@ ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
#ifdef CONFIG_IP_VS_IPV6
int
ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,
+ const struct nf_hook_state *state)
{
struct rt6_info *rt; /* Route to the other host */
int local, rc;
@@ -889,7 +920,7 @@ ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
NULL, ipvsh, 0,
IP_VS_RT_MODE_LOCAL |
IP_VS_RT_MODE_NON_LOCAL |
- IP_VS_RT_MODE_RDR);
+ IP_VS_RT_MODE_RDR, state);
if (local < 0)
goto tx_error;
rt = dst_rt6_info(skb_dst(skb));
@@ -1145,7 +1176,8 @@ ipvs_gre_encap(struct net *net, struct sk_buff *skb,
*/
int
ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,
+ const struct nf_hook_state *state)
{
struct netns_ipvs *ipvs = cp->ipvs;
struct net *net = ipvs->net;
@@ -1167,7 +1199,7 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
IP_VS_RT_MODE_LOCAL |
IP_VS_RT_MODE_NON_LOCAL |
IP_VS_RT_MODE_CONNECT |
- IP_VS_RT_MODE_TUNNEL, &saddr, ipvsh);
+ IP_VS_RT_MODE_TUNNEL, &saddr, ipvsh, state);
if (local < 0)
goto tx_error;
if (local)
@@ -1276,7 +1308,7 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
ret = ip_vs_tunnel_xmit_prepare(skb, cp);
if (ret == NF_ACCEPT)
- ip_local_out(net, skb->sk, skb);
+ ip_local_out(net, NULL, skb);
else if (ret == NF_DROP)
kfree_skb(skb);
@@ -1290,7 +1322,8 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
#ifdef CONFIG_IP_VS_IPV6
int
ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,
+ const struct nf_hook_state *state)
{
struct netns_ipvs *ipvs = cp->ipvs;
struct net *net = ipvs->net;
@@ -1312,7 +1345,7 @@ ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
&saddr, ipvsh, 1,
IP_VS_RT_MODE_LOCAL |
IP_VS_RT_MODE_NON_LOCAL |
- IP_VS_RT_MODE_TUNNEL);
+ IP_VS_RT_MODE_TUNNEL, state);
if (local < 0)
goto tx_error;
if (local)
@@ -1418,7 +1451,7 @@ ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
ret = ip_vs_tunnel_xmit_prepare(skb, cp);
if (ret == NF_ACCEPT)
- ip6_local_out(net, skb->sk, skb);
+ ip6_local_out(net, NULL, skb);
else if (ret == NF_DROP)
kfree_skb(skb);
@@ -1437,14 +1470,15 @@ ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
*/
int
ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,
+ const struct nf_hook_state *state)
{
int local;
local = __ip_vs_get_out_rt(cp->ipvs, cp->af, skb, cp->dest, cp->daddr.ip,
IP_VS_RT_MODE_LOCAL |
IP_VS_RT_MODE_NON_LOCAL |
- IP_VS_RT_MODE_KNOWN_NH, NULL, ipvsh);
+ IP_VS_RT_MODE_KNOWN_NH, NULL, ipvsh, state);
if (local < 0)
goto tx_error;
if (local)
@@ -1467,7 +1501,8 @@ ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
#ifdef CONFIG_IP_VS_IPV6
int
ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh)
+ struct ip_vs_protocol *pp, struct ip_vs_iphdr *ipvsh,
+ const struct nf_hook_state *state)
{
int local;
@@ -1476,7 +1511,7 @@ ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
NULL, ipvsh, 0,
IP_VS_RT_MODE_LOCAL |
IP_VS_RT_MODE_NON_LOCAL |
- IP_VS_RT_MODE_KNOWN_NH);
+ IP_VS_RT_MODE_KNOWN_NH, state);
if (local < 0)
goto tx_error;
if (local)
@@ -1503,7 +1538,7 @@ ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
int
ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
struct ip_vs_protocol *pp, unsigned int toff,
- unsigned int hooknum, struct ip_vs_iphdr *ciph)
+ const struct nf_hook_state *state, struct ip_vs_iphdr *ciph)
{
struct rtable *rt; /* Route to the other host */
int rc;
@@ -1517,7 +1552,7 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
translate address/port back */
if (IP_VS_FWD_METHOD(cp) != IP_VS_CONN_F_MASQ) {
if (cp->packet_xmit)
- rc = cp->packet_xmit(skb, cp, pp, ciph);
+ rc = cp->packet_xmit(skb, cp, pp, ciph, state);
else
rc = NF_ACCEPT;
/* do not touch skb anymore */
@@ -1531,11 +1566,11 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
was_input = rt_is_input_route(skb_rtable(skb));
/* LOCALNODE from FORWARD hook is not supported */
- rt_mode = (hooknum != NF_INET_FORWARD) ?
+ rt_mode = (state->hook != NF_INET_FORWARD) ?
IP_VS_RT_MODE_LOCAL | IP_VS_RT_MODE_NON_LOCAL |
IP_VS_RT_MODE_RDR : IP_VS_RT_MODE_NON_LOCAL;
- local = __ip_vs_get_out_rt(cp->ipvs, cp->af, skb, cp->dest, cp->daddr.ip, rt_mode,
- NULL, ciph);
+ local = __ip_vs_get_out_rt(cp->ipvs, cp->af, skb, cp->dest,
+ cp->daddr.ip, rt_mode, NULL, ciph, state);
if (local < 0)
goto tx_error;
rt = skb_rtable(skb);
@@ -1597,8 +1632,8 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
#ifdef CONFIG_IP_VS_IPV6
int
ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
- struct ip_vs_protocol *pp, unsigned int toff,
- unsigned int hooknum, struct ip_vs_iphdr *ciph)
+ struct ip_vs_protocol *pp, unsigned int toff,
+ const struct nf_hook_state *state, struct ip_vs_iphdr *ciph)
{
bool has_ports = false;
struct rt6_info *rt; /* Route to the other host */
@@ -1612,7 +1647,7 @@ ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
translate address/port back */
if (IP_VS_FWD_METHOD(cp) != IP_VS_CONN_F_MASQ) {
if (cp->packet_xmit)
- rc = cp->packet_xmit(skb, cp, pp, ciph);
+ rc = cp->packet_xmit(skb, cp, pp, ciph, state);
else
rc = NF_ACCEPT;
/* do not touch skb anymore */
@@ -1625,11 +1660,12 @@ ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
*/
/* LOCALNODE from FORWARD hook is not supported */
- rt_mode = (hooknum != NF_INET_FORWARD) ?
+ rt_mode = (state->hook != NF_INET_FORWARD) ?
IP_VS_RT_MODE_LOCAL | IP_VS_RT_MODE_NON_LOCAL |
IP_VS_RT_MODE_RDR : IP_VS_RT_MODE_NON_LOCAL;
local = __ip_vs_get_out_rt_v6(cp->ipvs, cp->af, skb, cp->dest,
- &cp->daddr.in6, NULL, ciph, 0, rt_mode);
+ &cp->daddr.in6, NULL, ciph, 0, rt_mode,
+ state);
if (local < 0)
goto tx_error;
rt = dst_rt6_info(skb_dst(skb));
|
| 23/3 | 2026/11/15 14:39 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 13939 output: 33 thoughts: 1776 Thoughts: **KMSAN Fuzzing Evaluation for IPVS Patch Series** Okay, let's break this down. My goal is to determine if this IPVS patch series warrants a dedicated KMSAN fuzzing session. I need to be meticulous, as my time is valuable and I don't want to waste resources. First, I see this patch touches several files within the IPVS subsystem. That's a reasonable scope to begin with. The files are mostly in the core and protocol-specific transmission paths. Good. I'm focused on what the patch *does* and if it introduces any new KMSAN-relevant vulnerabilities. The primary change I see is the modification of `maybe_update_pmtu`. This function is being updated to take a `const struct nf_hook_state *state` argument and uses data from it. I need to understand that `state` struct, where it comes from and if the patch introduces any new ways for it to be uninitialized. It looks like `state` comes from the netfilter hook callback functions (`ip_vs_in_hook`, `ip_vs_forward_icmp`). That means it’s initialized by the netfilter core itself, which is a good sign. The code is accessing `state->sk` as well. The check looks good. There is also a change to how `ip_local_out` is called, using a `NULL` socket. I need to confirm if this patch introduces any uninitialized memory issues based on KMSAN criteria. Specifically, I'm checking for cases where: 1. Kernel structures might be sent to user space with uninitialized fields. 2. Conditional logic or branching depends on uninitialized variables. 3. Complex data structures are allocated with potentially uninitialized fields that could be read later. 4. Bounds checks or logic might allow access to uninitialized bytes of existing buffers. Based on my analysis, `state->sk` is passed in as a pointer to a fully initialized `struct sock` (or NULL) from the netfilter core. No new buffers or allocations are being introduced. The calls to `ip_local_out` with a `NULL` socket don’t introduce uninitialized memory. It is replacing an existing call, so should be fine. The IPv6 fix for `ip_vs_null_xmit_v6` looks sound. The addition of the `state` pointer itself is the critical point. As far as I can see, `state` comes directly from the Netfilter hook infrastructure and is fully initialized before use. The patch modifies the existing flow by passing it down, not creating anything new. To be extra certain, I need to check every caller of `packet_xmit`, `conn_schedule`, and similar functions to make sure nothing untoward is happening – no calls are providing a mocked state or introducing a way for an uninitialized state to be passed. Let me fire up `grepper` and do that check... Okay, I've confirmed by searching for uses of `packet_xmit` in the codebase that I do not see any paths that look concerning. Therefore, after this careful review, I believe **this patch does NOT warrant a dedicated KMSAN fuzzing session.** It modifies existing control flow but does not introduce any risks related to uninitialized memory use or information leaks. We can mark it as clean in terms of KMSAN exposure, at least with the knowledge I currently have. |
| 24/3 | 2026/11/15 14:39 | tool | grepper |
0mArgs:{
"Expression": "packet_xmit",
"PathPrefixes": [
"net/netfilter/ipvs/"
]
}Results: {
"Output": "net/netfilter/ipvs/ip_vs_conn.c=896=static void conn_resize_work_handler(struct work_struct *work)\n--\nnet/netfilter/ipvs/ip_vs_conn.c-1019-/*\nnet/netfilter/ipvs/ip_vs_conn.c:1020: *\tBind a connection entry with the corresponding packet_xmit.\nnet/netfilter/ipvs/ip_vs_conn.c-1021- *\tCalled by ip_vs_conn_new.\n--\nnet/netfilter/ipvs/ip_vs_conn.c=1023=static inline void ip_vs_bind_xmit(struct ip_vs_conn *cp)\n--\nnet/netfilter/ipvs/ip_vs_conn.c-1026-\tcase IP_VS_CONN_F_MASQ:\nnet/netfilter/ipvs/ip_vs_conn.c:1027:\t\tcp-\u003epacket_xmit = ip_vs_nat_xmit;\nnet/netfilter/ipvs/ip_vs_conn.c-1028-\t\tbreak;\n--\nnet/netfilter/ipvs/ip_vs_conn.c-1032-\t\tif (cp-\u003edaf == AF_INET6)\nnet/netfilter/ipvs/ip_vs_conn.c:1033:\t\t\tcp-\u003epacket_xmit = ip_vs_tunnel_xmit_v6;\nnet/netfilter/ipvs/ip_vs_conn.c-1034-\t\telse\nnet/netfilter/ipvs/ip_vs_conn.c-1035-#endif\nnet/netfilter/ipvs/ip_vs_conn.c:1036:\t\t\tcp-\u003epacket_xmit = ip_vs_tunnel_xmit;\nnet/netfilter/ipvs/ip_vs_conn.c-1037-\t\tbreak;\n--\nnet/netfilter/ipvs/ip_vs_conn.c-1039-\tcase IP_VS_CONN_F_DROUTE:\nnet/netfilter/ipvs/ip_vs_conn.c:1040:\t\tcp-\u003epacket_xmit = ip_vs_dr_xmit;\nnet/netfilter/ipvs/ip_vs_conn.c-1041-\t\tbreak;\n--\nnet/netfilter/ipvs/ip_vs_conn.c-1043-\tcase IP_VS_CONN_F_LOCALNODE:\nnet/netfilter/ipvs/ip_vs_conn.c:1044:\t\tcp-\u003epacket_xmit = ip_vs_null_xmit;\nnet/netfilter/ipvs/ip_vs_conn.c-1045-\t\tbreak;\n--\nnet/netfilter/ipvs/ip_vs_conn.c-1047-\tcase IP_VS_CONN_F_BYPASS:\nnet/netfilter/ipvs/ip_vs_conn.c:1048:\t\tcp-\u003epacket_xmit = ip_vs_bypass_xmit;\nnet/netfilter/ipvs/ip_vs_conn.c-1049-\t\tbreak;\n--\nnet/netfilter/ipvs/ip_vs_conn.c=1054=static inline void ip_vs_bind_xmit_v6(struct ip_vs_conn *cp)\n--\nnet/netfilter/ipvs/ip_vs_conn.c-1057-\tcase IP_VS_CONN_F_MASQ:\nnet/netfilter/ipvs/ip_vs_conn.c:1058:\t\tcp-\u003epacket_xmit = ip_vs_nat_xmit_v6;\nnet/netfilter/ipvs/ip_vs_conn.c-1059-\t\tbreak;\n--\nnet/netfilter/ipvs/ip_vs_conn.c-1062-\t\tif (cp-\u003edaf == AF_INET6)\nnet/netfilter/ipvs/ip_vs_conn.c:1063:\t\t\tcp-\u003epacket_xmit = ip_vs_tunnel_xmit_v6;\nnet/netfilter/ipvs/ip_vs_conn.c-1064-\t\telse\nnet/netfilter/ipvs/ip_vs_conn.c:1065:\t\t\tcp-\u003epacket_xmit = ip_vs_tunnel_xmit;\nnet/netfilter/ipvs/ip_vs_conn.c-1066-\t\tbreak;\n--\nnet/netfilter/ipvs/ip_vs_conn.c-1068-\tcase IP_VS_CONN_F_DROUTE:\nnet/netfilter/ipvs/ip_vs_conn.c:1069:\t\tcp-\u003epacket_xmit = ip_vs_dr_xmit_v6;\nnet/netfilter/ipvs/ip_vs_conn.c-1070-\t\tbreak;\n--\nnet/netfilter/ipvs/ip_vs_conn.c-1072-\tcase IP_VS_CONN_F_LOCALNODE:\nnet/netfilter/ipvs/ip_vs_conn.c:1073:\t\tcp-\u003epacket_xmit = ip_vs_null_xmit_v6;\nnet/netfilter/ipvs/ip_vs_conn.c-1074-\t\tbreak;\n--\nnet/netfilter/ipvs/ip_vs_conn.c-1076-\tcase IP_VS_CONN_F_BYPASS:\nnet/netfilter/ipvs/ip_vs_conn.c:1077:\t\tcp-\u003epacket_xmit = ip_vs_bypass_xmit_v6;\nnet/netfilter/ipvs/ip_vs_conn.c-1078-\t\tbreak;\n--\nnet/netfilter/ipvs/ip_vs_conn.c=1170=void ip_vs_try_bind_dest(struct ip_vs_conn *cp)\n--\nnet/netfilter/ipvs/ip_vs_conn.c-1202-\t\t/* Update its packet transmitter */\nnet/netfilter/ipvs/ip_vs_conn.c:1203:\t\tcp-\u003epacket_xmit = NULL;\nnet/netfilter/ipvs/ip_vs_conn.c-1204-#ifdef CONFIG_IP_VS_IPV6\n--\nnet/netfilter/ipvs/ip_vs_conn.c=1447=ip_vs_conn_new(const struct ip_vs_conn_param *p, int dest_af,\n--\nnet/netfilter/ipvs/ip_vs_conn.c-1512-\nnet/netfilter/ipvs/ip_vs_conn.c:1513:\tcp-\u003epacket_xmit = NULL;\nnet/netfilter/ipvs/ip_vs_conn.c-1514-\tcp-\u003eapp = NULL;\n--\nnet/netfilter/ipvs/ip_vs_core.c=762=int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,\n--\nnet/netfilter/ipvs/ip_vs_core.c-808-\t\t/* transmit the first SYN packet */\nnet/netfilter/ipvs/ip_vs_core.c:809:\t\tret = cp-\u003epacket_xmit(skb, cp, pd-\u003epp, iph, state);\nnet/netfilter/ipvs/ip_vs_core.c-810-\t\t/* do not touch skb anymore */\n--\nnet/netfilter/ipvs/ip_vs_core.c=2108=ip_vs_in_hook(void *priv, struct sk_buff *skb, const struct nf_hook_state *state)\n--\nnet/netfilter/ipvs/ip_vs_core.c-2265-\tip_vs_set_state(cp, IP_VS_DIR_INPUT, skb, pd, iph.len);\nnet/netfilter/ipvs/ip_vs_core.c:2266:\tif (cp-\u003epacket_xmit)\nnet/netfilter/ipvs/ip_vs_core.c:2267:\t\tret = cp-\u003epacket_xmit(skb, cp, pp, \u0026iph, state);\nnet/netfilter/ipvs/ip_vs_core.c-2268-\t\t/* do not touch skb anymore */\nnet/netfilter/ipvs/ip_vs_core.c-2269-\telse {\nnet/netfilter/ipvs/ip_vs_core.c:2270:\t\tIP_VS_DBG_RL(\"warning: packet_xmit is null\");\nnet/netfilter/ipvs/ip_vs_core.c-2271-\t\tret = NF_ACCEPT;\n--\nnet/netfilter/ipvs/ip_vs_xmit.c=1539=ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,\n--\nnet/netfilter/ipvs/ip_vs_xmit.c-1553-\tif (IP_VS_FWD_METHOD(cp) != IP_VS_CONN_F_MASQ) {\nnet/netfilter/ipvs/ip_vs_xmit.c:1554:\t\tif (cp-\u003epacket_xmit)\nnet/netfilter/ipvs/ip_vs_xmit.c:1555:\t\t\trc = cp-\u003epacket_xmit(skb, cp, pp, ciph, state);\nnet/netfilter/ipvs/ip_vs_xmit.c-1556-\t\telse\n--\nnet/netfilter/ipvs/ip_vs_xmit.c=1634=ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,\n--\nnet/netfilter/ipvs/ip_vs_xmit.c-1648-\tif (IP_VS_FWD_METHOD(cp) != IP_VS_CONN_F_MASQ) {\nnet/netfilter/ipvs/ip_vs_xmit.c:1649:\t\tif (cp-\u003epacket_xmit)\nnet/netfilter/ipvs/ip_vs_xmit.c:1650:\t\t\trc = cp-\u003epacket_xmit(skb, cp, pp, ciph, state);\nnet/netfilter/ipvs/ip_vs_xmit.c-1651-\t\telse\n"
} |
| 25/3 | 2026/11/15 14:39 | llm | kmsan-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 19030 output: 240 thoughts: 697 Thoughts: **My Assessment of the IPVS Path MTU Update Fixes** Okay, let's break this down. My focus here is on ensuring memory safety, particularly in the context of these IPVS transmission path updates. I've examined the code concerning `packet_xmit` and the `maybe_update_pmtu` function. It seems all instances of `packet_xmit` are confined within `ip_vs_core.c` and `ip_vs_xmit.c`, obtaining the `state` directly from `ip_vs_in_hook` or `ip_vs_forward_icmp`. Specifically, I've re-evaluated `maybe_update_pmtu`. The changes here are significant: the previous implementation used `skb->sk` and `skb_rtable(skb)` for Path MTU updates, but this has been replaced with `state->sk`, along with checks for `sk->sk_state == TCP_ESTABLISHED`, `state->hook == NF_INET_LOCAL_OUT`, and `sk->sk_family == dst->ops->family`, and also it passes `false` instead of `true`. These seem to be valid improvements. I've also noted that the IPv6 localnode fix in `ip_vs_conn.c` changing `cp->packet_xmit` to `ip_vs_null_xmit_v6` and the changes in `ip_vs_tunnel_xmit` and `ip_vs_tunnel_xmit_v6`, which now pass NULL to `ip_local_out` instead of `skb->sk`. My critical question is always about memory safety: do any of these changes introduce uninitialized memory issues, expose uninitialized memory to userspace, or depend on uninitialized variables? I've scrutinized this carefully and I'm confident that the answer is "no". There are no new uninitialized variables introduced, nor are there any uninitialized structure fields read. There's no data copying to user space that could be a concern. Furthermore, there are no memory allocations or buffer manipulations that could leave memory in an undefined state. This leads me to the conclusion that KMSAN (Kernel Memory Sanitizer) is not required for this specific patch. Standard KASAN (Kernel Address Sanitizer) and LOCKDEP builds should adequately cover any memory safety concerns. This means we should be fine with the standard suite of checks for potential NULL pointer dereferences, socket refcounting problems, and issues with dereferencing `dst` entries, and so on. Therefore, I'm comfortable moving forward and will now invoke the `set-results` tool. |
| 26/3 | 2026/11/15 14:39 | tool | set-results |
0mArgs:{
"KMSANReasoning": "The patch series updates IPVS (IP Virtual Server) packet transmission paths to properly handle Path MTU (PMTU) updates by passing the Netfilter hook state (`nf_hook_state`) down to `maybe_update_pmtu()` and packet transmitter functions, fixing IPv6 localnode transmitter binding, and passing NULL socket to `ip_local_out`/`ip6_local_out` during tunnel transmission.\n\nThese changes involve passing an existing fully-initialized hook state pointer from the netfilter core down the call stack, updating PMTU condition checks, and binding the appropriate transmitter function. The patch introduces no memory allocations, no reads of uninitialized stack or heap variables, no modifications to kernel-to-user data copies, and no changes to data length or buffer boundaries that could expose uninitialized memory. Any potential issues introduced by these changes (such as NULL pointer dereferences or socket state issues) are covered by standard kernel sanitizers (KASAN, standard bug checks). Therefore, a dedicated KMSAN fuzzing session is not warranted.",
"NeedsKMSAN": false
}Results: {
"KMSANReasoning": "The patch series updates IPVS (IP Virtual Server) packet transmission paths to properly handle Path MTU (PMTU) updates by passing the Netfilter hook state (`nf_hook_state`) down to `maybe_update_pmtu()` and packet transmitter functions, fixing IPv6 localnode transmitter binding, and passing NULL socket to `ip_local_out`/`ip6_local_out` during tunnel transmission.\n\nThese changes involve passing an existing fully-initialized hook state pointer from the netfilter core down the call stack, updating PMTU condition checks, and binding the appropriate transmitter function. The patch introduces no memory allocations, no reads of uninitialized stack or heap variables, no modifications to kernel-to-user data copies, and no changes to data length or buffer boundaries that could expose uninitialized memory. Any potential issues introduced by these changes (such as NULL pointer dereferences or socket state issues) are covered by standard kernel sanitizers (KASAN, standard bug checks). Therefore, a dedicated KMSAN fuzzing session is not warranted.",
"NeedsKMSAN": false
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|