AI Trajectory


Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/09/02 09:14 flow patch-triage
9m Args:
null

Results:
{
  "EnableConfigs": [
    "INET",
    "IPV6"
  ],
  "FocusSymbols": [
    "ip_append_data",
    "ip_make_skb",
    "ip6_append_data",
    "ip6_make_skb",
    "ip6_mtu",
    "ip6_forward"
  ],
  "KMSANReasoning": "The patch clamps the MTU and cork fragmentation size to IP_MAX_MTU (IPv4) and IP6_MAX_MTU (IPv6) in `ip_setup_cork`, `ip6_setup_cork`, and `ip6_dst_mtu_maybe_forward`, alongside adding a selftest. This prevents integer overflow of the 16-bit UDP header length field when network devices are configured with very large MTU values (\u003e 65535).\n\nKMSAN is designed to detect reads of uninitialized memory and information leaks to user space. This patch does not allocate new memory buffers, alter structure initialization/padding, change user-space copy logic, or introduce branches depending on uninitialized variables. Clamping MTU values ensures packet length bounds stay within protocol limits. Consequently, there are no uninitialized memory risks, and a dedicated KMSAN fuzzing session is not warranted.",
  "NeedsKMSAN": false,
  "Reasoning": "The patch enforces MTU limits (IP_MAX_MTU / IP6_MAX_MTU) during corking and IPv6 destination MTU lookup in IPv4 and IPv6 output paths (ip_setup_cork, ip6_setup_cork, ip6_dst_mtu_maybe_forward) to prevent 16-bit UDP datagram length overflow. This alters functional packet corking and route MTU handling in core networking code.",
  "WorthFuzzing": true
}

1/1 2026/09/02 09:14 action read-patch-diff
0m Args:
null

Results:
{
  "PatchDiff": "commit 4192f843c78d10676badb369a0c641aefefa71fc\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate:   Wed Sep 2 09:14:06 2026 +0000\n\n    syz-cluster: applied patch under review\n\ndiff --git a/include/net/ip6_route.h b/include/net/ip6_route.h\nindex c69f1c8719223..b9e8d2b759e9b 100644\n--- a/include/net/ip6_route.h\n+++ b/include/net/ip6_route.h\n@@ -384,6 +384,8 @@ static inline unsigned int ip6_dst_mtu_maybe_forward(const struct dst_entry *dst\n \trcu_read_unlock();\n \n out:\n+\tmtu = min_t(unsigned int, mtu, IP6_MAX_MTU);\n+\n \treturn mtu - lwtunnel_headroom(dst-\u003elwtstate, mtu);\n }\n \ndiff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c\nindex 74e095b6b7ca0..a24cc8ee11d3e 100644\n--- a/net/ipv4/ip_output.c\n+++ b/net/ipv4/ip_output.c\n@@ -1303,6 +1303,7 @@ static int ip_setup_cork(struct sock *sk, struct inet_cork *cork,\n \n \tcork-\u003efragsize = ip_sk_use_pmtu(sk) ?\n \t\t\t dst4_mtu(\u0026rt-\u003edst) : READ_ONCE(rt-\u003edst.dev-\u003emtu);\n+\tcork-\u003efragsize = min(cork-\u003efragsize, IP_MAX_MTU);\n \n \tif (!inetdev_valid_mtu(cork-\u003efragsize))\n \t\treturn -ENETUNREACH;\ndiff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c\nindex 8fc4766c8da90..5509650589915 100644\n--- a/net/ipv6/ip6_output.c\n+++ b/net/ipv6/ip6_output.c\n@@ -1432,6 +1432,8 @@ static int ip6_setup_cork(struct sock *sk, struct inet_cork_full *cork,\n \tif (frag_size \u0026\u0026 frag_size \u003c mtu)\n \t\tmtu = frag_size;\n \n+\tif (sk_is_udp(sk))\n+\t\tmtu = min(mtu, IP6_MAX_MTU);\n \tcork-\u003ebase.fragsize = mtu;\n \tcork-\u003ebase.gso_size = ipc6-\u003egso_size;\n \tcork-\u003ebase.tx_flags = 0;\ndiff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile\nindex 517c09d60bef7..3ee3378f8b26e 100644\n--- a/tools/testing/selftests/net/Makefile\n+++ b/tools/testing/selftests/net/Makefile\n@@ -25,6 +25,7 @@ TEST_PROGS := \\\n \tcmsg_so_mark.sh \\\n \tcmsg_so_priority.sh \\\n \tcmsg_time.sh \\\n+\tcork_fragsize.py \\\n \tdouble_udp_encap.sh \\\n \tdrop_monitor_tests.sh \\\n \tecmp_rehash.sh \\\ndiff --git a/tools/testing/selftests/net/cork_fragsize.py b/tools/testing/selftests/net/cork_fragsize.py\nnew file mode 100755\nindex 0000000000000..7afd643d07ec2\n--- /dev/null\n+++ b/tools/testing/selftests/net/cork_fragsize.py\n@@ -0,0 +1,187 @@\n+#!/usr/bin/env python3\n+# SPDX-License-Identifier: GPL-2.0\n+\n+'''Test possible UDP length overflow in udp_send_skb/udp_v6_send_skb.'''\n+\n+import errno\n+import gzip\n+import os\n+import socket\n+import struct\n+import subprocess\n+from contextlib import contextmanager\n+\n+from lib.py import (\n+    KsftNamedVariant,\n+    KsftSkipEx,\n+    NetNS,\n+    NetNSEnter,\n+    defer,\n+    ip,\n+    ksft_eq,\n+    ksft_exit,\n+    ksft_pr,\n+    ksft_raises,\n+    ksft_run,\n+    ksft_true,\n+    ksft_variants,\n+)\n+\n+IP_MTU_DISCOVER = 10\n+IP_PMTUDISC_PROBE = 3\n+IPV6_MTU_DISCOVER = 23\n+IPV6_PMTUDISC_DO = 2\n+IPV6_PMTUDISC_PROBE = 3\n+IPV6_TLV_JUMBO = 194\n+\n+\n+def check_kernel_config(option: str) -\u003e bool | None:\n+    '''\n+    Check whether the option is enabled in the config of the running kernel.\n+    Returns None if the config is not found; otherwise returns True/False\n+    depending on the option value in the config.\n+    '''\n+\n+    for filename, method in [\n+        ('/proc/config.gz', gzip.open),\n+        (f'/boot/config-{os.uname().release}', open),\n+    ]:\n+        try:\n+            with method(filename, 'rt') as config:\n+                for line in config:\n+                    if line.rstrip() == f'{option}=y':\n+                        return True\n+                return False\n+        except OSError:\n+            continue\n+        return None\n+\n+\n+def assert_debug_kernel() -\u003e None:\n+    '''\n+    Skip the test if CONFIG_DEBUG_NET is not set in the kernel config.\n+    '''\n+\n+    res = check_kernel_config('CONFIG_DEBUG_NET')\n+    if res is None:\n+        ksft_pr(\"WARN: Can't read kernel config; assuming debug kernel, and running the test\")\n+    elif not res:\n+        raise KsftSkipEx('CONFIG_DEBUG_NET is not set')\n+\n+\n+def check_dmesg_clean(func: str) -\u003e bool:\n+    '''\n+    Check if the given function produced a WARN in dmesg.\n+    '''\n+\n+    with subprocess.Popen(['dmesg'], stdout=subprocess.PIPE) as dmesg:\n+        res = subprocess.run(['grep', '-q', f'WARNING:.*{func}'], stdin=dmesg.stdout, check=False)\n+    return res.returncode != 0 and dmesg.returncode == 0\n+\n+\n+@contextmanager\n+def dummy_netdev(ns: NetNS, mtu: int, ipv6: bool) -\u003e None:\n+    '''\n+    Create a dummy netdev inside the given namespace, and tune it for the test.\n+    '''\n+\n+    ip('link add dummy type dummy', ns=ns)\n+    with defer(ip, 'link del dummy', ns=ns):\n+        ip(f'link set dummy mtu {mtu}', ns=ns)\n+        ip('link set dummy up', ns=ns)\n+        flag = '-6' if ipv6 else ''\n+        nodad = 'nodad' if ipv6 else ''\n+        local = 'fd00::1/64' if ipv6 else '10.0.0.1/24'\n+        remote = 'fd00::2' if ipv6 else '10.0.0.2'\n+        ip(f'{flag} addr add {local} dev dummy {nodad}', ns=ns)\n+        ip(f'{flag} neigh add {remote} lladdr 02:00:00:00:00:02 dev dummy nud permanent', ns=ns)\n+        yield\n+\n+\n+@ksft_variants([\n+    KsftNamedVariant(\n+        'ipv6',\n+        True,\n+        socket.AF_INET6,\n+        (socket.IPPROTO_IPV6, IPV6_MTU_DISCOVER, IPV6_PMTUDISC_DO),\n+        'fd00::2',\n+        'udp_v6_send_skb',\n+    ),\n+    KsftNamedVariant(\n+        'ipv4',\n+        False,\n+        socket.AF_INET,\n+        (socket.IPPROTO_IP, IP_MTU_DISCOVER, IP_PMTUDISC_PROBE),\n+        '10.0.0.2',\n+        'udp_send_skb',\n+    ),\n+])\n+def test_udp(\n+    ipv6: bool,\n+    af: socket.AddressFamily,\n+    sockopts: tuple[int, int, int],\n+    destip: str,\n+    func: str\n+) -\u003e None:\n+    '''\n+    Test that sending an oversized UDP packet over a UDP socket doesn't overflow\n+    the 16-bit length field in the UDP header, which could happen on older\n+    kernels in udp_send_skb/udp_v6_send_skb.\n+\n+    IPv4: The packet will be dropped with EMSGSIZE, but the overflow could\n+    happen before it happens. The only way to test this is to check dmesg on\n+    CONFIG_DEBUG_NET=y kernels that have udp_set_len_short with the warning.\n+\n+    IPv6: The packet will be dropped with EMSGSIZE on fixed kernels, and will be\n+    sent corrupted on older kernels. Test both: sendto must return EMSGSIZE, and\n+    dmesg must be clean of warnings on CONFIG_DEBUG_NET=y kernels.\n+    '''\n+\n+    if not ipv6:\n+        assert_debug_kernel()\n+\n+    with (\n+        NetNS() as ns,\n+        dummy_netdev(ns, 65556 + 20 * ipv6, ipv6),\n+        NetNSEnter(ns),\n+        socket.socket(af, socket.SOCK_DGRAM) as fd,\n+    ):\n+        fd.setsockopt(*sockopts)\n+        with ksft_raises(OSError) as e:\n+            fd.sendto(b' ' * 65528, (destip, 1234))\n+        # IPv6: EMSGSIZE happens on kernels with the fix.\n+        # IPv4: EMSGSIZE happens on both fixed and unfixed kernels, after the\n+        #       WARN is printed - ignore it and rely on the dmesg check.\n+        if e.exception is not None:\n+            ksft_eq(e.exception.errno, errno.EMSGSIZE)\n+\n+    ksft_true(check_dmesg_clean(func), 'WARNING detected in dmesg')\n+\n+\n+def test_ipv6_jumbo() -\u003e None:\n+    '''\n+    Test that sending UDP jumbograms over a raw IPv6 socket works, despite\n+    having the fix for oversized UDP packets. sendto must not raise an OSError\n+    exception (when raised, the test fails automatically).\n+    '''\n+\n+    with (\n+        NetNS() as ns,\n+        dummy_netdev(ns, 65584, True),\n+        NetNSEnter(ns),\n+        socket.socket(socket.AF_INET6, socket.SOCK_RAW, socket.IPPROTO_UDP) as fd,\n+    ):\n+        hopopts = struct.pack('!BBBBI', 0, 0, IPV6_TLV_JUMBO, 4, 65544)\n+        fd.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_HOPOPTS, hopopts)\n+        fd.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_CHECKSUM, 6)\n+        fd.setsockopt(socket.IPPROTO_IPV6, IPV6_MTU_DISCOVER, IPV6_PMTUDISC_PROBE)\n+        udp = struct.pack('!HHHH', 1234, 1234, 0, 0) + b' ' * 65528\n+        fd.sendto(udp, ('fd00::2', 0))\n+\n+\n+if __name__ == \"__main__\":\n+    ksft_run([\n+        test_udp,\n+        test_ipv6_jumbo,\n+    ])\n+    ksft_exit()\n"
}

2/1 2026/09/02 09:14 agent patch-evaluator
6m Model:
core

Args:
null

Results:
{
  "EnableConfigs": [
    "INET",
    "IPV6"
  ],
  "FocusSymbols": [
    "ip_append_data",
    "ip_make_skb",
    "ip6_append_data",
    "ip6_make_skb",
    "ip6_mtu",
    "ip6_forward"
  ],
  "Reasoning": "The patch enforces MTU limits (IP_MAX_MTU / IP6_MAX_MTU) during corking and IPv6 destination MTU lookup in IPv4 and IPv6 output paths (ip_setup_cork, ip6_setup_cork, ip6_dst_mtu_maybe_forward) to prevent 16-bit UDP datagram length overflow. This alters functional packet corking and route MTU handling in core networking code.",
  "WorthFuzzing": true
}

Instruction:
You are an expert Linux kernel maintainer.
Your job is to review a provided patch series and determine
if it makes functional changes to the kernel that should be fuzzed.

IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on your internal knowledge of the kernel. You must actively
use your code access tools to examine the actual source code and confirm any assumptions.

Return WorthFuzzing=false if the patch only contains:
- Modifications to Documentation/, Kconfig files, or code comments.
- Purely decorative changes, such as logging (e.g., pr_err, printk) or tracepoints.
- Changes to numeric constants or macros that do not functionally alter execution flow.
- Code paths that are impossible to reach in virtualized environments like GCE or QEMU,
  even when utilizing software-emulated hardware (e.g., usb gadget, mac80211_hwsim).
- Code in vendor-specific PCIe switch, SmartNIC, or GPU drivers (e.g., mlxsw, pds_core, qed,
  ionic, amdgpu) that require physical PCIe hardware cards not emulated in standard QEMU.
- Driver .remove, .shutdown, or pci_unregister_driver teardown callbacks (e.g., igb_remove)
  that are executed only during PCI hot-unplug or sysfs driver unbind operations.

If it modifies reachable core kernel logic, drivers, or architectures, use your code search
tools to verify the code can be executed, then return WorthFuzzing=true.

When returning WorthFuzzing=true, you MUST ALSO:
1. Extract any specific kernel functions that should be heavily fuzzed into FocusSymbols.
   Avoid listing generic hot-path functions to prevent skewed test distributions.
   Prefer non-static, non-inlined API entrypoint functions over internal static helper functions
   (which are inlined by the compiler and do not have distinct symbol addresses).
2. Identify any specific CONFIG_ options required to properly test this new/modified feature.
   Go and look into the Kconfig files and check for ifdefs around the code, do not make assumptions.
   Also check "depends on" lines in Kconfig to include any non-standard parent subsystem configs
   needed for Kbuild to compile the code statically into vmlinux. List them in the EnableConfigs
   output array, and DO NOT add a 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.


Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.

Prompt:
For your convenience, here is the diff of the changes:
commit 4192f843c78d10676badb369a0c641aefefa71fc
Author: syz-cluster <triage@syzkaller.com>
Date:   Wed Sep 2 09:14:06 2026 +0000

    syz-cluster: applied patch under review

diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index c69f1c8719223..b9e8d2b759e9b 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -384,6 +384,8 @@ static inline unsigned int ip6_dst_mtu_maybe_forward(const struct dst_entry *dst
 	rcu_read_unlock();
 
 out:
+	mtu = min_t(unsigned int, mtu, IP6_MAX_MTU);
+
 	return mtu - lwtunnel_headroom(dst->lwtstate, mtu);
 }
 
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 74e095b6b7ca0..a24cc8ee11d3e 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1303,6 +1303,7 @@ static int ip_setup_cork(struct sock *sk, struct inet_cork *cork,
 
 	cork->fragsize = ip_sk_use_pmtu(sk) ?
 			 dst4_mtu(&rt->dst) : READ_ONCE(rt->dst.dev->mtu);
+	cork->fragsize = min(cork->fragsize, IP_MAX_MTU);
 
 	if (!inetdev_valid_mtu(cork->fragsize))
 		return -ENETUNREACH;
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 8fc4766c8da90..5509650589915 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1432,6 +1432,8 @@ static int ip6_setup_cork(struct sock *sk, struct inet_cork_full *cork,
 	if (frag_size && frag_size < mtu)
 		mtu = frag_size;
 
+	if (sk_is_udp(sk))
+		mtu = min(mtu, IP6_MAX_MTU);
 	cork->base.fragsize = mtu;
 	cork->base.gso_size = ipc6->gso_size;
 	cork->base.tx_flags = 0;
diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
index 517c09d60bef7..3ee3378f8b26e 100644
--- a/tools/testing/selftests/net/Makefile
+++ b/tools/testing/selftests/net/Makefile
@@ -25,6 +25,7 @@ TEST_PROGS := \
 	cmsg_so_mark.sh \
 	cmsg_so_priority.sh \
 	cmsg_time.sh \
+	cork_fragsize.py \
 	double_udp_encap.sh \
 	drop_monitor_tests.sh \
 	ecmp_rehash.sh \
diff --git a/tools/testing/selftests/net/cork_fragsize.py b/tools/testing/selftests/net/cork_fragsize.py
new file mode 100755
index 0000000000000..7afd643d07ec2
--- /dev/null
+++ b/tools/testing/selftests/net/cork_fragsize.py
@@ -0,0 +1,187 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: GPL-2.0
+
+'''Test possible UDP length overflow in udp_send_skb/udp_v6_send_skb.'''
+
+import errno
+import gzip
+import os
+import socket
+import struct
+import subprocess
+from contextlib import contextmanager
+
+from lib.py import (
+    KsftNamedVariant,
+    KsftSkipEx,
+    NetNS,
+    NetNSEnter,
+    defer,
+    ip,
+    ksft_eq,
+    ksft_exit,
+    ksft_pr,
+    ksft_raises,
+    ksft_run,
+    ksft_true,
+    ksft_variants,
+)
+
+IP_MTU_DISCOVER = 10
+IP_PMTUDISC_PROBE = 3
+IPV6_MTU_DISCOVER = 23
+IPV6_PMTUDISC_DO = 2
+IPV6_PMTUDISC_PROBE = 3
+IPV6_TLV_JUMBO = 194
+
+
+def check_kernel_config(option: str) -> bool | None:
+    '''
+    Check whether the option is enabled in the config of the running kernel.
+    Returns None if the config is not found; otherwise returns True/False
+    depending on the option value in the config.
+    '''
+
+    for filename, method in [
+        ('/proc/config.gz', gzip.open),
+        (f'/boot/config-{os.uname().release}', open),
+    ]:
+        try:
+            with method(filename, 'rt') as config:
+                for line in config:
+                    if line.rstrip() == f'{option}=y':
+                        return True
+                return False
+        except OSError:
+            continue
+        return None
+
+
+def assert_debug_kernel() -> None:
+    '''
+    Skip the test if CONFIG_DEBUG_NET is not set in the kernel config.
+    '''
+
+    res = check_kernel_config('CONFIG_DEBUG_NET')
+    if res is None:
+        ksft_pr("WARN: Can't read kernel config; assuming debug kernel, and running the test")
+    elif not res:
+        raise KsftSkipEx('CONFIG_DEBUG_NET is not set')
+
+
+def check_dmesg_clean(func: str) -> bool:
+    '''
+    Check if the given function produced a WARN in dmesg.
+    '''
+
+    with subprocess.Popen(['dmesg'], stdout=subprocess.PIPE) as dmesg:
+        res = subprocess.run(['grep', '-q', f'WARNING:.*{func}'], stdin=dmesg.stdout, check=False)
+    return res.returncode != 0 and dmesg.returncode == 0
+
+
+@contextmanager
+def dummy_netdev(ns: NetNS, mtu: int, ipv6: bool) -> None:
+    '''
+    Create a dummy netdev inside the given namespace, and tune it for the test.
+    '''
+
+    ip('link add dummy type dummy', ns=ns)
+    with defer(ip, 'link del dummy', ns=ns):
+        ip(f'link set dummy mtu {mtu}', ns=ns)
+        ip('link set dummy up', ns=ns)
+        flag = '-6' if ipv6 else ''
+        nodad = 'nodad' if ipv6 else ''
+        local = 'fd00::1/64' if ipv6 else '10.0.0.1/24'
+        remote = 'fd00::2' if ipv6 else '10.0.0.2'
+        ip(f'{flag} addr add {local} dev dummy {nodad}', ns=ns)
+        ip(f'{flag} neigh add {remote} lladdr 02:00:00:00:00:02 dev dummy nud permanent', ns=ns)
+        yield
+
+
+@ksft_variants([
+    KsftNamedVariant(
+        'ipv6',
+        True,
+        socket.AF_INET6,
+        (socket.IPPROTO_IPV6, IPV6_MTU_DISCOVER, IPV6_PMTUDISC_DO),
+        'fd00::2',
+        'udp_v6_send_skb',
+    ),
+    KsftNamedVariant(
+        'ipv4',
+        False,
+        socket.AF_INET,
+        (socket.IPPROTO_IP, IP_MTU_DISCOVER, IP_PMTUDISC_PROBE),
+        '10.0.0.2',
+        'udp_send_skb',
+    ),
+])
+def test_udp(
+    ipv6: bool,
+    af: socket.AddressFamily,
+    sockopts: tuple[int, int, int],
+    destip: str,
+    func: str
+) -> None:
+    '''
+    Test that sending an oversized UDP packet over a UDP socket doesn't overflow
+    the 16-bit length field in the UDP header, which could happen on older
+    kernels in udp_send_skb/udp_v6_send_skb.
+
+    IPv4: The packet will be dropped with EMSGSIZE, but the overflow could
+    happen before it happens. The only way to test this is to check dmesg on
+    CONFIG_DEBUG_NET=y kernels that have udp_set_len_short with the warning.
+
+    IPv6: The packet will be dropped with EMSGSIZE on fixed kernels, and will be
+    sent corrupted on older kernels. Test both: sendto must return EMSGSIZE, and
+    dmesg must be clean of warnings on CONFIG_DEBUG_NET=y kernels.
+    '''
+
+    if not ipv6:
+        assert_debug_kernel()
+
+    with (
+        NetNS() as ns,
+        dummy_netdev(ns, 65556 + 20 * ipv6, ipv6),
+        NetNSEnter(ns),
+        socket.socket(af, socket.SOCK_DGRAM) as fd,
+    ):
+        fd.setsockopt(*sockopts)
+        with ksft_raises(OSError) as e:
+            fd.sendto(b' ' * 65528, (destip, 1234))
+        # IPv6: EMSGSIZE happens on kernels with the fix.
+        # IPv4: EMSGSIZE happens on both fixed and unfixed kernels, after the
+        #       WARN is printed - ignore it and rely on the dmesg check.
+        if e.exception is not None:
+            ksft_eq(e.exception.errno, errno.EMSGSIZE)
+
+    ksft_true(check_dmesg_clean(func), 'WARNING detected in dmesg')
+
+
+def test_ipv6_jumbo() -> None:
+    '''
+    Test that sending UDP jumbograms over a raw IPv6 socket works, despite
+    having the fix for oversized UDP packets. sendto must not raise an OSError
+    exception (when raised, the test fails automatically).
+    '''
+
+    with (
+        NetNS() as ns,
+        dummy_netdev(ns, 65584, True),
+        NetNSEnter(ns),
+        socket.socket(socket.AF_INET6, socket.SOCK_RAW, socket.IPPROTO_UDP) as fd,
+    ):
+        hopopts = struct.pack('!BBBBI', 0, 0, IPV6_TLV_JUMBO, 4, 65544)
+        fd.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_HOPOPTS, hopopts)
+        fd.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_CHECKSUM, 6)
+        fd.setsockopt(socket.IPPROTO_IPV6, IPV6_MTU_DISCOVER, IPV6_PMTUDISC_PROBE)
+        udp = struct.pack('!HHHH', 1234, 1234, 0, 0) + b' ' * 65528
+        fd.sendto(udp, ('fd00::2', 0))
+
+
+if __name__ == "__main__":
+    ksft_run([
+        test_udp,
+        test_ipv6_jumbo,
+    ])
+    ksft_exit()

3/2 2026/09/02 09:14 llm patch-evaluator
1m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 4987
							output: 36
							thoughts: 258
						

Thoughts:
**My Initial Assessment of the Patch**

Okay, so the user wants me to take a look at this patch and decide if it introduces any new functional areas that warrant fuzzing. Let's dive in. Based on the file modifications, it looks like it focuses on MTU (Maximum Transmission Unit) calculations and potentially UDP fragmentation, specifically within IPv4 and IPv6 network stacks. I see changes in `ip6_dst_mtu_maybe_forward`, `ip_setup_cork`, and `ip6_setup_cork`, which are all code paths that might involve crucial network performance and reliability considerations. The inclusion of `cork_fragsize.py` in the selftests raises a red flag in a good way -- they're testing, but are they testing the right thing?

Before I jump to a fuzzing decision, it's crucial to understand the *context* of these changes. I need to know *why* these `min()` constraints are being added. Are they bug fixes? Performance optimizations? Security hardening? It could be all of those things. I'll need to examine the surrounding code and possibly related commit messages to understand the rationale behind these changes. I'll need to use read-file and grepper to get the full picture. My initial impression is that these changes, particularly if they influence fragmentation behavior, could *absolutely* be worth fuzzing, but I need more information to be sure. It depends on whether these `min()` constraints are clamping down on unexpected sizes, or enabling some new network path or feature that could reveal new fuzzing vectors.



4/2 2026/09/02 09:15 tool grepper
0m Args:
{
  "Expression": "ip_setup_cork",
  "PathPrefix": "net/ipv4/ip_output.c"
}

Results:
{
  "Output": "net/ipv4/ip_output.c=953=static int __ip_append_data(struct sock *sk,\n--\nnet/ipv4/ip_output.c-1293-\nnet/ipv4/ip_output.c:1294:static int ip_setup_cork(struct sock *sk, struct inet_cork *cork,\nnet/ipv4/ip_output.c-1295-\t\t\t struct ipcm_cookie *ipc, struct rtable **rtp)\n--\nnet/ipv4/ip_output.c=1360=int ip_append_data(struct sock *sk, struct flowi4 *fl4,\n--\nnet/ipv4/ip_output.c-1373-\tif (skb_queue_empty(\u0026sk-\u003esk_write_queue)) {\nnet/ipv4/ip_output.c:1374:\t\terr = ip_setup_cork(sk, \u0026inet-\u003ecork.base, ipc, rtp);\nnet/ipv4/ip_output.c-1375-\t\tif (err)\n--\nnet/ipv4/ip_output.c=1554=struct sk_buff *ip_make_skb(struct sock *sk,\n--\nnet/ipv4/ip_output.c-1572-\tcork-\u003eopt = NULL;\nnet/ipv4/ip_output.c:1573:\terr = ip_setup_cork(sk, cork, ipc, rtp);\nnet/ipv4/ip_output.c-1574-\tif (err)\n"
}

5/2 2026/09/02 09:15 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 6009
							output: 39
							thoughts: 42
						

Thoughts:
Here's my summary, as if I were thinking these thoughts:

**Diving Deep into IP Output**

Alright, time to get my hands dirty. I need to refresh my understanding of the IP output paths, so I'm going to dig into the kernel source. Specifically, I want to re-examine how packets get built and sent at the IP layer. I'll start with the IPv4 and IPv6 output routines, so I'm pulling up `net/ipv4/ip_output.c` and `net/ipv6/ip6_output.c`. I expect to see the core logic for fragmentation, checksum calculations, header construction, and interaction with the lower layers (e.g., the device drivers). I'll be looking for any recent changes that might impact performance or behavior.

Then, to get a handle on the IPv6 routing, I'm going to check out `include/net/ip6_route.h`. I need to ensure I have a good grasp of the routing structures and how they interact with the output path. I'll pay close attention to the route lookup process, source address selection, and any cache mechanisms involved. This will help me understand how the kernel handles the complexity of IPv6 routing, particularly with multiple interfaces and potentially complex routing policies. It's time to refresh and update my mental model!



6/2 2026/09/02 09:16 tool read-file
0m Args:
{
  "File": "net/ipv4/ip_output.c",
  "FirstLine": 1290,
  "LineCount": 40
}

Results:
{
  "Contents": "1290:\t\t\tatomic_dec(\u0026sk-\u003esk_tskey);\n1291:\t\treturn err;\n1292:\t}\n1293:\t\n1294:\tstatic int ip_setup_cork(struct sock *sk, struct inet_cork *cork,\n1295:\t\t\t\t struct ipcm_cookie *ipc, struct rtable **rtp)\n1296:\t{\n1297:\t\tstruct ip_options_rcu *opt;\n1298:\t\tstruct rtable *rt;\n1299:\t\n1300:\t\trt = *rtp;\n1301:\t\tif (unlikely(!rt))\n1302:\t\t\treturn -EFAULT;\n1303:\t\n1304:\t\tcork-\u003efragsize = ip_sk_use_pmtu(sk) ?\n1305:\t\t\t\t dst4_mtu(\u0026rt-\u003edst) : READ_ONCE(rt-\u003edst.dev-\u003emtu);\n1306:\t\tcork-\u003efragsize = min(cork-\u003efragsize, IP_MAX_MTU);\n1307:\t\n1308:\t\tif (!inetdev_valid_mtu(cork-\u003efragsize))\n1309:\t\t\treturn -ENETUNREACH;\n1310:\t\n1311:\t\t/*\n1312:\t\t * setup for corking.\n1313:\t\t */\n1314:\t\topt = ipc-\u003eopt;\n1315:\t\tif (opt) {\n1316:\t\t\tif (!cork-\u003eopt) {\n1317:\t\t\t\tcork-\u003eopt = kmalloc(sizeof(struct ip_options) + 40,\n1318:\t\t\t\t\t\t    sk-\u003esk_allocation);\n1319:\t\t\t\tif (unlikely(!cork-\u003eopt))\n1320:\t\t\t\t\treturn -ENOBUFS;\n1321:\t\t\t}\n1322:\t\t\tmemcpy(cork-\u003eopt, \u0026opt-\u003eopt, sizeof(struct ip_options) + opt-\u003eopt.optlen);\n1323:\t\t\tcork-\u003eflags |= IPCORK_OPT;\n1324:\t\t\tcork-\u003eaddr = ipc-\u003eaddr;\n1325:\t\t}\n1326:\t\n1327:\t\tcork-\u003egso_size = ipc-\u003egso_size;\n1328:\t\n1329:\t\tcork-\u003edst = \u0026rt-\u003edst;\n"
}

7/2 2026/09/02 09:16 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 6986
							output: 40
							thoughts: 17
						

Thoughts:
Here's a summary of my thought process, as if I were the one thinking it:

**Diving into IPv6 Output**

Okay, time to get to the heart of this. My initial inclination is to head straight for `net/ipv6/ip6_output.c`. That's where the core IPv6 output functionality is likely handled. It’s the logical place to start digging into how IPv6 packets are constructed and sent. From there, I can begin to unpack the specific problem I'm trying to solve. I'm assuming it has to do with an interaction, or some quirk in the output path.



8/2 2026/09/02 09:16 tool read-file
0m Args:
{
  "File": "net/ipv6/ip6_output.c",
  "FirstLine": 1415,
  "LineCount": 45
}

Results:
{
  "Contents": "1415:\t\t\tnopt-\u003esrcrt = ip6_rthdr_dup(opt-\u003esrcrt, sk-\u003esk_allocation);\n1416:\t\t\tif (opt-\u003esrcrt \u0026\u0026 !nopt-\u003esrcrt)\n1417:\t\t\t\treturn -ENOBUFS;\n1418:\t\n1419:\t\t\t/* need source address above miyazawa*/\n1420:\t\t}\n1421:\t\tv6_cork-\u003ehop_limit = ipc6-\u003ehlimit;\n1422:\t\tv6_cork-\u003etclass = ipc6-\u003etclass;\n1423:\t\tv6_cork-\u003edontfrag = ipc6-\u003edontfrag;\n1424:\t\tif (rt-\u003edst.flags \u0026 DST_XFRM_TUNNEL)\n1425:\t\t\tmtu = READ_ONCE(np-\u003epmtudisc) \u003e= IPV6_PMTUDISC_PROBE ?\n1426:\t\t\t      READ_ONCE(rt-\u003edst.dev-\u003emtu) : dst6_mtu(\u0026rt-\u003edst);\n1427:\t\telse\n1428:\t\t\tmtu = READ_ONCE(np-\u003epmtudisc) \u003e= IPV6_PMTUDISC_PROBE ?\n1429:\t\t\t\tREAD_ONCE(rt-\u003edst.dev-\u003emtu) : dst6_mtu(xfrm_dst_path(\u0026rt-\u003edst));\n1430:\t\n1431:\t\tfrag_size = READ_ONCE(np-\u003efrag_size);\n1432:\t\tif (frag_size \u0026\u0026 frag_size \u003c mtu)\n1433:\t\t\tmtu = frag_size;\n1434:\t\n1435:\t\tif (sk_is_udp(sk))\n1436:\t\t\tmtu = min(mtu, IP6_MAX_MTU);\n1437:\t\tcork-\u003ebase.fragsize = mtu;\n1438:\t\tcork-\u003ebase.gso_size = ipc6-\u003egso_size;\n1439:\t\tcork-\u003ebase.tx_flags = 0;\n1440:\t\tcork-\u003ebase.mark = ipc6-\u003esockc.mark;\n1441:\t\tcork-\u003ebase.priority = ipc6-\u003esockc.priority;\n1442:\t\tsock_tx_timestamp(sk, \u0026ipc6-\u003esockc, \u0026cork-\u003ebase.tx_flags);\n1443:\t\tif (ipc6-\u003esockc.tsflags \u0026 SOCKCM_FLAG_TS_OPT_ID) {\n1444:\t\t\tcork-\u003ebase.flags |= IPCORK_TS_OPT_ID;\n1445:\t\t\tcork-\u003ebase.ts_opt_id = ipc6-\u003esockc.ts_opt_id;\n1446:\t\t}\n1447:\t\tcork-\u003ebase.length = 0;\n1448:\t\tcork-\u003ebase.transmit_time = ipc6-\u003esockc.transmit_time;\n1449:\t\n1450:\t\treturn 0;\n1451:\t}\n1452:\t\n1453:\tstatic int __ip6_append_data(struct sock *sk,\n1454:\t\t\t\t     struct sk_buff_head *queue,\n1455:\t\t\t\t     struct inet_cork_full *cork_full,\n1456:\t\t\t\t     struct page_frag *pfrag,\n1457:\t\t\t\t     int getfrag(void *from, char *to, int offset,\n1458:\t\t\t\t\t\t int len, int odd, struct sk_buff *skb),\n1459:\t\t\t\t     void *from, size_t length, int transhdrlen,\n"
}

9/2 2026/09/02 09:16 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 8083
							output: 38
							thoughts: 16
						

Thoughts:
Here's my attempt at summarizing the thought process, tailored for an expert audience:

**Diving into the IPv6 Routing Details**

Okay, time to get to the heart of this. My gut tells me the key to understanding this behavior lies within the IPv6 routing implementation. The `include/net/ip6_route.h` file is the logical starting point. It's the central header file defining the core data structures and likely the function prototypes for IPv6 routing within the kernel. I need to refresh my memory on the struct `rt6_info`, its fields, and how it interacts with the routing table management functions. I'll be looking for clues regarding the specific route selection process, the handling of different route types (e.g., connected, static, dynamic), and any potential optimizations or special cases that might be relevant to the issue at hand. Understanding how the routing engine makes its decisions is paramount. I'll pay close attention to the use of any flags or specific attributes associated with routes, since these often drive the more nuanced behaviors.



10/2 2026/09/02 09:16 tool read-file
0m Args:
{
  "File": "include/net/ip6_route.h",
  "FirstLine": 365,
  "LineCount": 35
}

Results:
{
  "Contents": " 365:\t}\n 366:\t\n 367:\tstatic inline unsigned int ip6_dst_mtu_maybe_forward(const struct dst_entry *dst,\n 368:\t\t\t\t\t\t\t     bool forwarding)\n 369:\t{\n 370:\t\tstruct inet6_dev *idev;\n 371:\t\tunsigned int mtu;\n 372:\t\n 373:\t\tif (!forwarding || dst_metric_locked(dst, RTAX_MTU)) {\n 374:\t\t\tmtu = dst_metric_raw(dst, RTAX_MTU);\n 375:\t\t\tif (mtu)\n 376:\t\t\t\tgoto out;\n 377:\t\t}\n 378:\t\n 379:\t\tmtu = IPV6_MIN_MTU;\n 380:\t\trcu_read_lock();\n 381:\t\tidev = __in6_dev_get(dst_dev_rcu(dst));\n 382:\t\tif (idev)\n 383:\t\t\tmtu = READ_ONCE(idev-\u003ecnf.mtu6);\n 384:\t\trcu_read_unlock();\n 385:\t\n 386:\tout:\n 387:\t\tmtu = min_t(unsigned int, mtu, IP6_MAX_MTU);\n 388:\t\n 389:\t\treturn mtu - lwtunnel_headroom(dst-\u003elwtstate, mtu);\n 390:\t}\n 391:\t\n 392:\t/* Configured/administrative MTU of a route, for advertising the TCP MSS.\n 393:\t *\n 394:\t * Unlike ip6_dst_mtu_maybe_forward(), this ignores any ICMPv6-learned path\n 395:\t * MTU (which is kept on the RTF_CACHE exception route) and returns the MTU of\n 396:\t * the underlying route (fib6_pmtu) or the egress device.  The advertised MSS\n 397:\t * bounds what the peer may send to us and must reflect our receive\n 398:\t * capability, not a path MTU learned on the reverse (send) direction.  See\n 399:\t * RFC 2923 section 2.3 and the comment above tcp_advertise_mss().\n"
}

11/2 2026/09/02 09:16 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 8948
							output: 20
							thoughts: 30
						

Thoughts:
Here's my thinking process:

**Investigating Maximum Transmission Unit (MTU) Values in IP and IPv6**

Okay, so I'm trying to refresh my memory on the maximum transmission unit values, specifically `IP_MAX_MTU` and `IP6_MAX_MTU`. Those constant definitions are crucial for network configuration and handling fragmentation, so I need to make sure I'm on solid ground with them. I could look them up in the documentation, but I'll try a quick grep through relevant source code first. It's often faster to see the usage context alongside the definition. A quick grep should do the trick. Let's get to it.



12/2 2026/09/02 09:16 tool grepper
0m Args:
{
  "Expression": "IP_MAX_MTU"
}

Results:
{
  "Output": "drivers/hsi/clients/ssi_protocol.c-34-#define SSIP_TXQUEUE_LEN\t100\ndrivers/hsi/clients/ssi_protocol.c:35:#define SSIP_MAX_MTU\t\t65535\ndrivers/hsi/clients/ssi_protocol.c-36-#define SSIP_DEFAULT_MTU\t4000\n--\ndrivers/hsi/clients/ssi_protocol.c=1073=static int ssi_protocol_probe(struct device *dev)\n--\ndrivers/hsi/clients/ssi_protocol.c-1123-\tssi-\u003enetdev-\u003emin_mtu = PHONET_MIN_MTU;\ndrivers/hsi/clients/ssi_protocol.c:1124:\tssi-\u003enetdev-\u003emax_mtu = SSIP_MAX_MTU;\ndrivers/hsi/clients/ssi_protocol.c-1125-\n--\ndrivers/net/bareudp.c=574=static void bareudp_setup(struct net_device *dev)\n--\ndrivers/net/bareudp.c-588-\tdev-\u003emin_mtu = IPV4_MIN_MTU;\ndrivers/net/bareudp.c:589:\tdev-\u003emax_mtu = IP_MAX_MTU - BAREUDP_BASE_HLEN;\ndrivers/net/bareudp.c-590-\tdev-\u003etype = ARPHRD_NONE;\n--\ndrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c=10827=mlxsw_sp_rif_ipip_lb_ul_rif_op(struct mlxsw_sp_rif *ul_rif, bool enable)\n--\ndrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c-10832-\tmlxsw_reg_ritr_pack(ritr_pl, enable, MLXSW_REG_RITR_LOOPBACK_IF,\ndrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:10833:\t\t\t    ul_rif-\u003erif_index, ul_rif-\u003evr_id, IP_MAX_MTU);\ndrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c-10834-\tmlxsw_reg_ritr_loopback_protocol_set(ritr_pl,\n--\ndrivers/net/geneve.c=1828=static void geneve_setup(struct net_device *dev)\n--\ndrivers/net/geneve.c-1860-\t */\ndrivers/net/geneve.c:1861:\tdev-\u003emax_mtu = IP_MAX_MTU - GENEVE_BASE_HLEN - dev-\u003ehard_header_len;\ndrivers/net/geneve.c-1862-\n--\ndrivers/net/ovpn/main.c=158=static void ovpn_setup(struct net_device *dev)\n--\ndrivers/net/ovpn/main.c-175-\tdev-\u003emin_mtu = IPV4_MIN_MTU;\ndrivers/net/ovpn/main.c:176:\tdev-\u003emax_mtu = IP_MAX_MTU - OVPN_HEAD_ROOM;\ndrivers/net/ovpn/main.c-177-\n--\ndrivers/net/virtio_net.c=6427=static unsigned int mergeable_min_buf_len(struct virtnet_info *vi, struct virtqueue *vq)\n--\ndrivers/net/virtio_net.c-6430-\tunsigned int rq_size = virtqueue_get_vring_size(vq);\ndrivers/net/virtio_net.c:6431:\tunsigned int packet_len = vi-\u003ebig_packets ? IP_MAX_MTU : vi-\u003edev-\u003emax_mtu;\ndrivers/net/virtio_net.c-6432-\tunsigned int buf_len = hdr_len + ETH_HLEN + VLAN_HLEN + packet_len;\n--\ninclude/linux/ip.h=47=static inline unsigned int skb_ip_totlen(const struct sk_buff *skb)\n--\ninclude/linux/ip.h-52-/* IPv4 datagram length is stored into 16bit field (tot_len) */\ninclude/linux/ip.h:53:#define IP_MAX_MTU\t0xFFFFU\ninclude/linux/ip.h-54-\ninclude/linux/ip.h=55=static inline void iph_set_totlen(struct iphdr *iph, unsigned int len)\ninclude/linux/ip.h-56-{\ninclude/linux/ip.h:57:\tiph-\u003etot_len = len \u003c= IP_MAX_MTU ? htons(len) : 0;\ninclude/linux/ip.h-58-}\n--\ninclude/net/ip.h=467=static inline unsigned int ip_dst_mtu_maybe_forward(const struct dst_entry *dst,\n--\ninclude/net/ip.h-499-out:\ninclude/net/ip.h:500:\tmtu = min_t(unsigned int, mtu, IP_MAX_MTU);\ninclude/net/ip.h-501-\n--\ninclude/net/ip.h=519=static inline unsigned int ip_dst_mtu_configured(const struct dst_entry *dst)\n--\ninclude/net/ip.h-526-\t\tmtu = READ_ONCE(dst_dev_rcu(dst)-\u003emtu);\ninclude/net/ip.h:527:\tmtu = min_t(unsigned int, mtu, IP_MAX_MTU);\ninclude/net/ip.h-528-\tres = mtu - lwtunnel_headroom(dst-\u003elwtstate, mtu);\n--\ninclude/net/ip.h=534=static inline unsigned int ip_skb_dst_mtu(struct sock *sk,\n--\ninclude/net/ip.h-545-\ninclude/net/ip.h:546:\tmtu = min(READ_ONCE(dst_dev(dst)-\u003emtu), IP_MAX_MTU);\ninclude/net/ip.h-547-\treturn mtu - lwtunnel_headroom(dst-\u003elwtstate, mtu);\n--\ninclude/uapi/linux/if_ether.h-40-#define ETH_MIN_MTU\t68\t\t/* Min IPv4 MTU per RFC791\t*/\ninclude/uapi/linux/if_ether.h:41:#define ETH_MAX_MTU\t0xFFFFU\t\t/* 65535, same as IP_MAX_MTU\t*/\ninclude/uapi/linux/if_ether.h-42-\n--\nnet/ipv4/esp4.c=309=static struct ip_esp_hdr *esp_output_udp_encap(struct sk_buff *skb,\n--\nnet/ipv4/esp4.c-319-\tlen = skb-\u003elen + esp-\u003etailen - skb_transport_offset(skb);\nnet/ipv4/esp4.c:320:\tif (len + sizeof(struct iphdr) \u003e IP_MAX_MTU)\nnet/ipv4/esp4.c-321-\t\treturn ERR_PTR(-EMSGSIZE);\n--\nnet/ipv4/esp4.c=340=static struct ip_esp_hdr *esp_output_tcp_encap(struct xfrm_state *x,\n--\nnet/ipv4/esp4.c-349-\tlen = skb-\u003elen + esp-\u003etailen - skb_transport_offset(skb);\nnet/ipv4/esp4.c:350:\tif (len \u003e IP_MAX_MTU)\nnet/ipv4/esp4.c-351-\t\treturn ERR_PTR(-EMSGSIZE);\n--\nnet/ipv4/igmp.c=397=static struct sk_buff *igmpv3_newpack(struct net_device *dev, unsigned int mtu)\n--\nnet/ipv4/igmp.c-408-\nnet/ipv4/igmp.c:409:\tsize = min(mtu, IP_MAX_MTU);\nnet/ipv4/igmp.c-410-\twhile (1) {\n--\nnet/ipv4/ip_output.c=953=static int __ip_append_data(struct sock *sk,\n--\nnet/ipv4/ip_output.c-983-\texthdrlen = !skb ? rt-\u003edst.header_len : 0;\nnet/ipv4/ip_output.c:984:\tmtu = cork-\u003egso_size ? IP_MAX_MTU : cork-\u003efragsize;\nnet/ipv4/ip_output.c-985-\tpaged = !!cork-\u003egso_size;\n--\nnet/ipv4/ip_output.c-990-\tmaxfraglen = ((mtu - fragheaderlen) \u0026 ~7) + fragheaderlen;\nnet/ipv4/ip_output.c:991:\tmaxnonfragsize = ip_sk_ignore_df(sk) ? IP_MAX_MTU : mtu;\nnet/ipv4/ip_output.c-992-\n--\nnet/ipv4/ip_output.c=1294=static int ip_setup_cork(struct sock *sk, struct inet_cork *cork,\n--\nnet/ipv4/ip_output.c-1305-\t\t\t dst4_mtu(\u0026rt-\u003edst) : READ_ONCE(rt-\u003edst.dev-\u003emtu);\nnet/ipv4/ip_output.c:1306:\tcork-\u003efragsize = min(cork-\u003efragsize, IP_MAX_MTU);\nnet/ipv4/ip_output.c-1307-\n--\nnet/ipv4/ip_tunnel.c=280=static int ip_tunnel_bind_dev(struct net_device *dev)\n--\nnet/ipv4/ip_tunnel.c-316-\t\thlen = tdev-\u003ehard_header_len + tdev-\u003eneeded_headroom;\nnet/ipv4/ip_tunnel.c:317:\t\tmtu = min(tdev-\u003emtu, IP_MAX_MTU);\nnet/ipv4/ip_tunnel.c-318-\t}\n--\nnet/ipv4/ip_tunnel.c=329=static struct ip_tunnel *ip_tunnel_create(struct net *net,\n--\nnet/ipv4/ip_tunnel.c-350-\tdev-\u003emin_mtu = ETH_MIN_MTU;\nnet/ipv4/ip_tunnel.c:351:\tdev-\u003emax_mtu = IP_MAX_MTU - t_hlen;\nnet/ipv4/ip_tunnel.c-352-\tif (dev-\u003etype == ARPHRD_ETHER)\n--\nnet/ipv4/ip_tunnel.c=1057=int ip_tunnel_change_mtu(struct net_device *dev, int new_mtu)\n--\nnet/ipv4/ip_tunnel.c-1060-\tint t_hlen = tunnel-\u003ehlen + sizeof(struct iphdr);\nnet/ipv4/ip_tunnel.c:1061:\tint max_mtu = IP_MAX_MTU - t_hlen;\nnet/ipv4/ip_tunnel.c-1062-\n--\nnet/ipv4/ip_tunnel.c=1182=int ip_tunnel_newlink(struct net *net, struct net_device *dev,\n--\nnet/ipv4/ip_tunnel.c-1213-\tif (tb[IFLA_MTU]) {\nnet/ipv4/ip_tunnel.c:1214:\t\tunsigned int max = IP_MAX_MTU - (nt-\u003ehlen + sizeof(struct iphdr));\nnet/ipv4/ip_tunnel.c-1215-\n--\nnet/ipv4/route.c=1445=u32 ip_mtu_from_fib_result(struct fib_result *res, __be32 daddr)\n--\nnet/ipv4/route.c-1464-\tif (likely(!mtu))\nnet/ipv4/route.c:1465:\t\tmtu = min(READ_ONCE(dev-\u003emtu), IP_MAX_MTU);\nnet/ipv4/route.c-1466-\n--\nnet/ipv6/esp6.c=371=static struct ip_esp_hdr *esp6_output_tcp_encap(struct xfrm_state *x,\n--\nnet/ipv6/esp6.c-380-\tlen = skb-\u003elen + esp-\u003etailen - skb_transport_offset(skb);\nnet/ipv6/esp6.c:381:\tif (len \u003e IP_MAX_MTU)\nnet/ipv6/esp6.c-382-\t\treturn ERR_PTR(-EMSGSIZE);\n--\nnet/ipv6/ip6_tunnel.c=1753=int ip6_tnl_change_mtu(struct net_device *dev, int new_mtu)\n--\nnet/ipv6/ip6_tunnel.c-1769-\t} else {\nnet/ipv6/ip6_tunnel.c:1770:\t\tif (new_mtu \u003e IP_MAX_MTU - dev-\u003ehard_header_len - t_hlen)\nnet/ipv6/ip6_tunnel.c-1771-\t\t\treturn -EINVAL;\n--\nnet/ipv6/ip6_vti.c=911=static void vti6_dev_setup(struct net_device *dev)\n--\nnet/ipv6/ip6_vti.c-919-\tdev-\u003emin_mtu = IPV4_MIN_MTU;\nnet/ipv6/ip6_vti.c:920:\tdev-\u003emax_mtu = IP_MAX_MTU - sizeof(struct ipv6hdr);\nnet/ipv6/ip6_vti.c-921-\tdev-\u003eflags |= IFF_NOARP;\n--\nnet/xfrm/xfrm_interface_core.c=739=static void xfrmi_dev_setup(struct net_device *dev)\n--\nnet/xfrm/xfrm_interface_core.c-745-\tdev-\u003emin_mtu\t\t= ETH_MIN_MTU;\nnet/xfrm/xfrm_interface_core.c:746:\tdev-\u003emax_mtu\t\t= IP_MAX_MTU;\nnet/xfrm/xfrm_interface_core.c-747-\tdev-\u003eflags \t\t= IFF_NOARP;\n--\nnet/xfrm/xfrm_iptfs.c=2505=static u32 iptfs_get_inner_mtu(struct xfrm_state *x, int outer_mtu)\n--\nnet/xfrm/xfrm_iptfs.c-2510-\tif (!xtfs-\u003ecfg.dont_frag)\nnet/xfrm/xfrm_iptfs.c:2511:\t\treturn x-\u003eouter_mode.family == AF_INET ? IP_MAX_MTU : IP6_MAX_MTU;\nnet/xfrm/xfrm_iptfs.c-2512-\treturn __iptfs_get_inner_mtu(x, outer_mtu);\n--\nnet/xfrm/xfrm_user.c=907=static struct xfrm_state *xfrm_state_construct(struct net *net,\n--\nnet/xfrm/xfrm_user.c-956-\t\tx-\u003etfcpad = nla_get_u32(attrs[XFRMA_TFCPAD]);\nnet/xfrm/xfrm_user.c:957:\t\tif (x-\u003etfcpad \u003e IP_MAX_MTU) {\nnet/xfrm/xfrm_user.c-958-\t\t\tNL_SET_ERR_MSG(extack, \"Excessive TFC padding\");\n"
}

13/2 2026/09/02 09:16 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 13081
							output: 20
							thoughts: 791
						

Thoughts:
**Analyzing a Kernel Networking Patch for Fuzzing Worthiness**

Okay, let's break this down. First, this patch touches core networking code, specifically dealing with MTU clamping and UDP packet sizes in IPv4 and IPv6. I see modifications to `ip6_route.h` (for MTU), `ip_output.c` (IPv4 cork setup), and `ip6_output.c` (IPv6 cork setup).

My initial question is *why* this change? The commit message points to addressing a potential UDP length overflow, especially in older kernels, within `udp_send_skb` and `udp_v6_send_skb`. A quick scan of the code confirms the intent is to limit the packet size to prevent that overflow. This means the patch is touching critical paths.

Now, the crucial question: Is this *WorthFuzzing*? The criteria are pretty clear. I need to make sure this isn't just documentation, cosmetic changes, or unreachable code. Let's look:

*   It's not documentation.
*   It's not purely logging or decorative.
*   It modifies *numeric constants* in a way that *functionally alters execution flow* by clamping MTUs and sizes to prevent overflow.
*   It's definitely *not* code specific to hardware that isn't commonly available, and it is in core kernel networking.
*   It is modifying reachable, core kernel networking logic; Specifically, the UDP output paths in IPv4 and IPv6 and MTU calculations.

Therefore, applying the `WorthFuzzing` criteria here: This is a solid "Yes".

Next, how do we target fuzzing efforts most effectively? It's time to refine the `FocusSymbols`. The goal is to identify API entrypoints. I need to find the functions that call `ip_setup_cork`, `ip6_setup_cork`, and `ip6_dst_mtu_maybe_forward`, avoiding generic hot-path functions. This requires me to do some code archaeology and find the API entry points that are relevant. So, I need to search the kernel source and identify those callers. That will guide my next steps.



14/2 2026/09/02 09:16 tool grepper
0m Args:
{
  "Expression": "ip_setup_cork"
}

Results:
{
  "Output": "net/ipv4/ip_output.c=953=static int __ip_append_data(struct sock *sk,\n--\nnet/ipv4/ip_output.c-1293-\nnet/ipv4/ip_output.c:1294:static int ip_setup_cork(struct sock *sk, struct inet_cork *cork,\nnet/ipv4/ip_output.c-1295-\t\t\t struct ipcm_cookie *ipc, struct rtable **rtp)\n--\nnet/ipv4/ip_output.c=1360=int ip_append_data(struct sock *sk, struct flowi4 *fl4,\n--\nnet/ipv4/ip_output.c-1373-\tif (skb_queue_empty(\u0026sk-\u003esk_write_queue)) {\nnet/ipv4/ip_output.c:1374:\t\terr = ip_setup_cork(sk, \u0026inet-\u003ecork.base, ipc, rtp);\nnet/ipv4/ip_output.c-1375-\t\tif (err)\n--\nnet/ipv4/ip_output.c=1554=struct sk_buff *ip_make_skb(struct sock *sk,\n--\nnet/ipv4/ip_output.c-1572-\tcork-\u003eopt = NULL;\nnet/ipv4/ip_output.c:1573:\terr = ip_setup_cork(sk, cork, ipc, rtp);\nnet/ipv4/ip_output.c-1574-\tif (err)\n"
}

15/2 2026/09/02 09:16 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 14756
							output: 21
							thoughts: 14
						

Thoughts:
Okay, here's my interpretation of that thought process, tailored for an expert audience, and written in the first person:

**Initial Investigation into IP6 Configuration**

Right, let's circle back to that specific function, `ip6_setup_cork`. Given the context, I'm already thinking about potential configurations, optimizations, or even debugging efforts related to IPv6 within the system. My immediate instinct is to probe its behavior and dependencies further, likely due to a specific need that the name implies such as IPv6 setup tasks. So, I'll add that function to my search criteria and get a better picture of how this function fits into the overall scheme of things.



16/2 2026/09/02 09:16 tool grepper
0m Args:
{
  "Expression": "ip6_setup_cork"
}

Results:
{
  "Output": "net/ipv6/ip6_output.c=1350=static void ip6_append_data_mtu(unsigned int *mtu,\n--\nnet/ipv6/ip6_output.c-1373-\nnet/ipv6/ip6_output.c:1374:static int ip6_setup_cork(struct sock *sk, struct inet_cork_full *cork,\nnet/ipv6/ip6_output.c-1375-\t\t\t  struct ipcm6_cookie *ipc6,\n--\nnet/ipv6/ip6_output.c=1860=int ip6_append_data(struct sock *sk,\n--\nnet/ipv6/ip6_output.c-1877-\t\tdst_hold(\u0026rt-\u003edst);\nnet/ipv6/ip6_output.c:1878:\t\terr = ip6_setup_cork(sk, \u0026inet-\u003ecork,\nnet/ipv6/ip6_output.c-1879-\t\t\t\t     ipc6, rt);\n--\nnet/ipv6/ip6_output.c=2066=struct sk_buff *ip6_make_skb(struct sock *sk,\n--\nnet/ipv6/ip6_output.c-2087-\tcork-\u003ebase6.opt = NULL;\nnet/ipv6/ip6_output.c:2088:\terr = ip6_setup_cork(sk, cork, ipc6, rt);\nnet/ipv6/ip6_output.c-2089-\tif (err) {\n"
}

17/2 2026/09/02 09:16 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 15330
							output: 25
							thoughts: 83
						

Thoughts:
Here's my take on the thought process, as if it were my own:

**Investigating IPv6 MTU Handling**

Okay, so I'm digging into the IPv4 and IPv6 stack, specifically around fragmentation and MTU discovery. Let's see... I'm tracing the flow related to "corking," that optimization where you delay the actual transmission of a packet until you have enough data to fill a buffer. I've noted that `ip_setup_cork` gets invoked by `ip_append_data` and `ip_make_skb` in the IPv4 path, which is as expected. Similarly, `ip6_setup_cork` is called by `ip6_append_data` and `ip6_make_skb` in the IPv6 path. Standard stuff, so far.

Now I'm focusing specifically on IPv6. My next thought is to understand the context of `ip6_dst_mtu_maybe_forward`. I need to figure out *what* is calling *that* function. I know this function is involved in path MTU discovery and potentially forwarding packets, so understanding its call graph is key to understanding how the MTU is handled within the code and in what circumstances it is used. I'll need to trace the call chain to build a full picture.



18/2 2026/09/02 09:17 tool grepper
0m Args:
{
  "Expression": "ip6_dst_mtu_maybe_forward"
}

Results:
{
  "Output": "include/net/ip6_route.h=353=static inline bool rt6_duplicate_nexthop(struct fib6_info *a, struct fib6_info *b)\n--\ninclude/net/ip6_route.h-366-\ninclude/net/ip6_route.h:367:static inline unsigned int ip6_dst_mtu_maybe_forward(const struct dst_entry *dst,\ninclude/net/ip6_route.h-368-\t\t\t\t\t\t     bool forwarding)\n--\ninclude/net/ip6_route.h-393- *\ninclude/net/ip6_route.h:394: * Unlike ip6_dst_mtu_maybe_forward(), this ignores any ICMPv6-learned path\ninclude/net/ip6_route.h-395- * MTU (which is kept on the RTF_CACHE exception route) and returns the MTU of\n--\nnet/ipv6/ip6_output.c=521=int ip6_forward(struct sk_buff *skb)\n--\nnet/ipv6/ip6_output.c-664-\nnet/ipv6/ip6_output.c:665:\tmtu = ip6_dst_mtu_maybe_forward(dst, true);\nnet/ipv6/ip6_output.c-666-\tif (mtu \u003c IPV6_MIN_MTU)\n--\nnet/ipv6/route.c=3288=INDIRECT_CALLABLE_SCOPE unsigned int ip6_mtu(const struct dst_entry *dst)\nnet/ipv6/route.c-3289-{\nnet/ipv6/route.c:3290:\treturn ip6_dst_mtu_maybe_forward(dst, false);\nnet/ipv6/route.c-3291-}\n--\nnet/netfilter/nf_flow_table_core.c=97=static int flow_offload_fill_route(struct flow_offload *flow,\n--\nnet/netfilter/nf_flow_table_core.c-109-\tcase NFPROTO_IPV6:\nnet/netfilter/nf_flow_table_core.c:110:\t\tflow_tuple-\u003emtu = ip6_dst_mtu_maybe_forward(dst, true);\nnet/netfilter/nf_flow_table_core.c-111-\t\tbreak;\n"
}

19/2 2026/09/02 09:17 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 16315
							output: 67
							thoughts: 216
						

Thoughts:
**Analyzing IPv6 MTU Handling**

Okay, so I'm looking at how IPv6 MTU is managed and I've noticed a couple of functions interacting here: `ip6_mtu` calls `ip6_dst_mtu_maybe_forward(dst, false)` and `ip6_forward` calls `ip6_dst_mtu_maybe_forward(dst, true)`. Seems like they're sharing some core logic, which is good for avoiding duplication. Now, I want to get a better handle on the big picture to see how all these pieces fit together.

I've got a mental checklist of key symbols I want to understand in this context. Let's see... I've got `ip_append_data`, `ip_make_skb`, `ip6_append_data`, `ip6_make_skb`, and of course `ip6_mtu` and `ip6_forward` themselves. I need to figure out the scope of these; are they internal, or are they globally visible? If they're global, that really changes the game in terms of inter-module dependencies and the overall architecture.

To verify their scope, I need to check where they're defined. I'll need to look at `net/ipv4/ip_output.c`, `net/ipv6/ip6_output.c`, and `net/ipv6/route.c`. Those seem like the logical places to find the definitions, and I should be able to determine if they're static or not from the source code. That should give me a good sense of how they're intended to be used and if there are any potential gotchas with external visibility.



20/2 2026/09/02 09:17 tool grepper
0m Args:
{
  "Expression": "EXPORT_SYMBOL.*ip_append_data|EXPORT_SYMBOL.*ip_make_skb|EXPORT_SYMBOL.*ip6_append_data|EXPORT_SYMBOL.*ip6_make_skb|EXPORT_SYMBOL.*ip6_mtu"
}

Results:
{
  "Output": "net/ipv6/ip6_output.c=1860=int ip6_append_data(struct sock *sk,\n--\nnet/ipv6/ip6_output.c-1894-}\nnet/ipv6/ip6_output.c:1895:EXPORT_SYMBOL_GPL(ip6_append_data);\nnet/ipv6/ip6_output.c-1896-\n"
}

21/2 2026/09/02 09:17 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 17077
							output: 39
							thoughts: 33
						

Thoughts:
Here's my take on the process, playing the role of an expert:

**Diving into IPv4 Output**

Okay, so I need to understand how IPv4 packets are assembled and sent out. My immediate focus is on the crucial functions within `net/ipv4/ip_output.c`. Specifically, I'm going to dig into `ip_append_data` and `ip_make_skb`. These are the key building blocks. `ip_append_data` will be responsible for attaching the application data to the SKB (Socket Buffer), and ensuring that this is done safely, and potentially handling fragmentation. `ip_make_skb`, on the other hand, should be the function that actually creates and initializes the SKB structure itself, and starts the IPv4 header assembly. It's a fundamental part of the output process. I'll need to look at how they handle things like checksum calculation, MTU considerations, and any interactions with the fragmentation logic. I also should consider how they interact with the networking stack above and below them. Gotta get this nailed down.



22/2 2026/09/02 09:17 tool read-file
0m Args:
{
  "File": "net/ipv4/ip_output.c",
  "FirstLine": 1390,
  "LineCount": 20
}

Results:
{
  "Contents": "1390:\t\tcork-\u003eopt = NULL;\n1391:\t\tdst_release(cork-\u003edst);\n1392:\t\tcork-\u003edst = NULL;\n1393:\t}\n1394:\t\n1395:\t/*\n1396:\t *\tCombined all pending IP fragments on the socket as one IP datagram\n1397:\t *\tand push them out.\n1398:\t */\n1399:\tstruct sk_buff *__ip_make_skb(struct sock *sk,\n1400:\t\t\t\t      struct flowi4 *fl4,\n1401:\t\t\t\t      struct sk_buff_head *queue,\n1402:\t\t\t\t      struct inet_cork *cork)\n1403:\t{\n1404:\t\tstruct sk_buff *skb, *tmp_skb;\n1405:\t\tstruct sk_buff **tail_skb;\n1406:\t\tstruct inet_sock *inet = inet_sk(sk);\n1407:\t\tstruct net *net = sock_net(sk);\n1408:\t\tstruct ip_options *opt = NULL;\n1409:\t\tstruct rtable *rt = dst_rtable(cork-\u003edst);\n"
}

23/2 2026/09/02 09:17 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 17700
							output: 34
							thoughts: 388
						

Thoughts:
**Analyzing IPv4/IPv6 Output Path Functions**

Okay, let's break this down. I'm looking at the core functions involved in the IPv4 and IPv6 output paths, specifically: `ip_append_data`, `ip_make_skb` (IPv4) and `ip6_append_data`, `ip6_make_skb` (IPv6). I know these are defined in `net/ipv4/ip_output.c` and `net/ipv6/ip6_output.c`, and importantly, they're *non-static*. This immediately raises a flag – it suggests they're potentially used beyond the direct scope of those files.

Let's drill down and see the callers of those functions from UDP, and RAW. I know that `udp_sendmsg` and `udpv6_sendmsg` are the relevant functions for UDP, and they indeed call the IPv4/IPv6 functions. The interesting bit is that while `udp_sendmsg` and `udpv6_sendmsg` are performance-critical "hot paths", the `ip_append_data` and `ip_make_skb` are specific to corking/output path. So, I have to mentally separate those paths.

Now, let's see what about `ip_setup_cork` and `ip6_setup_cork`? Are they static, and indeed they are: `static int ip_setup_cork(...)` and `static int ip6_setup_cork(...)` which makes sense for internal setup functions. Good.

I'm also noting `ip6_dst_mtu_maybe_forward`, which is static inline in `include/net/ip6_route.h`. Its callers are `ip6_mtu` (in `net/ipv6/route.c`), `ip6_forward` (in `net/ipv6/ip6_output.c`), etc. This is useful for MTU-related adjustments, and the fact that it's inline implies performance optimization – it's crucial for the forwarding path, too.

Finally, I need to check the Kconfig options that control the inclusion of IPv4 and IPv6 features. And also where `net/ipv4/ip_output.c` and `net/ipv6/ip6_output.c` are built. This will give me a better understanding of how the code is compiled and which modules depend on these core functions.



24/2 2026/09/02 09:17 tool grepper
0m Args:
{
  "Expression": "ip_output.o|ip6_output.o",
  "PathPrefix": "net/"
}

Results:
{
  "Output": "net/ipv4/Makefile=6=obj-y     := route.o inetpeer.o protocol.o \\\nnet/ipv4/Makefile-7-\t     ip_input.o ip_fragment.o ip_forward.o ip_options.o \\\nnet/ipv4/Makefile:8:\t     ip_output.o ip_sockglue.o inet_hashtables.o \\\nnet/ipv4/Makefile-9-\t     inet_timewait_sock.o inet_connection_sock.o \\\n--\nnet/ipv6/Makefile=6=obj-$(CONFIG_IPV6) += ipv6.o\nnet/ipv6/Makefile-7-\nnet/ipv6/Makefile:8:ipv6-y :=\taf_inet6.o anycast.o ip6_output.o ip6_input.o addrconf.o \\\nnet/ipv6/Makefile-9-\t\taddrlabel.o \\\n"
}

25/2 2026/09/02 09:17 llm patch-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 18877
							output: 30
							thoughts: 23
						

Thoughts:
Here's my take on the thought process, summarized as you requested:

**Kconfig Dive for Network Configuration**

Okay, so I need to get a handle on how network configuration is handled. Let's start digging into the Kconfig files. Specifically, I should check `net/ipv4/Kconfig` and `net/ipv6/Kconfig`. These should be the places where the core IPv4 and IPv6-related options are defined. This is the logical starting point for understanding how these protocol stacks are configured at compile time. Examining these files will likely provide me with insights into the various feature flags, dependencies, and default settings related to IP networking. Knowing this is key to understanding the possibilities within the kernel.



26/2 2026/09/02 09:17 tool grepper
0m Args:
{
  "Expression": "config INET|config IPV6",
  "PathPrefix": "net/"
}

Results:
{
  "Output": "net/Kconfig=99=config NET_HANDSHAKE_KUNIT_TEST\n--\nnet/Kconfig-113-\nnet/Kconfig:114:config INET\nnet/Kconfig-115-\tbool \"TCP/IP networking\"\n--\nnet/ipv4/Kconfig=330=config NET_FOU_IP_TUNNELS\n--\nnet/ipv4/Kconfig-338-\nnet/ipv4/Kconfig:339:config INET_AH\nnet/ipv4/Kconfig-340-\ttristate \"IP: AH transformation\"\n--\nnet/ipv4/Kconfig-353-\nnet/ipv4/Kconfig:354:config INET_ESP\nnet/ipv4/Kconfig-355-\ttristate \"IP: ESP transformation\"\n--\nnet/ipv4/Kconfig-368-\nnet/ipv4/Kconfig:369:config INET_ESP_OFFLOAD\nnet/ipv4/Kconfig-370-\ttristate \"IP: ESP transformation offload\"\n--\nnet/ipv4/Kconfig-381-\nnet/ipv4/Kconfig:382:config INET_ESPINTCP\nnet/ipv4/Kconfig-383-\tbool \"IP: ESP in TCP encapsulation (RFC 8229)\"\n--\nnet/ipv4/Kconfig-393-\nnet/ipv4/Kconfig:394:config INET_IPCOMP\nnet/ipv4/Kconfig-395-\ttristate \"IP: IPComp transformation\"\n--\nnet/ipv4/Kconfig-403-\nnet/ipv4/Kconfig:404:config INET_TABLE_PERTURB_ORDER\nnet/ipv4/Kconfig-405-\tint \"INET: Source port perturbation table size (as power of 2)\" if EXPERT\n--\nnet/ipv4/Kconfig-413-\nnet/ipv4/Kconfig:414:config INET_XFRM_TUNNEL\nnet/ipv4/Kconfig-415-\ttristate\n--\nnet/ipv4/Kconfig-418-\nnet/ipv4/Kconfig:419:config INET_TUNNEL\nnet/ipv4/Kconfig-420-\ttristate\n--\nnet/ipv4/Kconfig-422-\nnet/ipv4/Kconfig:423:config INET_DIAG\nnet/ipv4/Kconfig-424-\ttristate \"INET: socket monitoring interface\"\n--\nnet/ipv4/Kconfig-434-\nnet/ipv4/Kconfig:435:config INET_TCP_DIAG\nnet/ipv4/Kconfig-436-\tdepends on INET_DIAG\n--\nnet/ipv4/Kconfig-438-\nnet/ipv4/Kconfig:439:config INET_UDP_DIAG\nnet/ipv4/Kconfig-440-\ttristate \"UDP: socket monitoring interface\"\n--\nnet/ipv4/Kconfig-446-\nnet/ipv4/Kconfig:447:config INET_RAW_DIAG\nnet/ipv4/Kconfig-448-\ttristate \"RAW: socket monitoring interface\"\n--\nnet/ipv4/Kconfig-454-\nnet/ipv4/Kconfig:455:config INET_DIAG_DESTROY\nnet/ipv4/Kconfig-456-\tbool \"INET: allow privileged process to administratively close sockets\"\n--\nnet/ipv6/Kconfig-5-\nnet/ipv6/Kconfig:6:menuconfig IPV6\nnet/ipv6/Kconfig-7-\tbool \"The IPv6 protocol\"\n--\nnet/ipv6/Kconfig=19=if IPV6\nnet/ipv6/Kconfig-20-\nnet/ipv6/Kconfig:21:config IPV6_ROUTER_PREF\nnet/ipv6/Kconfig-22-\tbool \"IPv6: Router Preference (RFC 4191) support\"\n--\nnet/ipv6/Kconfig-30-\nnet/ipv6/Kconfig:31:config IPV6_ROUTE_INFO\nnet/ipv6/Kconfig-32-\tbool \"IPv6: Route Information (RFC 4191) support\"\n--\nnet/ipv6/Kconfig-38-\nnet/ipv6/Kconfig:39:config IPV6_OPTIMISTIC_DAD\nnet/ipv6/Kconfig-40-\tbool \"IPv6: Enable RFC 4429 Optimistic DAD\"\n--\nnet/ipv6/Kconfig-46-\nnet/ipv6/Kconfig:47:config INET6_AH\nnet/ipv6/Kconfig-48-\ttristate \"IPv6: AH transformation\"\n--\nnet/ipv6/Kconfig-61-\nnet/ipv6/Kconfig:62:config INET6_ESP\nnet/ipv6/Kconfig-63-\ttristate \"IPv6: ESP transformation\"\n--\nnet/ipv6/Kconfig-76-\nnet/ipv6/Kconfig:77:config INET6_ESP_OFFLOAD\nnet/ipv6/Kconfig-78-\ttristate \"IPv6: ESP transformation offload\"\n--\nnet/ipv6/Kconfig-89-\nnet/ipv6/Kconfig:90:config INET6_ESPINTCP\nnet/ipv6/Kconfig-91-\tbool \"IPv6: ESP in TCP encapsulation (RFC 8229)\"\n--\nnet/ipv6/Kconfig-101-\nnet/ipv6/Kconfig:102:config INET6_IPCOMP\nnet/ipv6/Kconfig-103-\ttristate \"IPv6: IPComp transformation\"\n--\nnet/ipv6/Kconfig-111-\nnet/ipv6/Kconfig:112:config IPV6_MIP6\nnet/ipv6/Kconfig-113-\ttristate \"IPv6: Mobility\"\n--\nnet/ipv6/Kconfig-119-\nnet/ipv6/Kconfig:120:config IPV6_ILA\nnet/ipv6/Kconfig-121-\ttristate \"IPv6: Identifier Locator Addressing (ILA)\"\n--\nnet/ipv6/Kconfig-140-\nnet/ipv6/Kconfig:141:config INET6_XFRM_TUNNEL\nnet/ipv6/Kconfig-142-\ttristate\n--\nnet/ipv6/Kconfig-145-\nnet/ipv6/Kconfig:146:config INET6_TUNNEL\nnet/ipv6/Kconfig-147-\ttristate\n--\nnet/ipv6/Kconfig-149-\nnet/ipv6/Kconfig:150:config IPV6_VTI\nnet/ipv6/Kconfig-151-\ttristate \"Virtual (secure) IPv6: tunneling\"\n--\nnet/ipv6/Kconfig-161-\nnet/ipv6/Kconfig:162:config IPV6_SIT\nnet/ipv6/Kconfig-163-\ttristate \"IPv6: IPv6-in-IPv4 tunnel (SIT driver)\"\n--\nnet/ipv6/Kconfig-176-\nnet/ipv6/Kconfig:177:config IPV6_SIT_6RD\nnet/ipv6/Kconfig-178-\tbool \"IPv6: IPv6 Rapid Deployment (6RD)\"\n--\nnet/ipv6/Kconfig-195-\nnet/ipv6/Kconfig:196:config IPV6_NDISC_NODETYPE\nnet/ipv6/Kconfig-197-\tbool\nnet/ipv6/Kconfig-198-\nnet/ipv6/Kconfig:199:config IPV6_TUNNEL\nnet/ipv6/Kconfig-200-\ttristate \"IPv6: IP-in-IPv6 tunnel (RFC2473)\"\n--\nnet/ipv6/Kconfig-209-\nnet/ipv6/Kconfig:210:config IPV6_GRE\nnet/ipv6/Kconfig-211-\ttristate \"IPv6: GRE tunnel\"\n--\nnet/ipv6/Kconfig-227-\nnet/ipv6/Kconfig:228:config IPV6_FOU\nnet/ipv6/Kconfig-229-\ttristate\n--\nnet/ipv6/Kconfig-231-\nnet/ipv6/Kconfig:232:config IPV6_FOU_TUNNEL\nnet/ipv6/Kconfig-233-\ttristate\n--\nnet/ipv6/Kconfig-236-\nnet/ipv6/Kconfig:237:config IPV6_MULTIPLE_TABLES\nnet/ipv6/Kconfig-238-\tbool \"IPv6: Multiple Routing Tables\"\n--\nnet/ipv6/Kconfig-242-\nnet/ipv6/Kconfig:243:config IPV6_SUBTREES\nnet/ipv6/Kconfig-244-\tbool \"IPv6: source address based routing\"\n--\nnet/ipv6/Kconfig-256-\nnet/ipv6/Kconfig:257:config IPV6_MROUTE\nnet/ipv6/Kconfig-258-\tbool \"IPv6: multicast routing\"\n--\nnet/ipv6/Kconfig-264-\nnet/ipv6/Kconfig:265:config IPV6_MROUTE_MULTIPLE_TABLES\nnet/ipv6/Kconfig-266-\tbool \"IPv6: multicast policy routing\"\n--\nnet/ipv6/Kconfig-278-\nnet/ipv6/Kconfig:279:config IPV6_PIMSM_V2\nnet/ipv6/Kconfig-280-\tbool \"IPv6: PIM-SM version 2 support\"\n--\nnet/ipv6/Kconfig-285-\nnet/ipv6/Kconfig:286:config IPV6_SEG6_LWTUNNEL\nnet/ipv6/Kconfig-287-\tbool \"IPv6: Segment Routing Header encapsulation support\"\n--\nnet/ipv6/Kconfig-299-\nnet/ipv6/Kconfig:300:config IPV6_SEG6_HMAC\nnet/ipv6/Kconfig-301-\tbool \"IPv6: Segment Routing HMAC support\"\n--\nnet/ipv6/Kconfig-311-\nnet/ipv6/Kconfig:312:config IPV6_SEG6_BPF\nnet/ipv6/Kconfig-313-\tdef_bool y\n--\nnet/ipv6/Kconfig-316-\nnet/ipv6/Kconfig:317:config IPV6_RPL_LWTUNNEL\nnet/ipv6/Kconfig-318-\tbool \"IPv6: RPL Source Routing Header support\"\n--\nnet/ipv6/Kconfig-327-\nnet/ipv6/Kconfig:328:config IPV6_IOAM6_LWTUNNEL\nnet/ipv6/Kconfig-329-\tbool \"IPv6: IOAM Pre-allocated Trace insertion support\"\n--\nnet/mptcp/Kconfig=14=if MPTCP\nnet/mptcp/Kconfig-15-\nnet/mptcp/Kconfig:16:config INET_MPTCP_DIAG\nnet/mptcp/Kconfig-17-\tdepends on INET_DIAG\n--\nnet/psp/Kconfig-4-#\nnet/psp/Kconfig:5:config INET_PSP\nnet/psp/Kconfig-6-\tbool \"PSP Security Protocol support\"\n--\nnet/sctp/Kconfig=68=endchoice\nnet/sctp/Kconfig-69-\nnet/sctp/Kconfig:70:config INET_SCTP_DIAG\nnet/sctp/Kconfig-71-\tdepends on INET_DIAG\n"
}

27/2 2026/09/02 09:17 llm patch-evaluator
3m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 22038
							output: 186
							thoughts: 446
						

Thoughts:
**Fuzzing Analysis - IP Stack Core**

Okay, so I've just gone through the key steps for this fuzzing analysis. I've confirmed that `CONFIG_INET` and `CONFIG_IPV6` are the main config options driving this, and I briefly scanned for any others that might be relevant, particularly for testing purposes, but those are the primary two.

Next, I re-confirmed the `FocusSymbols`, which are the critical functions we're targeting: `ip_append_data`, `ip_make_skb`, `ip6_append_data`, `ip6_make_skb`, `ip6_mtu`, and `ip6_forward`.

I then expanded my search to see if these `FocusSymbols` had any related symbols. I checked how `ip_setup_cork`, `ip6_setup_cork`, and `ip6_dst_mtu_maybe_forward` are called, which were indeed called by those `FocusSymbols`, as expected. I did a thorough grep and cross-reference, so I can confidently say I've covered all call sites.

Finally, I reviewed the requirements: `WorthFuzzing` is set to true, the `FocusSymbols` are correct, `EnableConfigs` are `INET` and `IPV6`, and the reasoning is clear. Everything checks out. Time to move on and set the results.



28/2 2026/09/02 09:21 tool set-results
0m Args:
{
  "EnableConfigs": [
    "INET",
    "IPV6"
  ],
  "FocusSymbols": [
    "ip_append_data",
    "ip_make_skb",
    "ip6_append_data",
    "ip6_make_skb",
    "ip6_mtu",
    "ip6_forward"
  ],
  "Reasoning": "The patch enforces MTU limits (IP_MAX_MTU / IP6_MAX_MTU) during corking and IPv6 destination MTU lookup in IPv4 and IPv6 output paths (ip_setup_cork, ip6_setup_cork, ip6_dst_mtu_maybe_forward) to prevent 16-bit UDP datagram length overflow. This alters functional packet corking and route MTU handling in core networking code.",
  "WorthFuzzing": true
}

Results:
{
  "EnableConfigs": [
    "INET",
    "IPV6"
  ],
  "FocusSymbols": [
    "ip_append_data",
    "ip_make_skb",
    "ip6_append_data",
    "ip6_make_skb",
    "ip6_mtu",
    "ip6_forward"
  ],
  "Reasoning": "The patch enforces MTU limits (IP_MAX_MTU / IP6_MAX_MTU) during corking and IPv6 destination MTU lookup in IPv4 and IPv6 output paths (ip_setup_cork, ip6_setup_cork, ip6_dst_mtu_maybe_forward) to prevent 16-bit UDP datagram length overflow. This alters functional packet corking and route MTU handling in core networking code.",
  "WorthFuzzing": true
}

29/1 2026/09/02 09:21 action If
2m Args:
{
  "WorthFuzzing": true
}

Results:
null

30/2 2026/09/02 09:21 agent kmsan-evaluator
2m Model:
core

Args:
null

Results:
{
  "KMSANReasoning": "The patch clamps the MTU and cork fragmentation size to IP_MAX_MTU (IPv4) and IP6_MAX_MTU (IPv6) in `ip_setup_cork`, `ip6_setup_cork`, and `ip6_dst_mtu_maybe_forward`, alongside adding a selftest. This prevents integer overflow of the 16-bit UDP header length field when network devices are configured with very large MTU values (\u003e 65535).\n\nKMSAN is designed to detect reads of uninitialized memory and information leaks to user space. This patch does not allocate new memory buffers, alter structure initialization/padding, change user-space copy logic, or introduce branches depending on uninitialized variables. Clamping MTU values ensures packet length bounds stay within protocol limits. Consequently, there are no uninitialized memory risks, and 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:
For your convenience, here is the diff of the changes:
commit 4192f843c78d10676badb369a0c641aefefa71fc
Author: syz-cluster <triage@syzkaller.com>
Date:   Wed Sep 2 09:14:06 2026 +0000

    syz-cluster: applied patch under review

diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index c69f1c8719223..b9e8d2b759e9b 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -384,6 +384,8 @@ static inline unsigned int ip6_dst_mtu_maybe_forward(const struct dst_entry *dst
 	rcu_read_unlock();
 
 out:
+	mtu = min_t(unsigned int, mtu, IP6_MAX_MTU);
+
 	return mtu - lwtunnel_headroom(dst->lwtstate, mtu);
 }
 
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 74e095b6b7ca0..a24cc8ee11d3e 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1303,6 +1303,7 @@ static int ip_setup_cork(struct sock *sk, struct inet_cork *cork,
 
 	cork->fragsize = ip_sk_use_pmtu(sk) ?
 			 dst4_mtu(&rt->dst) : READ_ONCE(rt->dst.dev->mtu);
+	cork->fragsize = min(cork->fragsize, IP_MAX_MTU);
 
 	if (!inetdev_valid_mtu(cork->fragsize))
 		return -ENETUNREACH;
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 8fc4766c8da90..5509650589915 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1432,6 +1432,8 @@ static int ip6_setup_cork(struct sock *sk, struct inet_cork_full *cork,
 	if (frag_size && frag_size < mtu)
 		mtu = frag_size;
 
+	if (sk_is_udp(sk))
+		mtu = min(mtu, IP6_MAX_MTU);
 	cork->base.fragsize = mtu;
 	cork->base.gso_size = ipc6->gso_size;
 	cork->base.tx_flags = 0;
diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile
index 517c09d60bef7..3ee3378f8b26e 100644
--- a/tools/testing/selftests/net/Makefile
+++ b/tools/testing/selftests/net/Makefile
@@ -25,6 +25,7 @@ TEST_PROGS := \
 	cmsg_so_mark.sh \
 	cmsg_so_priority.sh \
 	cmsg_time.sh \
+	cork_fragsize.py \
 	double_udp_encap.sh \
 	drop_monitor_tests.sh \
 	ecmp_rehash.sh \
diff --git a/tools/testing/selftests/net/cork_fragsize.py b/tools/testing/selftests/net/cork_fragsize.py
new file mode 100755
index 0000000000000..7afd643d07ec2
--- /dev/null
+++ b/tools/testing/selftests/net/cork_fragsize.py
@@ -0,0 +1,187 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: GPL-2.0
+
+'''Test possible UDP length overflow in udp_send_skb/udp_v6_send_skb.'''
+
+import errno
+import gzip
+import os
+import socket
+import struct
+import subprocess
+from contextlib import contextmanager
+
+from lib.py import (
+    KsftNamedVariant,
+    KsftSkipEx,
+    NetNS,
+    NetNSEnter,
+    defer,
+    ip,
+    ksft_eq,
+    ksft_exit,
+    ksft_pr,
+    ksft_raises,
+    ksft_run,
+    ksft_true,
+    ksft_variants,
+)
+
+IP_MTU_DISCOVER = 10
+IP_PMTUDISC_PROBE = 3
+IPV6_MTU_DISCOVER = 23
+IPV6_PMTUDISC_DO = 2
+IPV6_PMTUDISC_PROBE = 3
+IPV6_TLV_JUMBO = 194
+
+
+def check_kernel_config(option: str) -> bool | None:
+    '''
+    Check whether the option is enabled in the config of the running kernel.
+    Returns None if the config is not found; otherwise returns True/False
+    depending on the option value in the config.
+    '''
+
+    for filename, method in [
+        ('/proc/config.gz', gzip.open),
+        (f'/boot/config-{os.uname().release}', open),
+    ]:
+        try:
+            with method(filename, 'rt') as config:
+                for line in config:
+                    if line.rstrip() == f'{option}=y':
+                        return True
+                return False
+        except OSError:
+            continue
+        return None
+
+
+def assert_debug_kernel() -> None:
+    '''
+    Skip the test if CONFIG_DEBUG_NET is not set in the kernel config.
+    '''
+
+    res = check_kernel_config('CONFIG_DEBUG_NET')
+    if res is None:
+        ksft_pr("WARN: Can't read kernel config; assuming debug kernel, and running the test")
+    elif not res:
+        raise KsftSkipEx('CONFIG_DEBUG_NET is not set')
+
+
+def check_dmesg_clean(func: str) -> bool:
+    '''
+    Check if the given function produced a WARN in dmesg.
+    '''
+
+    with subprocess.Popen(['dmesg'], stdout=subprocess.PIPE) as dmesg:
+        res = subprocess.run(['grep', '-q', f'WARNING:.*{func}'], stdin=dmesg.stdout, check=False)
+    return res.returncode != 0 and dmesg.returncode == 0
+
+
+@contextmanager
+def dummy_netdev(ns: NetNS, mtu: int, ipv6: bool) -> None:
+    '''
+    Create a dummy netdev inside the given namespace, and tune it for the test.
+    '''
+
+    ip('link add dummy type dummy', ns=ns)
+    with defer(ip, 'link del dummy', ns=ns):
+        ip(f'link set dummy mtu {mtu}', ns=ns)
+        ip('link set dummy up', ns=ns)
+        flag = '-6' if ipv6 else ''
+        nodad = 'nodad' if ipv6 else ''
+        local = 'fd00::1/64' if ipv6 else '10.0.0.1/24'
+        remote = 'fd00::2' if ipv6 else '10.0.0.2'
+        ip(f'{flag} addr add {local} dev dummy {nodad}', ns=ns)
+        ip(f'{flag} neigh add {remote} lladdr 02:00:00:00:00:02 dev dummy nud permanent', ns=ns)
+        yield
+
+
+@ksft_variants([
+    KsftNamedVariant(
+        'ipv6',
+        True,
+        socket.AF_INET6,
+        (socket.IPPROTO_IPV6, IPV6_MTU_DISCOVER, IPV6_PMTUDISC_DO),
+        'fd00::2',
+        'udp_v6_send_skb',
+    ),
+    KsftNamedVariant(
+        'ipv4',
+        False,
+        socket.AF_INET,
+        (socket.IPPROTO_IP, IP_MTU_DISCOVER, IP_PMTUDISC_PROBE),
+        '10.0.0.2',
+        'udp_send_skb',
+    ),
+])
+def test_udp(
+    ipv6: bool,
+    af: socket.AddressFamily,
+    sockopts: tuple[int, int, int],
+    destip: str,
+    func: str
+) -> None:
+    '''
+    Test that sending an oversized UDP packet over a UDP socket doesn't overflow
+    the 16-bit length field in the UDP header, which could happen on older
+    kernels in udp_send_skb/udp_v6_send_skb.
+
+    IPv4: The packet will be dropped with EMSGSIZE, but the overflow could
+    happen before it happens. The only way to test this is to check dmesg on
+    CONFIG_DEBUG_NET=y kernels that have udp_set_len_short with the warning.
+
+    IPv6: The packet will be dropped with EMSGSIZE on fixed kernels, and will be
+    sent corrupted on older kernels. Test both: sendto must return EMSGSIZE, and
+    dmesg must be clean of warnings on CONFIG_DEBUG_NET=y kernels.
+    '''
+
+    if not ipv6:
+        assert_debug_kernel()
+
+    with (
+        NetNS() as ns,
+        dummy_netdev(ns, 65556 + 20 * ipv6, ipv6),
+        NetNSEnter(ns),
+        socket.socket(af, socket.SOCK_DGRAM) as fd,
+    ):
+        fd.setsockopt(*sockopts)
+        with ksft_raises(OSError) as e:
+            fd.sendto(b' ' * 65528, (destip, 1234))
+        # IPv6: EMSGSIZE happens on kernels with the fix.
+        # IPv4: EMSGSIZE happens on both fixed and unfixed kernels, after the
+        #       WARN is printed - ignore it and rely on the dmesg check.
+        if e.exception is not None:
+            ksft_eq(e.exception.errno, errno.EMSGSIZE)
+
+    ksft_true(check_dmesg_clean(func), 'WARNING detected in dmesg')
+
+
+def test_ipv6_jumbo() -> None:
+    '''
+    Test that sending UDP jumbograms over a raw IPv6 socket works, despite
+    having the fix for oversized UDP packets. sendto must not raise an OSError
+    exception (when raised, the test fails automatically).
+    '''
+
+    with (
+        NetNS() as ns,
+        dummy_netdev(ns, 65584, True),
+        NetNSEnter(ns),
+        socket.socket(socket.AF_INET6, socket.SOCK_RAW, socket.IPPROTO_UDP) as fd,
+    ):
+        hopopts = struct.pack('!BBBBI', 0, 0, IPV6_TLV_JUMBO, 4, 65544)
+        fd.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_HOPOPTS, hopopts)
+        fd.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_CHECKSUM, 6)
+        fd.setsockopt(socket.IPPROTO_IPV6, IPV6_MTU_DISCOVER, IPV6_PMTUDISC_PROBE)
+        udp = struct.pack('!HHHH', 1234, 1234, 0, 0) + b' ' * 65528
+        fd.sendto(udp, ('fd00::2', 0))
+
+
+if __name__ == "__main__":
+    ksft_run([
+        test_udp,
+        test_ipv6_jumbo,
+    ])
+    ksft_exit()

31/3 2026/09/02 09:21 llm kmsan-evaluator
1m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 4984
							output: 28
							thoughts: 393
						

Thoughts:
**KMSAN Fuzzing Session Assessment**

Okay, let's break down this patch and figure out if we need to throw a KMSAN fuzzing session at it. First, let's look at the actual changes: we've got a few adjustments related to MTU calculations. Specifically, we're seeing `min_t` or `min` calls constraining values (MTU or `fragsize`) to either `IP6_MAX_MTU` or `IP_MAX_MTU` in `ip6_dst_mtu_maybe_forward` (IPv6 routing), `ip_setup_cork` (IPv4 output), and `ip6_setup_cork` (IPv6 output), as well as some updates to selftests.

Now, what problem are we trying to solve? The description states this patch is dealing with a potential UDP length overflow issue within `udp_send_skb` and `udp_v6_send_skb`, and ensuring that sending oversized UDP packets doesn't corrupt the 16-bit length field in the UDP header, which apparently could be an issue on older kernels.

Given the nature of the fix, related to constraining MTU and fragment sizes, I want to take a closer look at the contexts where these limits are applied. I should probably grep for `IP6_MAX_MTU` and `IP_MAX_MTU`, and more importantly, read the surrounding code in those functions, specifically around `ip_setup_cork`, `ip6_setup_cork`, and `ip6_dst_mtu_maybe_forward`, to fully understand the flow. I need to understand how these limits interact with other potential overflows and vulnerabilities. I'm especially interested in how the values are used after these `min` calls. We need to be thorough with this one; there could be subtle issues. Depending on what I see in those code snippets, it could very well warrant a fuzzing session. The fix itself seems relatively straightforward, but the potential ramifications of a UDP length overflow are definitely worth a deeper dive.



32/3 2026/09/02 09:22 tool grepper
0m Args:
{
  "Expression": "IP_MAX_MTU",
  "PathPrefix": "net/"
}

Results:
{
  "Output": "net/ipv4/esp4.c=309=static struct ip_esp_hdr *esp_output_udp_encap(struct sk_buff *skb,\n--\nnet/ipv4/esp4.c-319-\tlen = skb-\u003elen + esp-\u003etailen - skb_transport_offset(skb);\nnet/ipv4/esp4.c:320:\tif (len + sizeof(struct iphdr) \u003e IP_MAX_MTU)\nnet/ipv4/esp4.c-321-\t\treturn ERR_PTR(-EMSGSIZE);\n--\nnet/ipv4/esp4.c=340=static struct ip_esp_hdr *esp_output_tcp_encap(struct xfrm_state *x,\n--\nnet/ipv4/esp4.c-349-\tlen = skb-\u003elen + esp-\u003etailen - skb_transport_offset(skb);\nnet/ipv4/esp4.c:350:\tif (len \u003e IP_MAX_MTU)\nnet/ipv4/esp4.c-351-\t\treturn ERR_PTR(-EMSGSIZE);\n--\nnet/ipv4/igmp.c=397=static struct sk_buff *igmpv3_newpack(struct net_device *dev, unsigned int mtu)\n--\nnet/ipv4/igmp.c-408-\nnet/ipv4/igmp.c:409:\tsize = min(mtu, IP_MAX_MTU);\nnet/ipv4/igmp.c-410-\twhile (1) {\n--\nnet/ipv4/ip_output.c=953=static int __ip_append_data(struct sock *sk,\n--\nnet/ipv4/ip_output.c-983-\texthdrlen = !skb ? rt-\u003edst.header_len : 0;\nnet/ipv4/ip_output.c:984:\tmtu = cork-\u003egso_size ? IP_MAX_MTU : cork-\u003efragsize;\nnet/ipv4/ip_output.c-985-\tpaged = !!cork-\u003egso_size;\n--\nnet/ipv4/ip_output.c-990-\tmaxfraglen = ((mtu - fragheaderlen) \u0026 ~7) + fragheaderlen;\nnet/ipv4/ip_output.c:991:\tmaxnonfragsize = ip_sk_ignore_df(sk) ? IP_MAX_MTU : mtu;\nnet/ipv4/ip_output.c-992-\n--\nnet/ipv4/ip_output.c=1294=static int ip_setup_cork(struct sock *sk, struct inet_cork *cork,\n--\nnet/ipv4/ip_output.c-1305-\t\t\t dst4_mtu(\u0026rt-\u003edst) : READ_ONCE(rt-\u003edst.dev-\u003emtu);\nnet/ipv4/ip_output.c:1306:\tcork-\u003efragsize = min(cork-\u003efragsize, IP_MAX_MTU);\nnet/ipv4/ip_output.c-1307-\n--\nnet/ipv4/ip_tunnel.c=280=static int ip_tunnel_bind_dev(struct net_device *dev)\n--\nnet/ipv4/ip_tunnel.c-316-\t\thlen = tdev-\u003ehard_header_len + tdev-\u003eneeded_headroom;\nnet/ipv4/ip_tunnel.c:317:\t\tmtu = min(tdev-\u003emtu, IP_MAX_MTU);\nnet/ipv4/ip_tunnel.c-318-\t}\n--\nnet/ipv4/ip_tunnel.c=329=static struct ip_tunnel *ip_tunnel_create(struct net *net,\n--\nnet/ipv4/ip_tunnel.c-350-\tdev-\u003emin_mtu = ETH_MIN_MTU;\nnet/ipv4/ip_tunnel.c:351:\tdev-\u003emax_mtu = IP_MAX_MTU - t_hlen;\nnet/ipv4/ip_tunnel.c-352-\tif (dev-\u003etype == ARPHRD_ETHER)\n--\nnet/ipv4/ip_tunnel.c=1057=int ip_tunnel_change_mtu(struct net_device *dev, int new_mtu)\n--\nnet/ipv4/ip_tunnel.c-1060-\tint t_hlen = tunnel-\u003ehlen + sizeof(struct iphdr);\nnet/ipv4/ip_tunnel.c:1061:\tint max_mtu = IP_MAX_MTU - t_hlen;\nnet/ipv4/ip_tunnel.c-1062-\n--\nnet/ipv4/ip_tunnel.c=1182=int ip_tunnel_newlink(struct net *net, struct net_device *dev,\n--\nnet/ipv4/ip_tunnel.c-1213-\tif (tb[IFLA_MTU]) {\nnet/ipv4/ip_tunnel.c:1214:\t\tunsigned int max = IP_MAX_MTU - (nt-\u003ehlen + sizeof(struct iphdr));\nnet/ipv4/ip_tunnel.c-1215-\n--\nnet/ipv4/route.c=1445=u32 ip_mtu_from_fib_result(struct fib_result *res, __be32 daddr)\n--\nnet/ipv4/route.c-1464-\tif (likely(!mtu))\nnet/ipv4/route.c:1465:\t\tmtu = min(READ_ONCE(dev-\u003emtu), IP_MAX_MTU);\nnet/ipv4/route.c-1466-\n--\nnet/ipv6/esp6.c=371=static struct ip_esp_hdr *esp6_output_tcp_encap(struct xfrm_state *x,\n--\nnet/ipv6/esp6.c-380-\tlen = skb-\u003elen + esp-\u003etailen - skb_transport_offset(skb);\nnet/ipv6/esp6.c:381:\tif (len \u003e IP_MAX_MTU)\nnet/ipv6/esp6.c-382-\t\treturn ERR_PTR(-EMSGSIZE);\n--\nnet/ipv6/ip6_tunnel.c=1753=int ip6_tnl_change_mtu(struct net_device *dev, int new_mtu)\n--\nnet/ipv6/ip6_tunnel.c-1769-\t} else {\nnet/ipv6/ip6_tunnel.c:1770:\t\tif (new_mtu \u003e IP_MAX_MTU - dev-\u003ehard_header_len - t_hlen)\nnet/ipv6/ip6_tunnel.c-1771-\t\t\treturn -EINVAL;\n--\nnet/ipv6/ip6_vti.c=911=static void vti6_dev_setup(struct net_device *dev)\n--\nnet/ipv6/ip6_vti.c-919-\tdev-\u003emin_mtu = IPV4_MIN_MTU;\nnet/ipv6/ip6_vti.c:920:\tdev-\u003emax_mtu = IP_MAX_MTU - sizeof(struct ipv6hdr);\nnet/ipv6/ip6_vti.c-921-\tdev-\u003eflags |= IFF_NOARP;\n--\nnet/xfrm/xfrm_interface_core.c=739=static void xfrmi_dev_setup(struct net_device *dev)\n--\nnet/xfrm/xfrm_interface_core.c-745-\tdev-\u003emin_mtu\t\t= ETH_MIN_MTU;\nnet/xfrm/xfrm_interface_core.c:746:\tdev-\u003emax_mtu\t\t= IP_MAX_MTU;\nnet/xfrm/xfrm_interface_core.c-747-\tdev-\u003eflags \t\t= IFF_NOARP;\n--\nnet/xfrm/xfrm_iptfs.c=2505=static u32 iptfs_get_inner_mtu(struct xfrm_state *x, int outer_mtu)\n--\nnet/xfrm/xfrm_iptfs.c-2510-\tif (!xtfs-\u003ecfg.dont_frag)\nnet/xfrm/xfrm_iptfs.c:2511:\t\treturn x-\u003eouter_mode.family == AF_INET ? IP_MAX_MTU : IP6_MAX_MTU;\nnet/xfrm/xfrm_iptfs.c-2512-\treturn __iptfs_get_inner_mtu(x, outer_mtu);\n--\nnet/xfrm/xfrm_user.c=907=static struct xfrm_state *xfrm_state_construct(struct net *net,\n--\nnet/xfrm/xfrm_user.c-956-\t\tx-\u003etfcpad = nla_get_u32(attrs[XFRMA_TFCPAD]);\nnet/xfrm/xfrm_user.c:957:\t\tif (x-\u003etfcpad \u003e IP_MAX_MTU) {\nnet/xfrm/xfrm_user.c-958-\t\t\tNL_SET_ERR_MSG(extack, \"Excessive TFC padding\");\n"
}

33/3 2026/09/02 09:22 llm kmsan-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 8136
							output: 38
							thoughts: 44
						

Thoughts:
Here's my summary, as though I'm thinking through this process:

**Diving into IPv6 Routing**

Okay, so I need to get a handle on how IPv6 routing is handled. My instincts are telling me to start by looking at the core data structures and functions. I think a good starting point is `include/net/ip6_route.h`, specifically around line 384. I'm expecting to find the key route structures defined there, maybe some macros or inline functions for manipulating them. I want to understand how the routing table is structured and how routes are represented.

Then, I'll switch gears and look at the actual output path – how the kernel *uses* those routes. My gut says to check out `net/ipv6/ip6_output.c`, likely around line 1432. That's where I anticipate finding the core function responsible for actually sending out IPv6 packets after the routing decision has been made. I'll be looking for how the kernel selects the outgoing interface, sets the next hop, and handles any necessary fragmentation or header adjustments. I want to see how these two pieces – the route information and the output processing – are tied together. I will also be looking for any hints on how policy routing is implemented.



34/3 2026/09/02 09:22 tool read-file
0m Args:
{
  "File": "include/net/ip6_route.h",
  "FirstLine": 360,
  "LineCount": 35
}

Results:
{
  "Contents": " 360:\t\tnha = a-\u003efib6_nh;\n 361:\t\tnhb = b-\u003efib6_nh;\n 362:\t\treturn nha-\u003efib_nh_dev == nhb-\u003efib_nh_dev \u0026\u0026\n 363:\t\t       ipv6_addr_equal(\u0026nha-\u003efib_nh_gw6, \u0026nhb-\u003efib_nh_gw6) \u0026\u0026\n 364:\t\t       !lwtunnel_cmp_encap(nha-\u003efib_nh_lws, nhb-\u003efib_nh_lws);\n 365:\t}\n 366:\t\n 367:\tstatic inline unsigned int ip6_dst_mtu_maybe_forward(const struct dst_entry *dst,\n 368:\t\t\t\t\t\t\t     bool forwarding)\n 369:\t{\n 370:\t\tstruct inet6_dev *idev;\n 371:\t\tunsigned int mtu;\n 372:\t\n 373:\t\tif (!forwarding || dst_metric_locked(dst, RTAX_MTU)) {\n 374:\t\t\tmtu = dst_metric_raw(dst, RTAX_MTU);\n 375:\t\t\tif (mtu)\n 376:\t\t\t\tgoto out;\n 377:\t\t}\n 378:\t\n 379:\t\tmtu = IPV6_MIN_MTU;\n 380:\t\trcu_read_lock();\n 381:\t\tidev = __in6_dev_get(dst_dev_rcu(dst));\n 382:\t\tif (idev)\n 383:\t\t\tmtu = READ_ONCE(idev-\u003ecnf.mtu6);\n 384:\t\trcu_read_unlock();\n 385:\t\n 386:\tout:\n 387:\t\tmtu = min_t(unsigned int, mtu, IP6_MAX_MTU);\n 388:\t\n 389:\t\treturn mtu - lwtunnel_headroom(dst-\u003elwtstate, mtu);\n 390:\t}\n 391:\t\n 392:\t/* Configured/administrative MTU of a route, for advertising the TCP MSS.\n 393:\t *\n 394:\t * Unlike ip6_dst_mtu_maybe_forward(), this ignores any ICMPv6-learned path\n"
}

35/3 2026/09/02 09:22 llm kmsan-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 9081
							output: 40
							thoughts: 25
						

Thoughts:
Here's my take on the thought process:

**Diving Deep into IPv6 Output**

Okay, so we're looking at network performance, specifically IPv6 output. I'm going to start digging into the `net/ipv6/ip6_output.c` file. I've got a hunch there's something interesting around line 1432. I need to refresh my memory on that section of the output path. It's often in those deep code segments where you uncover the real bottlenecks or inefficient data handling procedures. Let's see if this hunch pans out.



36/3 2026/09/02 09:22 tool read-file
0m Args:
{
  "File": "net/ipv6/ip6_output.c",
  "FirstLine": 1410,
  "LineCount": 40
}

Results:
{
  "Contents": "1410:\t\n1411:\t\t\tnopt-\u003ehopopt = ip6_opt_dup(opt-\u003ehopopt, sk-\u003esk_allocation);\n1412:\t\t\tif (opt-\u003ehopopt \u0026\u0026 !nopt-\u003ehopopt)\n1413:\t\t\t\treturn -ENOBUFS;\n1414:\t\n1415:\t\t\tnopt-\u003esrcrt = ip6_rthdr_dup(opt-\u003esrcrt, sk-\u003esk_allocation);\n1416:\t\t\tif (opt-\u003esrcrt \u0026\u0026 !nopt-\u003esrcrt)\n1417:\t\t\t\treturn -ENOBUFS;\n1418:\t\n1419:\t\t\t/* need source address above miyazawa*/\n1420:\t\t}\n1421:\t\tv6_cork-\u003ehop_limit = ipc6-\u003ehlimit;\n1422:\t\tv6_cork-\u003etclass = ipc6-\u003etclass;\n1423:\t\tv6_cork-\u003edontfrag = ipc6-\u003edontfrag;\n1424:\t\tif (rt-\u003edst.flags \u0026 DST_XFRM_TUNNEL)\n1425:\t\t\tmtu = READ_ONCE(np-\u003epmtudisc) \u003e= IPV6_PMTUDISC_PROBE ?\n1426:\t\t\t      READ_ONCE(rt-\u003edst.dev-\u003emtu) : dst6_mtu(\u0026rt-\u003edst);\n1427:\t\telse\n1428:\t\t\tmtu = READ_ONCE(np-\u003epmtudisc) \u003e= IPV6_PMTUDISC_PROBE ?\n1429:\t\t\t\tREAD_ONCE(rt-\u003edst.dev-\u003emtu) : dst6_mtu(xfrm_dst_path(\u0026rt-\u003edst));\n1430:\t\n1431:\t\tfrag_size = READ_ONCE(np-\u003efrag_size);\n1432:\t\tif (frag_size \u0026\u0026 frag_size \u003c mtu)\n1433:\t\t\tmtu = frag_size;\n1434:\t\n1435:\t\tif (sk_is_udp(sk))\n1436:\t\t\tmtu = min(mtu, IP6_MAX_MTU);\n1437:\t\tcork-\u003ebase.fragsize = mtu;\n1438:\t\tcork-\u003ebase.gso_size = ipc6-\u003egso_size;\n1439:\t\tcork-\u003ebase.tx_flags = 0;\n1440:\t\tcork-\u003ebase.mark = ipc6-\u003esockc.mark;\n1441:\t\tcork-\u003ebase.priority = ipc6-\u003esockc.priority;\n1442:\t\tsock_tx_timestamp(sk, \u0026ipc6-\u003esockc, \u0026cork-\u003ebase.tx_flags);\n1443:\t\tif (ipc6-\u003esockc.tsflags \u0026 SOCKCM_FLAG_TS_OPT_ID) {\n1444:\t\t\tcork-\u003ebase.flags |= IPCORK_TS_OPT_ID;\n1445:\t\t\tcork-\u003ebase.ts_opt_id = ipc6-\u003esockc.ts_opt_id;\n1446:\t\t}\n1447:\t\tcork-\u003ebase.length = 0;\n1448:\t\tcork-\u003ebase.transmit_time = ipc6-\u003esockc.transmit_time;\n1449:\t\n"
}

37/3 2026/09/02 09:22 llm kmsan-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 10090
							output: 39
							thoughts: 24
						

Thoughts:
Here's a summary of my thought process, as requested:

**Diving Deep into IPv4 Output**

Okay, so we're looking at something related to IPv4 output, and I'm thinking, "Let's dig in and see what's happening at a granular level." The first place that comes to mind, given the context, is `net/ipv4/ip_output.c`. Now, if I remember correctly, there's some crucial logic around line 1303 – that's where I'd start to investigate more closely. It could be related to fragmentation, checksumming, routing decisions, or queue management, but that's where I'd suspect we'd find the core processing of outbound IPv4 packets.



38/3 2026/09/02 09:22 tool read-file
0m Args:
{
  "File": "net/ipv4/ip_output.c",
  "FirstLine": 1290,
  "LineCount": 40
}

Results:
{
  "Contents": "1290:\t\t\tatomic_dec(\u0026sk-\u003esk_tskey);\n1291:\t\treturn err;\n1292:\t}\n1293:\t\n1294:\tstatic int ip_setup_cork(struct sock *sk, struct inet_cork *cork,\n1295:\t\t\t\t struct ipcm_cookie *ipc, struct rtable **rtp)\n1296:\t{\n1297:\t\tstruct ip_options_rcu *opt;\n1298:\t\tstruct rtable *rt;\n1299:\t\n1300:\t\trt = *rtp;\n1301:\t\tif (unlikely(!rt))\n1302:\t\t\treturn -EFAULT;\n1303:\t\n1304:\t\tcork-\u003efragsize = ip_sk_use_pmtu(sk) ?\n1305:\t\t\t\t dst4_mtu(\u0026rt-\u003edst) : READ_ONCE(rt-\u003edst.dev-\u003emtu);\n1306:\t\tcork-\u003efragsize = min(cork-\u003efragsize, IP_MAX_MTU);\n1307:\t\n1308:\t\tif (!inetdev_valid_mtu(cork-\u003efragsize))\n1309:\t\t\treturn -ENETUNREACH;\n1310:\t\n1311:\t\t/*\n1312:\t\t * setup for corking.\n1313:\t\t */\n1314:\t\topt = ipc-\u003eopt;\n1315:\t\tif (opt) {\n1316:\t\t\tif (!cork-\u003eopt) {\n1317:\t\t\t\tcork-\u003eopt = kmalloc(sizeof(struct ip_options) + 40,\n1318:\t\t\t\t\t\t    sk-\u003esk_allocation);\n1319:\t\t\t\tif (unlikely(!cork-\u003eopt))\n1320:\t\t\t\t\treturn -ENOBUFS;\n1321:\t\t\t}\n1322:\t\t\tmemcpy(cork-\u003eopt, \u0026opt-\u003eopt, sizeof(struct ip_options) + opt-\u003eopt.optlen);\n1323:\t\t\tcork-\u003eflags |= IPCORK_OPT;\n1324:\t\t\tcork-\u003eaddr = ipc-\u003eaddr;\n1325:\t\t}\n1326:\t\n1327:\t\tcork-\u003egso_size = ipc-\u003egso_size;\n1328:\t\n1329:\t\tcork-\u003edst = \u0026rt-\u003edst;\n"
}

39/3 2026/09/02 09:22 llm kmsan-evaluator
0m Model:
gemini-3.7-flash

Args:
null

Results:
null

Tokens:
							input: 10926
							output: 218
							thoughts: 468
						

Thoughts:
**KMSAN Assessment: This Patch is Safe**

Okay, let's break this down. Analyzing this patch, it seems straightforward. The core function here clamps the Maximum Transmission Unit (MTU) and fragment size to the maximum defined values for IPv4 and IPv6 (`IP_MAX_MTU` and `IP6_MAX_MTU`, respectively) during cork setup and route MTU calculations. The goal? To prevent integer overflows, especially within the UDP header's length field, when a device MTU is unusually large (think anything exceeding 65535, like you might see with a dummy device).

Now, the important questions: Does this patch introduce any risks related to uninitialized memory? Let's go through the checklist.

1.  **User-Space Exposure:** Nope. Nothing here touches user-space structures that could lead to uninitialized fields being exposed via copy_to_user, Netlink messages, or socket options. We're not sending anything new out.
2.  **Conditional Logic:** No. The code uses initialized variables. MTU and `cork->fragsize` are explicitly set, so no branching depends on uninitialized fields.
3.  **Complex Data Structures:** Again, no. We're not allocating and initializing complex data structures where uninitialized fields could cause problems later on.
4.  **Bounds Checks:** In fact, it's the opposite! This patch is all about *improving* bounds checks. We are *decreasing* or capping the MTU values to prevent integer overflows and oversized packets, not increasing them.

So, am I seeing any potential for uninitialized memory risks? The answer is a definitive "no". This is purely about fixing a specific integer overflow issue in UDP length calculation when the device MTU exceeds 64KB. This patch is a very targeted fix.

Therefore, KMSAN shouldn't be concerned here. We're not introducing or exposing any uninitialized memory usage or potential for info leaks. Standard sanitizers like KASAN, and the typical debugging assertions should handle the expected issues. KMSAN's purpose, in this case, is not necessary. We should be good to mark `NeedsKMSAN` as false, and get ready to document the reasoning!



40/3 2026/09/02 09:23 tool set-results
0m Args:
{
  "KMSANReasoning": "The patch clamps the MTU and cork fragmentation size to IP_MAX_MTU (IPv4) and IP6_MAX_MTU (IPv6) in `ip_setup_cork`, `ip6_setup_cork`, and `ip6_dst_mtu_maybe_forward`, alongside adding a selftest. This prevents integer overflow of the 16-bit UDP header length field when network devices are configured with very large MTU values (\u003e 65535).\n\nKMSAN is designed to detect reads of uninitialized memory and information leaks to user space. This patch does not allocate new memory buffers, alter structure initialization/padding, change user-space copy logic, or introduce branches depending on uninitialized variables. Clamping MTU values ensures packet length bounds stay within protocol limits. Consequently, there are no uninitialized memory risks, and a dedicated KMSAN fuzzing session is not warranted.",
  "NeedsKMSAN": false
}

Results:
{
  "KMSANReasoning": "The patch clamps the MTU and cork fragmentation size to IP_MAX_MTU (IPv4) and IP6_MAX_MTU (IPv6) in `ip_setup_cork`, `ip6_setup_cork`, and `ip6_dst_mtu_maybe_forward`, alongside adding a selftest. This prevents integer overflow of the 16-bit UDP header length field when network devices are configured with very large MTU values (\u003e 65535).\n\nKMSAN is designed to detect reads of uninitialized memory and information leaks to user space. This patch does not allocate new memory buffers, alter structure initialization/padding, change user-space copy logic, or introduce branches depending on uninitialized variables. Clamping MTU values ensures packet length bounds stay within protocol limits. Consequently, there are no uninitialized memory risks, and a dedicated KMSAN fuzzing session is not warranted.",
  "NeedsKMSAN": false
}

LLM Calls Summary:
Total Calls Total Tokens Avg Tokens Total Duration (Seconds) Avg Duration (Seconds)
Tool Calls Summary:
Total Calls Total Duration (Seconds) Avg Duration (Seconds)