AI Trajectory


Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/10/01 02:23 flow patch-triage
3m Args:
null

Results:
{
  "EnableConfigs": [
    "RMNET",
    "NET_VENDOR_QUALCOMM"
  ],
  "FocusSymbols": [
    "rmnet_map_process_next_hdr_packet",
    "rmnet_map_segment_coal_skb",
    "rmnet_map_data_check_coal_header",
    "rmnet_map_coal_segment_loop",
    "rmnet_map_coal_gro_fast_path",
    "rmnet_map_coal_validate_bounds",
    "rmnet_map_coal_parse_ip_hdr",
    "rmnet_map_coal_parse_trans_hdr",
    "__rmnet_map_segment_coal_skb",
    "rmnet_map_v5_csum_fixup",
    "rmnet_map_v5_fixup_num_nlos",
    "rmnet_map_validate_packet_len",
    "rmnet_config_data_format_valid",
    "rmnet_newlink",
    "rmnet_changelink"
  ],
  "KMSANReasoning": "The patch series introduces hardware coalescing (MAPv5 downlink coalescing) support in the Qualcomm RMNET driver. This involves parsing MAPv5 coalescing headers, validating bounds, de-coalescing packets into individual or GSO-stamped SKBs, and exposing coalescing statistics via ethtool.\n\nAnalysis of potential uninitialized memory risks:\n1. Local structs and variables:\n   - `struct rmnet_map_coal_metadata` is explicitly zero-initialized using `memset` before use.\n   - `struct sk_buff_head list` is initialized with `__skb_queue_head_init`.\n   - `nlo_err_mask` is initialized upon successful return from `rmnet_map_data_check_coal_header` and not used on error paths.\n   - In `rmnet_config.c`, `data_format` and `old_data_format` in `rmnet_changelink` are initialized and accessed strictly within the `if (data[IFLA_RMNET_FLAGS])` block.\n2. Kernel-to-userspace data (ethtool \u0026 netlink):\n   - The new counters in `struct rmnet_priv_stats` consist entirely of 64-bit integers (`u64`) with no padding holes.\n   - Device private data `rmnet_priv` is allocated with zero-initialization via `alloc_netdev` / `rtnl_link_ops`.\n   - The count of strings in `rmnet_gstrings_stats` exactly matches the number of `u64` fields in `struct rmnet_priv_stats`, so `rmnet_get_ethtool_stats` copies only initialized counter values without uninitialized data leaks.\n3. SKB payload reconstruction:\n   - For carved SKBs in `__rmnet_map_segment_coal_skb`, the packet buffer is fully populated via `skb_put_data` and header `memcpy` operations without leaving uninitialized gaps in the packet buffer.\n   - Any boundary issues when parsing incoming frame headers or slicing payloads would constitute out-of-bounds memory accesses or length calculation bugs, which are detected by standard KASAN.\n\nBecause there are no uninitialized memory usages or kernel-to-user info-leak risks, and any potential memory corruption or out-of-bounds accesses are covered by KASAN, a dedicated KMSAN fuzzing session is not warranted.",
  "NeedsKMSAN": false,
  "Reasoning": "The patch adds support for MAPv5 downlink packet coalescing in the Qualcomm RmNet driver. RmNet devices are virtual network devices configured via rtnetlink (rtnl_link_ops) that can attach to any network device (e.g., dummy, veth, or tun/tap), without requiring physical hardware. The patch introduces complex packet parsing, validation, skb segmentation, sequence number manipulation, and checksum calculations for coalesced packets in the ingress data path, which is reachable in standard virtualized environments and warrants fuzzing.",
  "WorthFuzzing": true
}

1/1 2026/10/01 02:23 action read-patch-diff
0m Args:
null

Results:
{
  "PatchDiff": "commit f42f799b4c15e45cae56eaf840d351fb243bdd4b\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate:   Thu Oct 1 02:23:49 2026 +0000\n\n    syz-cluster: applied patch under review\n\ndiff --git a/Documentation/networking/device_drivers/cellular/qualcomm/rmnet.rst b/Documentation/networking/device_drivers/cellular/qualcomm/rmnet.rst\nindex 5aedbabb73827..ba8e947d54e68 100644\n--- a/Documentation/networking/device_drivers/cellular/qualcomm/rmnet.rst\n+++ b/Documentation/networking/device_drivers/cellular/qualcomm/rmnet.rst\n@@ -125,8 +125,8 @@ Command (1)/ Data (0) bit value is to indicate if the packet is a MAP command\n or data packet. Command packet is used for transport level flow control. Data\n packets are standard IP packets.\n \n-Next header is used to indicate the presence of another header, currently is\n-limited to checksum header.\n+Next header is used to indicate the presence of another header, currently\n+limited to the checksum and coalescing headers.\n \n Padding is the number of bytes to be appended to the payload to\n ensure 4 byte alignment.\n@@ -150,11 +150,11 @@ Header Type is to indicate the type of header, this usually is set to CHECKSUM\n \n Header types\n \n-= ===============\n+= ======================\n 0 Reserved\n-1 Reserved\n+1 coalescing header\n 2 checksum header\n-= ===============\n+= ======================\n \n Checksum Valid is to indicate whether the header checksum is valid. Value of 1\n implies that checksum is calculated on this packet and is valid, value of 0\n@@ -162,8 +162,78 @@ indicates that the calculated packet checksum is invalid.\n \n Reserved bits must be zero when sent and ignored when received.\n \n-e. MAP packet v1/v5 (command specific)\n---------------------------------------\n+e. Coalescing header v5\n+------------------------\n+\n+Hardware can coalesce multiple same-flow IP packets of the same length into\n+a single MAP frame to reduce per-packet overhead at high data rates.  The\n+coalescing header (header type 1) describes the coalesced content.\n+\n+Packet format::\n+\n+  Bit         0 - 6         7          8           9-11         12-15\n+  Function  Header Type  Next Header  CSUM valid  Num NLOs    (reserved)\n+\n+  Bit        16-19        20-23\n+  Function  Close value  Close type\n+\n+  Bit        24-27        28-31\n+  Function  (reserved)    VEID\n+\n+  Bit           32 - 47        48 - 55            56 - 63\n+  Function   Packet length  CSUM error bitmap  Num packets (NLO 0)\n+\n+  ... (up to 6 NLO entries total, same 32-bit format per entry)\n+\n+Header Type is set to 1 (coalescing).\n+\n+Num NLOs (Number-Length Objects) is the count of active NLO entries\n+(1 – 6).  Each NLO describes a group of consecutive coalesced packets\n+that all share the same IP packet length.\n+\n+CSUM valid (bit 8) indicates whether the hardware checksum is valid\n+for all packets in the frame.\n+\n+Close type and close value encode the hardware reason that coalescing\n+was terminated for this frame:\n+\n+Close type values:\n+\n+= ==============================\n+0 non-coalesced (single packet)\n+1 IP flow miss\n+2 transport flow miss\n+3 hardware limit (see value)\n+4 coalescing closed (FIN/PSH)\n+= ==============================\n+\n+Close value (used when close type is 3):\n+\n+= ==================\n+0 NL limit reached\n+1 packet limit\n+2 byte limit\n+3 time limit\n+4 eviction\n+= ==================\n+\n+VEID is the virtual endpoint ID of the originating flow.\n+\n+Each NLO entry::\n+\n+  Bit         0 - 15        16 - 23            24 - 31\n+  Function  Pkt length   CSUM error bitmap   Num packets\n+\n+Pkt length is the full IP packet length, including the IP header,\n+transport header, and payload, for every packet in this NLO group.\n+\n+CSUM error bitmap is a per-packet bitmask. Bit N is set when packet N\n+in this NLO has a bad checksum.\n+\n+Num packets is the count of coalesced packets described by this NLO.\n+\n+f. MAP packet v1/v5 (command specific)\n+---------------------------------------\n \n Packet format::\n \n@@ -187,7 +257,7 @@ Command types\n 3 is for error during processing of commands\n = ==========================================\n \n-f. Aggregation\n+g. Aggregation\n --------------\n \n Aggregation is multiple MAP packets (can be data or command) delivered to\n@@ -208,3 +278,32 @@ rmnet userspace configuration is done through netlink using iproute2\n https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/\n \n The driver uses rtnl_link_ops for communication.\n+\n+The data format flags controlling the ingress and egress processing\n+pipeline are set via the ``IFLA_RMNET_FLAGS`` attribute\n+(``struct ifla_rmnet_flags``).\n+\n+Relevant ingress flags:\n+\n+``RMNET_FLAGS_INGRESS_DEAGGREGATION``\n+  Enable MAP frame de-aggregation.\n+\n+``RMNET_FLAGS_INGRESS_MAP_CKSUMV4``\n+  Enable MAPv4 downlink checksum offload.\n+\n+``RMNET_FLAGS_INGRESS_MAP_CKSUMV5``\n+  Enable MAPv5 downlink checksum offload (header type 2).\n+\n+``RMNET_FLAGS_INGRESS_COALESCE``\n+  Enable MAPv5 downlink hardware coalescing (header type 1).\n+  When set the driver will decode coalescing headers, reconstruct\n+  individual IP packets and will deliver batched GSO SKBs to the\n+  stack for efficient processing.\n+\n+Relevant egress flags:\n+\n+``RMNET_FLAGS_EGRESS_MAP_CKSUMV4``\n+  Enable MAPv4 uplink checksum offload.\n+\n+``RMNET_FLAGS_EGRESS_MAP_CKSUMV5``\n+  Enable MAPv5 uplink checksum offload.\ndiff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c\nindex 61b04c6c0390e..555659c2edc21 100644\n--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c\n+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c\n@@ -26,6 +26,30 @@ static int rmnet_is_real_dev_registered(const struct net_device *real_dev)\n \treturn rcu_access_pointer(real_dev-\u003erx_handler) == rmnet_rx_handler;\n }\n \n+/* Only three MAP configurations are supported: MAPv1 (no checksum\n+ * offload), MAPv4 (v4 checksum offload) and MAPv5 (v5 checksum\n+ * offload). QMAP command support is orthogonal and permitted with\n+ * any of the three. Mixing v4 and v5 checksum offload flags together\n+ * is not a supported configuration. DL packet coalescing additionally\n+ * requires a MAPv5 configuration.\n+ */\n+static bool rmnet_config_data_format_valid(u32 data_format)\n+{\n+\tu32 v4_mask = RMNET_FLAGS_INGRESS_MAP_CKSUMV4 |\n+\t\t      RMNET_FLAGS_EGRESS_MAP_CKSUMV4;\n+\tu32 v5_mask = RMNET_FLAGS_INGRESS_MAP_CKSUMV5 |\n+\t\t      RMNET_FLAGS_EGRESS_MAP_CKSUMV5;\n+\n+\tif ((data_format \u0026 v4_mask) \u0026\u0026 (data_format \u0026 v5_mask))\n+\t\treturn false;\n+\n+\tif ((data_format \u0026 RMNET_FLAGS_INGRESS_COALESCE) \u0026\u0026\n+\t    !(data_format \u0026 RMNET_FLAGS_INGRESS_MAP_CKSUMV5))\n+\t\treturn false;\n+\n+\treturn true;\n+}\n+\n /* Needs rtnl lock */\n struct rmnet_port*\n rmnet_get_port_rtnl(const struct net_device *real_dev)\n@@ -143,6 +167,20 @@ static int rmnet_newlink(struct net_device *dev,\n \t\treturn -ENODEV;\n \t}\n \n+\tif (data[IFLA_RMNET_FLAGS]) {\n+\t\tstruct ifla_rmnet_flags *flags;\n+\n+\t\tflags = nla_data(data[IFLA_RMNET_FLAGS]);\n+\t\tdata_format \u0026= ~flags-\u003emask;\n+\t\tdata_format |= flags-\u003eflags \u0026 flags-\u003emask;\n+\t}\n+\n+\tif (!rmnet_config_data_format_valid(data_format)) {\n+\t\tNL_SET_ERR_MSG_MOD(extack,\n+\t\t\t\t   \"unsupported MAP checksum flag combination\");\n+\t\treturn -EINVAL;\n+\t}\n+\n \tep = kzalloc_obj(*ep);\n \tif (!ep)\n \t\treturn -ENOMEM;\n@@ -167,14 +205,6 @@ static int rmnet_newlink(struct net_device *dev,\n \n \thlist_add_head_rcu(\u0026ep-\u003ehlnode, \u0026port-\u003emuxed_ep[mux_id]);\n \n-\tif (data[IFLA_RMNET_FLAGS]) {\n-\t\tstruct ifla_rmnet_flags *flags;\n-\n-\t\tflags = nla_data(data[IFLA_RMNET_FLAGS]);\n-\t\tdata_format \u0026= ~flags-\u003emask;\n-\t\tdata_format |= flags-\u003eflags \u0026 flags-\u003emask;\n-\t}\n-\n \tnetdev_dbg(dev, \"data format [0x%08X]\\n\", data_format);\n \tWRITE_ONCE(port-\u003edata_format, data_format);\n \n@@ -301,8 +331,11 @@ static int rmnet_changelink(struct net_device *dev, struct nlattr *tb[],\n \t\t\t    struct netlink_ext_ack *extack)\n {\n \tstruct rmnet_priv *priv = netdev_priv(dev);\n+\tstruct ifla_rmnet_flags *flags;\n \tstruct net_device *real_dev;\n \tstruct rmnet_port *port;\n+\tu32 old_data_format;\n+\tu32 data_format;\n \tu16 mux_id;\n \n \tif (!dev)\n@@ -320,6 +353,19 @@ static int rmnet_changelink(struct net_device *dev, struct nlattr *tb[],\n \n \tport = rmnet_get_port_rtnl(real_dev);\n \n+\tif (data[IFLA_RMNET_FLAGS]) {\n+\t\told_data_format = READ_ONCE(port-\u003edata_format);\n+\t\tflags = nla_data(data[IFLA_RMNET_FLAGS]);\n+\t\tdata_format = old_data_format \u0026 ~flags-\u003emask;\n+\t\tdata_format |= flags-\u003eflags \u0026 flags-\u003emask;\n+\n+\t\tif (!rmnet_config_data_format_valid(data_format)) {\n+\t\t\tNL_SET_ERR_MSG_MOD(extack,\n+\t\t\t\t\t   \"unsupported MAP checksum flag combination\");\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\n \tif (data[IFLA_RMNET_MUX_ID]) {\n \t\tmux_id = nla_get_u16(data[IFLA_RMNET_MUX_ID]);\n \n@@ -346,14 +392,6 @@ static int rmnet_changelink(struct net_device *dev, struct nlattr *tb[],\n \t}\n \n \tif (data[IFLA_RMNET_FLAGS]) {\n-\t\tstruct ifla_rmnet_flags *flags;\n-\t\tu32 old_data_format;\n-\t\tu32 data_format;\n-\n-\t\told_data_format = port-\u003edata_format;\n-\t\tflags = nla_data(data[IFLA_RMNET_FLAGS]);\n-\t\tdata_format = old_data_format \u0026 ~flags-\u003emask;\n-\t\tdata_format |= flags-\u003eflags \u0026 flags-\u003emask;\n \t\tWRITE_ONCE(port-\u003edata_format, data_format);\n \n \t\tif (rmnet_vnd_update_dev_mtu(port, real_dev)) {\ndiff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h\nindex 5adda0323dda7..2a34f8a7b5276 100644\n--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h\n+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h\n@@ -80,6 +80,26 @@ struct rmnet_priv_stats {\n \tu64 csum_skipped;\n \tu64 csum_sw;\n \tu64 csum_hw;\n+\t/* DL coalescing */\n+\tu64 coal_rx;\n+\tu64 coal_pkts;\n+\tu64 coal_hdr_nlo_err;\n+\tu64 coal_hdr_pkt_err;\n+\tu64 coal_csum_err;\n+\tu64 coal_csum_drop;\n+\tu64 coal_reconstruct;\n+\tu64 coal_ip_invalid;\n+\tu64 coal_trans_invalid;\n+\t/* close-reason sub-counters */\n+\tu64 coal_close_non_coal;\n+\tu64 coal_close_ip_miss;\n+\tu64 coal_close_trans_miss;\n+\tu64 coal_close_hw_nl;\n+\tu64 coal_close_hw_pkt;\n+\tu64 coal_close_hw_byte;\n+\tu64 coal_close_hw_time;\n+\tu64 coal_close_hw_evict;\n+\tu64 coal_close_coal;\n };\n \n struct rmnet_priv {\ndiff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c\nindex aa5523f4618eb..bb867ceb01c1c 100644\n--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c\n+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c\n@@ -50,6 +50,16 @@ rmnet_deliver_skb(struct sk_buff *skb)\n \tgro_cells_receive(\u0026priv-\u003egro_cells, skb);\n }\n \n+static void rmnet_deliver_skb_list(struct sk_buff_head *head)\n+{\n+\tstruct sk_buff *skb;\n+\n+\twhile ((skb = __skb_dequeue(head))) {\n+\t\trmnet_set_skb_proto(skb);\n+\t\trmnet_deliver_skb(skb);\n+\t}\n+}\n+\n /* MAP handler */\n \n static void\n@@ -59,6 +69,7 @@ __rmnet_map_ingress_handler(struct sk_buff *skb,\n {\n \tstruct rmnet_map_header *map_header = (void *)skb-\u003edata;\n \tstruct rmnet_endpoint *ep;\n+\tstruct sk_buff_head list;\n \tu16 len, pad;\n \tu8 mux_id;\n \n@@ -83,12 +94,13 @@ __rmnet_map_ingress_handler(struct sk_buff *skb,\n \n \tskb-\u003edev = ep-\u003eegress_dev;\n \n-\tif ((data_format \u0026 RMNET_FLAGS_INGRESS_MAP_CKSUMV5) \u0026\u0026\n+\t__skb_queue_head_init(\u0026list);\n+\n+\tif ((data_format \u0026\n+\t     (RMNET_FLAGS_INGRESS_MAP_CKSUMV5 | RMNET_FLAGS_INGRESS_COALESCE)) \u0026\u0026\n \t    (map_header-\u003eflags \u0026 MAP_NEXT_HEADER_FLAG)) {\n-\t\tif (rmnet_map_process_next_hdr_packet(skb, len))\n+\t\tif (rmnet_map_process_next_hdr_packet(skb, \u0026list, len, data_format))\n \t\t\tgoto free_skb;\n-\t\tskb_pull(skb, sizeof(*map_header));\n-\t\trmnet_set_skb_proto(skb);\n \t} else {\n \t\t/* Subtract MAP header */\n \t\tskb_pull(skb, sizeof(*map_header));\n@@ -96,10 +108,11 @@ __rmnet_map_ingress_handler(struct sk_buff *skb,\n \t\tif (data_format \u0026 RMNET_FLAGS_INGRESS_MAP_CKSUMV4 \u0026\u0026\n \t\t    !rmnet_map_checksum_downlink_packet(skb, len + pad))\n \t\t\tskb-\u003eip_summed = CHECKSUM_UNNECESSARY;\n+\t\tskb_trim(skb, len);\n+\t\t__skb_queue_tail(\u0026list, skb);\n \t}\n \n-\tskb_trim(skb, len);\n-\trmnet_deliver_skb(skb);\n+\trmnet_deliver_skb_list(\u0026list);\n \treturn;\n \n free_skb:\ndiff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h\nindex 0977e495f5915..77ddac6023c01 100644\n--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h\n+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h\n@@ -6,6 +6,22 @@\n #define _RMNET_MAP_H_\n #include \u003clinux/if_rmnet.h\u003e\n \n+enum rmnet_map_v5_close_type {\n+\tRMNET_MAP_COAL_CLOSE_NON_COAL,\n+\tRMNET_MAP_COAL_CLOSE_IP_MISS,\n+\tRMNET_MAP_COAL_CLOSE_TRANS_MISS,\n+\tRMNET_MAP_COAL_CLOSE_HW,\n+\tRMNET_MAP_COAL_CLOSE_COAL,\n+};\n+\n+enum rmnet_map_v5_close_value {\n+\tRMNET_MAP_COAL_CLOSE_HW_NL,\n+\tRMNET_MAP_COAL_CLOSE_HW_PKT,\n+\tRMNET_MAP_COAL_CLOSE_HW_BYTE,\n+\tRMNET_MAP_COAL_CLOSE_HW_TIME,\n+\tRMNET_MAP_COAL_CLOSE_HW_EVICT,\n+};\n+\n struct rmnet_map_control_command {\n \tu8  command_name;\n \tu8  cmd_type:2;\n@@ -53,7 +69,9 @@ void rmnet_map_checksum_uplink_packet(struct sk_buff *skb,\n \t\t\t\t      struct rmnet_port *port,\n \t\t\t\t      struct net_device *orig_dev,\n \t\t\t\t      int csum_type);\n-int rmnet_map_process_next_hdr_packet(struct sk_buff *skb, u16 len);\n+int rmnet_map_process_next_hdr_packet(struct sk_buff *skb,\n+\t\t\t\t      struct sk_buff_head *list,\n+\t\t\t\t      u16 len, u32 data_format);\n unsigned int rmnet_map_tx_aggregate(struct sk_buff *skb, struct rmnet_port *port,\n \t\t\t\t    struct net_device *orig_dev);\n void rmnet_map_tx_aggregate_init(struct rmnet_port *port);\ndiff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c\nindex 39d6d084e73f0..2e76bf5a5a90c 100644\n--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c\n+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c\n@@ -7,7 +7,11 @@\n #include \u003clinux/netdevice.h\u003e\n #include \u003clinux/ip.h\u003e\n #include \u003clinux/ipv6.h\u003e\n+#include \u003clinux/tcp.h\u003e\n+#include \u003clinux/udp.h\u003e\n+#include \u003cnet/ip.h\u003e\n #include \u003cnet/ip6_checksum.h\u003e\n+#include \u003cnet/ipv6.h\u003e\n #include \u003clinux/bitfield.h\u003e\n #include \"rmnet_config.h\"\n #include \"rmnet_map.h\"\n@@ -17,6 +21,19 @@\n #define RMNET_MAP_DEAGGR_SPACING  64\n #define RMNET_MAP_DEAGGR_HEADROOM (RMNET_MAP_DEAGGR_SPACING / 2)\n \n+struct rmnet_map_coal_metadata {\n+\tvoid *ip_header;\n+\tvoid *trans_header;\n+\tu16 ip_len;\n+\tu16 trans_len;\n+\tu16 data_offset;\n+\tu16 data_len;\n+\tu8 ip_proto;\n+\tu8 trans_proto;\n+\tu8 pkt_count;\n+\tbool zero_csum;\n+};\n+\n static __sum16 *rmnet_map_get_csum_field(unsigned char protocol,\n \t\t\t\t\t const void *txporthdr)\n {\n@@ -337,8 +354,8 @@ u32 rmnet_map_validate_packet_len(struct sk_buff *skb, u32 data_format)\n {\n \tstruct rmnet_map_v5_csum_header *next_hdr = NULL;\n \tstruct rmnet_map_header *maph;\n-\tvoid *data = skb-\u003edata;\n \tu32 packet_len;\n+\tu8 hdr_type;\n \n \tif (skb-\u003elen \u003c sizeof(*maph))\n \t\treturn 0;\n@@ -353,24 +370,28 @@ u32 rmnet_map_validate_packet_len(struct sk_buff *skb, u32 data_format)\n \n \tif (data_format \u0026 RMNET_FLAGS_INGRESS_MAP_CKSUMV4) {\n \t\tpacket_len += sizeof(struct rmnet_map_dl_csum_trailer);\n-\t} else if ((data_format \u0026 RMNET_FLAGS_INGRESS_MAP_CKSUMV5) \u0026\u0026\n+\t} else if ((data_format \u0026\n+\t\t    (RMNET_FLAGS_INGRESS_MAP_CKSUMV5 | RMNET_FLAGS_INGRESS_COALESCE)) \u0026\u0026\n \t\t   !(maph-\u003eflags \u0026 MAP_CMD_FLAG)) {\n-\t\t/* Mapv5 data pkt without csum hdr is invalid */\n \t\tif (!(maph-\u003eflags \u0026 MAP_NEXT_HEADER_FLAG))\n \t\t\treturn 0;\n \n-\t\tpacket_len += sizeof(*next_hdr);\n-\t\tnext_hdr = data + sizeof(*maph);\n+\t\tif (skb-\u003elen \u003c sizeof(*maph) + sizeof(*next_hdr))\n+\t\t\treturn 0;\n+\n+\t\tnext_hdr = (struct rmnet_map_v5_csum_header *)(skb-\u003edata + sizeof(*maph));\n+\t\thdr_type = u8_get_bits(next_hdr-\u003eheader_info,\n+\t\t\t\t       MAPV5_HDRINFO_HDR_TYPE_FMASK);\n+\n+\t\tif (hdr_type == RMNET_MAP_HEADER_TYPE_CSUM_OFFLOAD)\n+\t\t\tpacket_len += sizeof(*next_hdr);\n+\t\telse if (hdr_type != RMNET_MAP_HEADER_TYPE_COALESCING)\n+\t\t\treturn 0;\n \t}\n \n \tif (skb-\u003elen \u003c packet_len)\n \t\treturn 0;\n \n-\tif (next_hdr \u0026\u0026\n-\t    u8_get_bits(next_hdr-\u003eheader_info, MAPV5_HDRINFO_HDR_TYPE_FMASK) !=\n-\t    RMNET_MAP_HEADER_TYPE_CSUM_OFFLOAD)\n-\t\treturn 0;\n-\n \treturn packet_len;\n }\n \n@@ -497,34 +518,670 @@ void rmnet_map_checksum_uplink_packet(struct sk_buff *skb,\n \t}\n }\n \n-/* Process a MAPv5 packet header */\n-int rmnet_map_process_next_hdr_packet(struct sk_buff *skb,\n+static struct rmnet_map_v5_csum_header *\n+rmnet_map_get_next_hdr(struct sk_buff *skb)\n+{\n+\treturn (struct rmnet_map_v5_csum_header *)(skb-\u003edata +\n+\t\t\t\t\t\t   sizeof(struct rmnet_map_header));\n+}\n+\n+static u8 rmnet_map_get_next_hdr_type(struct sk_buff *skb)\n+{\n+\tstruct rmnet_map_v5_csum_header *hdr = rmnet_map_get_next_hdr(skb);\n+\n+\treturn u8_get_bits(hdr-\u003eheader_info, MAPV5_HDRINFO_HDR_TYPE_FMASK);\n+}\n+\n+static bool rmnet_map_get_csum_valid(struct sk_buff *skb)\n+{\n+\tstruct rmnet_map_v5_csum_header *hdr = rmnet_map_get_next_hdr(skb);\n+\n+\treturn !!(hdr-\u003ecsum_info \u0026 MAPV5_CSUMINFO_VALID_FLAG);\n+}\n+\n+/* Stamp GSO metadata so the network stack can segment a coalesced SKB. */\n+static void rmnet_map_gso_stamp(struct sk_buff *skb,\n+\t\t\t\tstruct rmnet_map_coal_metadata *coal_meta)\n+{\n+\tstruct skb_shared_info *shinfo = skb_shinfo(skb);\n+\n+\tif (coal_meta-\u003etrans_proto == IPPROTO_TCP)\n+\t\tshinfo-\u003egso_type = (coal_meta-\u003eip_proto == 4) ?\n+\t\t\t\t   SKB_GSO_TCPV4 : SKB_GSO_TCPV6;\n+\telse\n+\t\tshinfo-\u003egso_type = SKB_GSO_UDP_L4;\n+\n+\tshinfo-\u003egso_size = coal_meta-\u003edata_len;\n+\tshinfo-\u003egso_segs = coal_meta-\u003epkt_count;\n+}\n+\n+/* Set the transport checksum to the pseudo-header checksum and request\n+ * partial checksum offload, letting the NIC or stack finish it.\n+ */\n+static void rmnet_map_partial_csum(struct sk_buff *skb,\n+\t\t\t\t   struct rmnet_map_coal_metadata *coal_meta)\n+{\n+\tu16 pkt_len = skb-\u003elen - coal_meta-\u003eip_len;\n+\tunsigned char *data = skb-\u003edata;\n+\t__sum16 pseudo;\n+\n+\tif (coal_meta-\u003eip_proto == 4) {\n+\t\tstruct iphdr *iph = (struct iphdr *)data;\n+\n+\t\tpseudo = ~csum_tcpudp_magic(iph-\u003esaddr, iph-\u003edaddr,\n+\t\t\t\t\t    pkt_len, coal_meta-\u003etrans_proto, 0);\n+\t} else {\n+\t\tstruct ipv6hdr *ip6h = (struct ipv6hdr *)data;\n+\n+\t\tpseudo = ~csum_ipv6_magic(\u0026ip6h-\u003esaddr, \u0026ip6h-\u003edaddr,\n+\t\t\t\t\t  pkt_len, coal_meta-\u003etrans_proto, 0);\n+\t}\n+\n+\tif (coal_meta-\u003etrans_proto == IPPROTO_TCP) {\n+\t\tstruct tcphdr *tp = (struct tcphdr *)(data + coal_meta-\u003eip_len);\n+\n+\t\ttp-\u003echeck = pseudo;\n+\t\tskb-\u003ecsum_offset = offsetof(struct tcphdr, check);\n+\t} else {\n+\t\tstruct udphdr *up = (struct udphdr *)(data + coal_meta-\u003eip_len);\n+\n+\t\tup-\u003echeck = pseudo;\n+\t\tskb-\u003ecsum_offset = offsetof(struct udphdr, check);\n+\t}\n+\n+\tskb-\u003eip_summed = CHECKSUM_PARTIAL;\n+\tskb-\u003ecsum_start = skb-\u003edata + coal_meta-\u003eip_len - skb-\u003ehead;\n+}\n+\n+/* On some hardware, num_nlos in the coalescing header can be reported\n+ * incorrectly under certain conditions even though the per-NLO num_packets\n+ * fields it is meant to summarize are correct. Recompute the true NLO count\n+ * directly from the nl_pairs[] content rather than trusting the declared\n+ * value, so that rmnet_map_v5_csum_fixup()'s single NLO, single packet check\n+ * is reliable.\n+ */\n+static void rmnet_map_v5_fixup_num_nlos(struct rmnet_map_v5_coal_header *coal_hdr)\n+{\n+\tu8 nlos = 0;\n+\tint i;\n+\n+\tfor (i = 0; i \u003c RMNET_MAP_V5_MAX_NLOS; i++) {\n+\t\tif (coal_hdr-\u003enl_pairs[i].num_packets)\n+\t\t\tnlos++;\n+\t}\n+\n+\tcoal_hdr-\u003ecoal_info = u8_encode_bits(nlos, MAPV5_COALINFO_NUM_NLOS_FMASK) |\n+\t\t\t      (coal_hdr-\u003ecoal_info \u0026 MAPV5_COALINFO_CSUM_VALID_FLAG);\n+}\n+\n+/* The checksum valid indication for a single NLO, single packet coalescing\n+ * frame cannot be trusted when the close reason is a TCP FIN/PSH, a packet\n+ * count limit, a byte count limit or a time limit.\n+ */\n+static bool rmnet_map_v5_csum_fixup(struct rmnet_map_v5_coal_header *coal_hdr)\n+{\n+\tu8 close_value = u8_get_bits(coal_hdr-\u003eclose_info,\n+\t\t\t\t     MAPV5_CLOSEINFO_CLOSE_VALUE_FMASK);\n+\tu8 close_type = u8_get_bits(coal_hdr-\u003eclose_info,\n+\t\t\t\t    MAPV5_CLOSEINFO_CLOSE_TYPE_FMASK);\n+\tu8 num_nlos = u8_get_bits(coal_hdr-\u003ecoal_info,\n+\t\t\t\t  MAPV5_COALINFO_NUM_NLOS_FMASK);\n+\n+\t/* Only applies to single NLO, single packet frames */\n+\tif (num_nlos != 1 || coal_hdr-\u003enl_pairs[0].num_packets != 1)\n+\t\treturn false;\n+\n+\t/* TCP FIN or PSH triggered the close */\n+\tif (close_type == RMNET_MAP_COAL_CLOSE_COAL)\n+\t\treturn true;\n+\n+\t/* Hit a hardware limit */\n+\tif (close_type == RMNET_MAP_COAL_CLOSE_HW) {\n+\t\tswitch (close_value) {\n+\t\tcase RMNET_MAP_COAL_CLOSE_HW_PKT:\n+\t\tcase RMNET_MAP_COAL_CLOSE_HW_BYTE:\n+\t\tcase RMNET_MAP_COAL_CLOSE_HW_TIME:\n+\t\t\treturn true;\n+\t\t}\n+\t}\n+\n+\treturn false;\n+}\n+\n+/* Carve one logical segment from a coalesced SKB and append it to the list.\n+ * Adjusts TCP sequence numbers, IP IDs/lengths, and checksum state.\n+ */\n+static void\n+__rmnet_map_segment_coal_skb(struct sk_buff *coal_skb,\n+\t\t\t     struct rmnet_map_coal_metadata *coal_meta,\n+\t\t\t     struct sk_buff_head *list, u8 pkt_id,\n+\t\t\t     bool csum_valid)\n+{\n+\tu32 dlen = coal_meta-\u003edata_len * coal_meta-\u003epkt_count;\n+\tstruct rmnet_priv *priv = netdev_priv(coal_skb-\u003edev);\n+\tu32 hlen = coal_meta-\u003eip_len + coal_meta-\u003etrans_len;\n+\tstruct sk_buff *skbn;\n+\n+\t/* RFC 768: UDP checksum is optional for IPv4, and is 0 if unused.\n+\t * Such packets are never actually bad, regardless of what the\n+\t * checksum bitmap says.\n+\t */\n+\tif (!csum_valid \u0026\u0026 coal_meta-\u003ezero_csum)\n+\t\tcsum_valid = true;\n+\n+\tif (!csum_valid) {\n+\t\tpriv-\u003estats.coal_csum_drop++;\n+\t\tgoto next_pkt;\n+\t}\n+\n+\tskbn = alloc_skb(hlen + dlen + RMNET_MAP_DEAGGR_HEADROOM, GFP_ATOMIC);\n+\tif (!skbn)\n+\t\tgoto next_pkt;\n+\n+\tskb_reserve(skbn, hlen + RMNET_MAP_DEAGGR_HEADROOM);\n+\tskb_put_data(skbn,\n+\t\t     coal_skb-\u003edata + coal_meta-\u003eip_len + coal_meta-\u003etrans_len +\n+\t\t     coal_meta-\u003edata_offset,\n+\t\t     dlen);\n+\n+\t/* Restore transport header */\n+\tskb_push(skbn, coal_meta-\u003etrans_len);\n+\tmemcpy(skbn-\u003edata, coal_meta-\u003etrans_header, coal_meta-\u003etrans_len);\n+\tskb_reset_transport_header(skbn);\n+\n+\tif (coal_meta-\u003etrans_proto == IPPROTO_TCP) {\n+\t\tstruct tcphdr *th = tcp_hdr(skbn);\n+\n+\t\tth-\u003eseq = htonl(ntohl(th-\u003eseq) + coal_meta-\u003edata_offset);\n+\t\t/* Strip dangerous flags from non-final segments */\n+\t\tif ((th-\u003efin || th-\u003epsh) \u0026\u0026\n+\t\t    hlen + coal_meta-\u003edata_offset + dlen \u003c coal_skb-\u003elen) {\n+\t\t\tth-\u003efin = 0;\n+\t\t\tth-\u003epsh = 0;\n+\t\t}\n+\t} else if (coal_meta-\u003etrans_proto == IPPROTO_UDP) {\n+\t\tstruct udphdr *uh = udp_hdr(skbn);\n+\n+\t\tuh-\u003elen = htons(skbn-\u003elen);\n+\t}\n+\n+\t/* Restore IP header */\n+\tskb_push(skbn, coal_meta-\u003eip_len);\n+\tmemcpy(skbn-\u003edata, coal_meta-\u003eip_header, coal_meta-\u003eip_len);\n+\tskb_reset_network_header(skbn);\n+\n+\tif (coal_meta-\u003eip_proto == 4) {\n+\t\tstruct iphdr *iph = ip_hdr(skbn);\n+\n+\t\tiph-\u003eid = htons(ntohs(iph-\u003eid) + pkt_id);\n+\t\tiph-\u003etot_len = htons(skbn-\u003elen);\n+\t\tiph-\u003echeck = 0;\n+\t\tiph-\u003echeck = ip_fast_csum(iph, iph-\u003eihl);\n+\t} else {\n+\t\tipv6_hdr(skbn)-\u003epayload_len =\n+\t\t\thtons(skbn-\u003elen - sizeof(struct ipv6hdr));\n+\t}\n+\n+\trmnet_map_partial_csum(skbn, coal_meta);\n+\n+\tskbn-\u003edev = coal_skb-\u003edev;\n+\tpriv-\u003estats.coal_reconstruct++;\n+\n+\tif (coal_meta-\u003epkt_count \u003e 1)\n+\t\trmnet_map_gso_stamp(skbn, coal_meta);\n+\n+\t__skb_queue_tail(list, skbn);\n+\n+next_pkt:\n+\tcoal_meta-\u003edata_offset += dlen;\n+\tcoal_meta-\u003epkt_count = 0;\n+}\n+\n+/* Parse the IP header of the coalesced frame and perform basic\n+ * validation of header fields.\n+ */\n+static bool rmnet_map_coal_parse_ip_hdr(struct sk_buff *coal_skb,\n+\t\t\t\t\tstruct rmnet_map_coal_metadata *meta,\n+\t\t\t\t\tbool *gro)\n+{\n+\tstruct rmnet_priv *priv = netdev_priv(coal_skb-\u003edev);\n+\tstruct ipv6hdr *ip6h;\n+\tstruct iphdr *iph;\n+\t__be16 frag_off;\n+\tu8 protocol;\n+\tint ret;\n+\n+\tif (coal_skb-\u003elen \u003c sizeof(*iph)) {\n+\t\tpriv-\u003estats.coal_ip_invalid++;\n+\t\treturn false;\n+\t}\n+\n+\tiph = (struct iphdr *)coal_skb-\u003edata;\n+\n+\tif (iph-\u003eversion == 4) {\n+\t\tmeta-\u003eip_proto = 4;\n+\t\tmeta-\u003eip_len = iph-\u003eihl * 4;\n+\t\tmeta-\u003etrans_proto = iph-\u003eprotocol;\n+\t\tmeta-\u003eip_header = iph;\n+\t\tif (meta-\u003eip_len \u003c sizeof(*iph) || coal_skb-\u003elen \u003c meta-\u003eip_len) {\n+\t\t\tpriv-\u003estats.coal_ip_invalid++;\n+\t\t\treturn false;\n+\t\t}\n+\n+\t\tif (ip_is_fragment(iph)) {\n+\t\t\tpriv-\u003estats.coal_ip_invalid++;\n+\t\t\treturn false;\n+\t\t}\n+\n+\t\tif (iph-\u003eihl != 5)\n+\t\t\t*gro = false;\n+\t} else if (iph-\u003eversion == 6) {\n+\t\tif (coal_skb-\u003elen \u003c sizeof(*ip6h)) {\n+\t\t\tpriv-\u003estats.coal_ip_invalid++;\n+\t\t\treturn false;\n+\t\t}\n+\n+\t\tip6h = (struct ipv6hdr *)iph;\n+\t\tprotocol = ip6h-\u003enexthdr;\n+\t\tmeta-\u003eip_proto = 6;\n+\t\tret = ipv6_skip_exthdr(coal_skb, sizeof(*ip6h), \u0026protocol,\n+\t\t\t\t       \u0026frag_off);\n+\t\tif (ret \u003c 0 || frag_off) {\n+\t\t\tpriv-\u003estats.coal_ip_invalid++;\n+\t\t\treturn false;\n+\t\t}\n+\n+\t\tmeta-\u003eip_len = (u16)ret;\n+\t\tmeta-\u003etrans_proto = protocol;\n+\t\tmeta-\u003eip_header = ip6h;\n+\t\tif (meta-\u003eip_len \u003e sizeof(*ip6h))\n+\t\t\t*gro = false;\n+\t} else {\n+\t\tpriv-\u003estats.coal_ip_invalid++;\n+\t\treturn false;\n+\t}\n+\n+\treturn true;\n+}\n+\n+/* Parse the transport header following the IP header into coal_meta. The\n+ * available length is checked before any field is read.\n+ */\n+static bool rmnet_map_coal_parse_trans_hdr(struct sk_buff *coal_skb,\n+\t\t\t\t\t   struct rmnet_map_coal_metadata *meta)\n+{\n+\tstruct rmnet_priv *priv = netdev_priv(coal_skb-\u003edev);\n+\tstruct udphdr *uh;\n+\tstruct tcphdr *th;\n+\tu32 avail;\n+\tu8 *base;\n+\n+\tbase = (u8 *)meta-\u003eip_header + meta-\u003eip_len;\n+\tavail = coal_skb-\u003elen - meta-\u003eip_len;\n+\n+\tif (meta-\u003etrans_proto == IPPROTO_TCP) {\n+\t\tif (avail \u003c sizeof(*th)) {\n+\t\t\tpriv-\u003estats.coal_trans_invalid++;\n+\t\t\treturn false;\n+\t\t}\n+\n+\t\tth = (struct tcphdr *)base;\n+\t\tmeta-\u003etrans_len = th-\u003edoff * 4;\n+\t\tmeta-\u003etrans_header = th;\n+\t\tif (meta-\u003etrans_len \u003c sizeof(*th) || avail \u003c meta-\u003etrans_len) {\n+\t\t\tpriv-\u003estats.coal_trans_invalid++;\n+\t\t\treturn false;\n+\t\t}\n+\t} else if (meta-\u003etrans_proto == IPPROTO_UDP) {\n+\t\tif (avail \u003c sizeof(*uh)) {\n+\t\t\tpriv-\u003estats.coal_trans_invalid++;\n+\t\t\treturn false;\n+\t\t}\n+\n+\t\tuh = (struct udphdr *)base;\n+\t\tmeta-\u003etrans_len = sizeof(*uh);\n+\t\tmeta-\u003etrans_header = uh;\n+\t\tif (meta-\u003eip_proto == 4 \u0026\u0026 !uh-\u003echeck)\n+\t\t\tmeta-\u003ezero_csum = true;\n+\t} else {\n+\t\tpriv-\u003estats.coal_trans_invalid++;\n+\t\treturn false;\n+\t}\n+\n+\treturn true;\n+}\n+\n+/* Reject the frame if the total data bytes claimed by all NLOs exceed\n+ * the actual payload in the SKB.  Each pkt_len covers IP+transport\n+ * headers plus per-packet data. Headers appear once, so subtract hlen\n+ * per packet and check the running sum against available data.\n+ */\n+static bool rmnet_map_coal_validate_bounds(struct sk_buff *coal_skb,\n+\t\t\t\t\t   struct rmnet_map_v5_coal_header *coal_hdr,\n+\t\t\t\t\t   u8 num_nlos, u32 hlen)\n+{\n+\tu32 total_data = 0;\n+\tu32 nlo_len;\n+\tu16 plen;\n+\tu8 i;\n+\n+\tfor (i = 0; i \u003c num_nlos; i++) {\n+\t\tplen = ntohs(coal_hdr-\u003enl_pairs[i].pkt_len);\n+\n+\t\tif (plen \u003c hlen)\n+\t\t\treturn false;\n+\n+\t\tnlo_len = (u32)(plen - hlen) * coal_hdr-\u003enl_pairs[i].num_packets;\n+\t\tif (total_data + nlo_len \u003e coal_skb-\u003elen - hlen)\n+\t\t\treturn false;\n+\n+\t\ttotal_data += nlo_len;\n+\t}\n+\n+\treturn true;\n+}\n+\n+/* Attempt the GRO-friendly fast path for a single-NLO, checksum-valid frame\n+ * by reusing the original SKB and stamping GSO metadata instead of copying\n+ * out each segment.  Returns true if the frame was consumed via the fast\n+ * path, or false if the caller should fall back to full segmentation.\n+ */\n+static bool rmnet_map_coal_gro_fast_path(struct sk_buff *coal_skb,\n+\t\t\t\t\t struct rmnet_map_v5_coal_header *coal_hdr,\n+\t\t\t\t\t struct rmnet_map_coal_metadata *coal_meta,\n+\t\t\t\t\t struct sk_buff_head *list,\n+\t\t\t\t\t u8 num_nlos, bool gro)\n+{\n+\tu32 hlen = coal_meta-\u003eip_len + coal_meta-\u003etrans_len;\n+\n+\tif (!gro || num_nlos != 1 ||\n+\t    !(coal_hdr-\u003ecoal_info \u0026 MAPV5_COALINFO_CSUM_VALID_FLAG))\n+\t\treturn false;\n+\n+\tcoal_meta-\u003edata_len = ntohs(coal_hdr-\u003enl_pairs[0].pkt_len) - hlen;\n+\tcoal_meta-\u003epkt_count = coal_hdr-\u003enl_pairs[0].num_packets;\n+\n+\tcoal_skb-\u003eip_summed = CHECKSUM_UNNECESSARY;\n+\tif (coal_meta-\u003epkt_count \u003e 1) {\n+\t\trmnet_map_partial_csum(coal_skb, coal_meta);\n+\t\trmnet_map_gso_stamp(coal_skb, coal_meta);\n+\t}\n+\n+\t__skb_queue_tail(list, coal_skb);\n+\treturn true;\n+}\n+\n+/* NLO packet lengths are already bounds-checked by\n+ * rmnet_map_coal_validate_bounds() so no further validation is needed here.\n+ */\n+static void rmnet_map_coal_segment_loop(struct sk_buff *coal_skb,\n+\t\t\t\t\tstruct rmnet_map_v5_coal_header *coal_hdr,\n+\t\t\t\t\tstruct rmnet_map_coal_metadata *coal_meta,\n+\t\t\t\t\tstruct sk_buff_head *list,\n+\t\t\t\t\tu64 nlo_err_mask, bool gro, u8 num_nlos)\n+{\n+\tstruct rmnet_priv *priv = netdev_priv(coal_skb-\u003edev);\n+\tu32 hlen = coal_meta-\u003eip_len + coal_meta-\u003etrans_len;\n+\tu8 pkt, total_pkt = 0;\n+\tbool csum_err;\n+\tu16 pkt_len;\n+\tu8 nlo;\n+\n+\tfor (nlo = 0; nlo \u003c num_nlos; nlo++) {\n+\t\tpkt_len = ntohs(coal_hdr-\u003enl_pairs[nlo].pkt_len);\n+\t\tpkt_len -= hlen;\n+\t\tcoal_meta-\u003edata_len = pkt_len;\n+\n+\t\t/* nlo_err_mask is one flat bitstream across all NLOs. Shift\n+\t\t * it once per packet in absolute frame order and do not\n+\t\t * re-align at the NLO boundary above. See the comment on\n+\t\t * rmnet_map_data_check_coal_header() for why.\n+\t\t */\n+\t\tfor (pkt = 0; pkt \u003c coal_hdr-\u003enl_pairs[nlo].num_packets;\n+\t\t     pkt++, total_pkt++, nlo_err_mask \u003e\u003e= 1) {\n+\t\t\tcsum_err = nlo_err_mask \u0026 1;\n+\n+\t\t\tif (csum_err)\n+\t\t\t\tpriv-\u003estats.coal_csum_err++;\n+\n+\t\t\tif (!gro) {\n+\t\t\t\tcoal_meta-\u003epkt_count = 1;\n+\t\t\t\t__rmnet_map_segment_coal_skb(coal_skb, coal_meta,\n+\t\t\t\t\t\t\t     list, total_pkt,\n+\t\t\t\t\t\t\t     !csum_err);\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\n+\t\t\tif (csum_err) {\n+\t\t\t\tif (coal_meta-\u003epkt_count)\n+\t\t\t\t\t__rmnet_map_segment_coal_skb(coal_skb,\n+\t\t\t\t\t\t\t\t     coal_meta,\n+\t\t\t\t\t\t\t\t     list,\n+\t\t\t\t\t\t\t\t     total_pkt,\n+\t\t\t\t\t\t\t\t     true);\n+\t\t\t\tcoal_meta-\u003epkt_count = 1;\n+\t\t\t\t__rmnet_map_segment_coal_skb(coal_skb, coal_meta,\n+\t\t\t\t\t\t\t     list, total_pkt,\n+\t\t\t\t\t\t\t     false);\n+\t\t\t} else {\n+\t\t\t\tcoal_meta-\u003epkt_count++;\n+\t\t\t}\n+\t\t}\n+\n+\t\t/* Flush remaining packets from this NLO */\n+\t\tif (coal_meta-\u003epkt_count)\n+\t\t\t__rmnet_map_segment_coal_skb(coal_skb, coal_meta, list,\n+\t\t\t\t\t\t     total_pkt, true);\n+\t}\n+}\n+\n+/* Expand a coalesced SKB into individual IP packets placed on the list.\n+ * NLOs with checksum errors are dropped. __rmnet_map_ingress_handler will\n+ * free the SKB in the error case.\n+ */\n+static int rmnet_map_segment_coal_skb(struct sk_buff *coal_skb,\n+\t\t\t\t      u64 nlo_err_mask,\n+\t\t\t\t      struct sk_buff_head *list,\n \t\t\t\t      u16 len)\n {\n-\tstruct rmnet_priv *priv = netdev_priv(skb-\u003edev);\n-\tstruct rmnet_map_v5_csum_header *next_hdr;\n-\tu8 nexthdr_type;\n+\tbool gro = coal_skb-\u003edev-\u003efeatures \u0026 NETIF_F_GRO_HW;\n+\tstruct rmnet_map_v5_coal_header *coal_hdr;\n+\tstruct rmnet_map_coal_metadata coal_meta;\n+\tu8 num_nlos;\n+\tu32 hlen;\n+\n+\tmemset(\u0026coal_meta, 0, sizeof(coal_meta));\n+\n+\t/* Drop any MAP frame padding. The coal header is counted in len */\n+\tskb_pull(coal_skb, sizeof(struct rmnet_map_header));\n+\tskb_trim(coal_skb, len);\n+\tcoal_hdr = (struct rmnet_map_v5_coal_header *)coal_skb-\u003edata;\n+\trmnet_map_v5_fixup_num_nlos(coal_hdr);\n+\tnum_nlos = u8_get_bits(coal_hdr-\u003ecoal_info, MAPV5_COALINFO_NUM_NLOS_FMASK);\n+\tskb_pull(coal_skb, sizeof(*coal_hdr));\n+\n+\tif (!rmnet_map_coal_parse_ip_hdr(coal_skb, \u0026coal_meta, \u0026gro))\n+\t\treturn -EINVAL;\n \n-\tnext_hdr = (struct rmnet_map_v5_csum_header *)(skb-\u003edata +\n-\t\t\tsizeof(struct rmnet_map_header));\n+\tif (!rmnet_map_coal_parse_trans_hdr(coal_skb, \u0026coal_meta))\n+\t\treturn -EINVAL;\n \n-\tnexthdr_type = u8_get_bits(next_hdr-\u003eheader_info,\n-\t\t\t\t   MAPV5_HDRINFO_HDR_TYPE_FMASK);\n+\thlen = coal_meta.ip_len + coal_meta.trans_len;\n \n-\tif (nexthdr_type != RMNET_MAP_HEADER_TYPE_CSUM_OFFLOAD)\n+\tif (!rmnet_map_coal_validate_bounds(coal_skb, coal_hdr, num_nlos, hlen))\n \t\treturn -EINVAL;\n \n-\tif (unlikely(!(skb-\u003edev-\u003efeatures \u0026 NETIF_F_RXCSUM))) {\n-\t\tpriv-\u003estats.csum_sw++;\n-\t} else if (next_hdr-\u003ecsum_info \u0026 MAPV5_CSUMINFO_VALID_FLAG) {\n-\t\tpriv-\u003estats.csum_ok++;\n-\t\tskb-\u003eip_summed = CHECKSUM_UNNECESSARY;\n-\t} else {\n-\t\tpriv-\u003estats.csum_valid_unset++;\n+\tif (rmnet_map_v5_csum_fixup(coal_hdr) \u0026\u0026 !coal_meta.zero_csum) {\n+\t\tcoal_skb-\u003eip_summed = CHECKSUM_NONE;\n+\t\t__skb_queue_tail(list, coal_skb);\n+\t\treturn 0;\n+\t}\n+\n+\tif (rmnet_map_coal_gro_fast_path(coal_skb, coal_hdr, \u0026coal_meta, list,\n+\t\t\t\t\t num_nlos, gro))\n+\t\treturn 0;\n+\n+\trmnet_map_coal_segment_loop(coal_skb, coal_hdr, \u0026coal_meta, list,\n+\t\t\t\t    nlo_err_mask, gro, num_nlos);\n+\n+\treturn 0;\n+}\n+\n+/* Log the hardware close-reason counter for a coalescing header. */\n+static void rmnet_map_data_log_close_stats(struct rmnet_priv *priv,\n+\t\t\t\t\t   u8 type, u8 code)\n+{\n+\tswitch (type) {\n+\tcase RMNET_MAP_COAL_CLOSE_NON_COAL:\n+\t\tpriv-\u003estats.coal_close_non_coal++;\n+\t\tbreak;\n+\tcase RMNET_MAP_COAL_CLOSE_IP_MISS:\n+\t\tpriv-\u003estats.coal_close_ip_miss++;\n+\t\tbreak;\n+\tcase RMNET_MAP_COAL_CLOSE_TRANS_MISS:\n+\t\tpriv-\u003estats.coal_close_trans_miss++;\n+\t\tbreak;\n+\tcase RMNET_MAP_COAL_CLOSE_HW:\n+\t\tswitch (code) {\n+\t\tcase RMNET_MAP_COAL_CLOSE_HW_NL:\n+\t\t\tpriv-\u003estats.coal_close_hw_nl++;\n+\t\t\tbreak;\n+\t\tcase RMNET_MAP_COAL_CLOSE_HW_PKT:\n+\t\t\tpriv-\u003estats.coal_close_hw_pkt++;\n+\t\t\tbreak;\n+\t\tcase RMNET_MAP_COAL_CLOSE_HW_BYTE:\n+\t\t\tpriv-\u003estats.coal_close_hw_byte++;\n+\t\t\tbreak;\n+\t\tcase RMNET_MAP_COAL_CLOSE_HW_TIME:\n+\t\t\tpriv-\u003estats.coal_close_hw_time++;\n+\t\t\tbreak;\n+\t\tcase RMNET_MAP_COAL_CLOSE_HW_EVICT:\n+\t\t\tpriv-\u003estats.coal_close_hw_evict++;\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tbreak;\n+\t\t}\n+\t\tbreak;\n+\tcase RMNET_MAP_COAL_CLOSE_COAL:\n+\t\tpriv-\u003estats.coal_close_coal++;\n+\t\tbreak;\n+\tdefault:\n+\t\tbreak;\n+\t}\n+}\n+\n+/* Validate the coalescing header and build the checksum error mask.\n+ *\n+ * Checks performed:\n+ *  - MAP pkt_len accommodates the coal header (coal header is counted in\n+ *    pkt_len. pkt_len \u003c sizeof(*coal_hdr) means no payload is possible).\n+ *  - num_nlos is in [1, RMNET_MAP_V5_MAX_NLOS].\n+ *  - Total packet count does not exceed RMNET_MAP_V5_MAX_PACKETS.\n+ *\n+ * nlo_err_mask is NOT six independent per-NLO bitmaps. Each nl_pairs\n+ * slot only has room for an 8 bit csum_error_bitmap, but a single NLO\n+ * can carry more than 8 packets (up to RMNET_MAP_V5_MAX_PACKETS), so\n+ * hardware spills a wide NLO's error bits into the csum_error_bitmap\n+ * bytes of the following slots rather than truncating them. The\n+ * six bitmap bytes are therefore always concatenated in slot order\n+ * into one flat RMNET_MAP_V5_MAX_NLOS * 8 = RMNET_MAP_V5_MAX_PACKETS\n+ * bit value, addressed by a packet's absolute position in the frame,\n+ * regardless of how many NLOs are actually in use. Receivers must\n+ * walk it as a single contiguous stream and must not expect it to\n+ * align it at NLO boundaries.\n+ */\n+static int rmnet_map_data_check_coal_header(struct sk_buff *skb,\n+\t\t\t\t\t    u64 *nlo_err_mask)\n+{\n+\tstruct rmnet_map_header *maph = (struct rmnet_map_header *)skb-\u003edata;\n+\tstruct rmnet_priv *priv = netdev_priv(skb-\u003edev);\n+\tstruct rmnet_map_v5_coal_header *coal_hdr;\n+\tu8 num_nlos, pkts = 0;\n+\tu64 mask = 0;\n+\tint i;\n+\n+\t/* coal header is counted in pkt_len */\n+\tif (ntohs(maph-\u003epkt_len) \u003c sizeof(*coal_hdr)) {\n+\t\tpriv-\u003estats.coal_hdr_nlo_err++;\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tcoal_hdr = (struct rmnet_map_v5_coal_header *)(skb-\u003edata + sizeof(*maph));\n+\tnum_nlos = u8_get_bits(coal_hdr-\u003ecoal_info, MAPV5_COALINFO_NUM_NLOS_FMASK);\n+\n+\tif (num_nlos == 0 || num_nlos \u003e RMNET_MAP_V5_MAX_NLOS) {\n+\t\tpriv-\u003estats.coal_hdr_nlo_err++;\n+\t\treturn -EINVAL;\n \t}\n \n-\t/* Pull csum v5 header */\n-\tskb_pull(skb, sizeof(*next_hdr));\n+\tfor (i = 0; i \u003c RMNET_MAP_V5_MAX_NLOS; i++) {\n+\t\tu8 err = coal_hdr-\u003enl_pairs[i].csum_error_bitmap;\n+\t\tu8 pkt = coal_hdr-\u003enl_pairs[i].num_packets;\n+\n+\t\tmask |= ((u64)err) \u003c\u003c (8 * i);\n+\t\tpkts += pkt;\n+\t\tif (pkts \u003e RMNET_MAP_V5_MAX_PACKETS) {\n+\t\t\tpriv-\u003estats.coal_hdr_pkt_err++;\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\n+\tpriv-\u003estats.coal_pkts += pkts;\n+\trmnet_map_data_log_close_stats(priv,\n+\t\t\t\t       u8_get_bits(coal_hdr-\u003eclose_info,\n+\t\t\t\t\t\t   MAPV5_CLOSEINFO_CLOSE_TYPE_FMASK),\n+\t\t\t\t       u8_get_bits(coal_hdr-\u003eclose_info,\n+\t\t\t\t\t\t   MAPV5_CLOSEINFO_CLOSE_VALUE_FMASK));\n+\n+\t*nlo_err_mask = mask;\n+\treturn 0;\n+}\n+\n+int rmnet_map_process_next_hdr_packet(struct sk_buff *skb,\n+\t\t\t\t      struct sk_buff_head *list,\n+\t\t\t\t      u16 len, u32 data_format)\n+{\n+\tstruct rmnet_priv *priv = netdev_priv(skb-\u003edev);\n+\tu64 nlo_err_mask;\n+\tint rc;\n+\n+\tswitch (rmnet_map_get_next_hdr_type(skb)) {\n+\tcase RMNET_MAP_HEADER_TYPE_COALESCING:\n+\t\tif (!(data_format \u0026 RMNET_FLAGS_INGRESS_COALESCE))\n+\t\t\treturn -EINVAL;\n+\n+\t\tpriv-\u003estats.coal_rx++;\n+\t\trc = rmnet_map_data_check_coal_header(skb, \u0026nlo_err_mask);\n+\t\tif (rc)\n+\t\t\treturn rc;\n+\n+\t\trc = rmnet_map_segment_coal_skb(skb, nlo_err_mask, list, len);\n+\t\tif (rc)\n+\t\t\treturn rc;\n+\n+\t\tif (skb_peek(list) != skb)\n+\t\t\tconsume_skb(skb);\n+\t\tbreak;\n+\n+\tcase RMNET_MAP_HEADER_TYPE_CSUM_OFFLOAD:\n+\t\tif (unlikely(!(skb-\u003edev-\u003efeatures \u0026 NETIF_F_RXCSUM))) {\n+\t\t\tpriv-\u003estats.csum_sw++;\n+\t\t} else if (rmnet_map_get_csum_valid(skb)) {\n+\t\t\tpriv-\u003estats.csum_ok++;\n+\t\t\tskb-\u003eip_summed = CHECKSUM_UNNECESSARY;\n+\t\t} else {\n+\t\t\tpriv-\u003estats.csum_valid_unset++;\n+\t\t}\n+\n+\t\tskb_pull(skb, sizeof(struct rmnet_map_header) +\n+\t\t\t      sizeof(struct rmnet_map_v5_csum_header));\n+\t\tskb_trim(skb, len);\n+\t\t__skb_queue_tail(list, skb);\n+\t\tbreak;\n+\n+\tdefault:\n+\t\treturn -EINVAL;\n+\t}\n \n \treturn 0;\n }\ndiff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c\nindex 5f921cddf82b4..a21d6543c014f 100644\n--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c\n+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c\n@@ -183,6 +183,26 @@ static const char rmnet_gstrings_stats[][ETH_GSTRING_LEN] = {\n \t\"Checksum skipped\",\n \t\"Checksum computed in software\",\n \t\"Checksum computed in hardware\",\n+\t/* DL coalescing */\n+\t\"Coal frames received\",\n+\t\"Packets in coal frames\",\n+\t\"Coal hdr NLO errors\",\n+\t\"Coal hdr pkt count errors\",\n+\t\"Coal checksum errors\",\n+\t\"Coal packets dropped on csum err\",\n+\t\"Coal segments reconstructed\",\n+\t\"Coal invalid IP version\",\n+\t\"Coal invalid transport\",\n+\t/* close reasons */\n+\t\"Coal closed: non-coal\",\n+\t\"Coal closed: IP miss\",\n+\t\"Coal closed: transport miss\",\n+\t\"Coal closed: hw NL limit\",\n+\t\"Coal closed: hw pkt limit\",\n+\t\"Coal closed: hw byte limit\",\n+\t\"Coal closed: hw time limit\",\n+\t\"Coal closed: hw evict\",\n+\t\"Coal closed: FIN/PSH\",\n };\n \n static void rmnet_get_strings(struct net_device *dev, u32 stringset, u8 *buf)\n@@ -323,6 +343,7 @@ int rmnet_vnd_newlink(u8 id, struct net_device *rmnet_dev,\n \trmnet_dev-\u003ehw_features = NETIF_F_RXCSUM;\n \trmnet_dev-\u003ehw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;\n \trmnet_dev-\u003ehw_features |= NETIF_F_SG;\n+\trmnet_dev-\u003ehw_features |= NETIF_F_GRO_HW;\n \n \tpriv-\u003ereal_dev = real_dev;\n \ndiff --git a/include/linux/if_rmnet.h b/include/linux/if_rmnet.h\nindex c44bf6e80ecb4..5df4d417f3d2c 100644\n--- a/include/linux/if_rmnet.h\n+++ b/include/linux/if_rmnet.h\n@@ -70,5 +70,36 @@ struct rmnet_map_v5_csum_header {\n #define MAPV5_HDRINFO_HDR_TYPE_FMASK\tGENMASK(7, 1)\n #define MAPV5_CSUMINFO_VALID_FLAG\tBIT(7)\n \n+#define RMNET_MAP_HEADER_TYPE_COALESCING   1\n #define RMNET_MAP_HEADER_TYPE_CSUM_OFFLOAD 2\n+\n+/* MAPv5 coalescing header */\n+#define RMNET_MAP_V5_MAX_NLOS\t\t6\n+#define RMNET_MAP_V5_MAX_PACKETS\t48\n+\n+/* One Number-Length Object pair: per-NLO packet count and length. */\n+struct rmnet_map_v5_nl_pair {\n+\t__be16 pkt_len;\n+\tu8  csum_error_bitmap;\n+\tu8  num_packets;\n+} __aligned(1);\n+\n+/* MAPv5 coalescing header: describes up to RMNET_MAP_V5_MAX_NLOS NLOs.\n+ * The header immediately follows the MAP header in the frame and is\n+ * included in the MAP pkt_len field.\n+ */\n+struct rmnet_map_v5_coal_header {\n+\tu8  header_info;\t/* MAPV5_HDRINFO_NXT_HDR_FLAG, MAPV5_HDRINFO_HDR_TYPE_FMASK */\n+\tu8  coal_info;\t\t/* MAPV5_COALINFO_* */\n+\tu8  close_info;\t\t/* MAPV5_CLOSEINFO_* */\n+\tu8  veid_info;\t\t/* MAPV5_VEIDINFO_* */\n+\tstruct rmnet_map_v5_nl_pair nl_pairs[RMNET_MAP_V5_MAX_NLOS];\n+} __aligned(1);\n+\n+#define MAPV5_COALINFO_NUM_NLOS_FMASK\t\tGENMASK(6, 4)\n+#define MAPV5_COALINFO_CSUM_VALID_FLAG\t\tBIT(7)\n+#define MAPV5_CLOSEINFO_CLOSE_TYPE_FMASK\tGENMASK(3, 0)\n+#define MAPV5_CLOSEINFO_CLOSE_VALUE_FMASK\tGENMASK(7, 4)\n+#define MAPV5_VEIDINFO_VEID_FMASK\t\tGENMASK(3, 0)\n+\n #endif /* !(_LINUX_IF_RMNET_H_) */\ndiff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h\nindex 245b362045253..349fcddc6622f 100644\n--- a/include/uapi/linux/if_link.h\n+++ b/include/uapi/linux/if_link.h\n@@ -2022,6 +2022,7 @@ enum {\n #define RMNET_FLAGS_EGRESS_MAP_CKSUMV4            (1U \u003c\u003c 3)\n #define RMNET_FLAGS_INGRESS_MAP_CKSUMV5           (1U \u003c\u003c 4)\n #define RMNET_FLAGS_EGRESS_MAP_CKSUMV5            (1U \u003c\u003c 5)\n+#define RMNET_FLAGS_INGRESS_COALESCE              (1U \u003c\u003c 6)\n \n enum {\n \tIFLA_RMNET_UNSPEC,\n"
}

2/1 2026/10/01 02:23 agent patch-evaluator
1m Model:
core

Args:
null

Results:
{
  "EnableConfigs": [
    "RMNET",
    "NET_VENDOR_QUALCOMM"
  ],
  "FocusSymbols": [
    "rmnet_map_process_next_hdr_packet",
    "rmnet_map_segment_coal_skb",
    "rmnet_map_data_check_coal_header",
    "rmnet_map_coal_segment_loop",
    "rmnet_map_coal_gro_fast_path",
    "rmnet_map_coal_validate_bounds",
    "rmnet_map_coal_parse_ip_hdr",
    "rmnet_map_coal_parse_trans_hdr",
    "__rmnet_map_segment_coal_skb",
    "rmnet_map_v5_csum_fixup",
    "rmnet_map_v5_fixup_num_nlos",
    "rmnet_map_validate_packet_len",
    "rmnet_config_data_format_valid",
    "rmnet_newlink",
    "rmnet_changelink"
  ],
  "Reasoning": "The patch adds support for MAPv5 downlink packet coalescing in the Qualcomm RmNet driver. RmNet devices are virtual network devices configured via rtnetlink (rtnl_link_ops) that can attach to any network device (e.g., dummy, veth, or tun/tap), without requiring physical hardware. The patch introduces complex packet parsing, validation, skb segmentation, sequence number manipulation, and checksum calculations for coalesced packets in the ingress data path, which is reachable in standard virtualized environments and warrants fuzzing.",
  "WorthFuzzing": true
}

Instruction:
You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.

IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.

================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.

- REACHABILITY IS THE PRIMARY GATE:
  Fuzzing can only discover bugs in code that can actually execute in standard virtualized
  environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
  If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
  regardless of whether it adds assertions or complex logic.

- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
  Patch authors routinely label changes as "cleanups", "refactorings", or state
  "No functional change intended". Do NOT take these claims at face value.
  Code refactorings that rearrange logic, introduce helper functions, or alter state management
  in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
  If reachable executable code is modified or refactored, it MUST be fuzzed.

- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
  When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
  BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
  Even if the author believes the invariant always holds, fuzzing is essential to verify whether
  an unusual sequence of operations can violate it.

================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:

- Non-kernel and non-executable changes:
  * Modifications to Documentation/, comments, or spelling fixes.
  * User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
    that do not affect the compiled kernel image (vmlinux) or kernel modules.
  * Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
    that do not alter control flow or data structures.
  * Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
  * Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
    ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
  * Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
    physical PCI hot-unplug or manual sysfs driver unbinding.
  * Code paths exclusive to architectures other than the target architecture.

================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
  * Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
    BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
  * Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
  * Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
  * Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).

================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:

- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
  Do NOT list generic, ubiquitous functions called by almost every program in the corpus
  (including, but not limited to: general memory allocators and deallocators, page fault
  and trap handlers, or core synchronization primitives; this is not an exhaustive list).
  Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
  which severely dilutes fuzzing effort away from the actual changes.

- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
  List functions that specifically implement the logic being added or altered, or direct API entrypoints
  for the subsystem feature under review.

- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
  Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
  distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
  If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
  functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).

================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.


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

Prompt:
Target architecture: amd64

For your convenience, here is the diff of the changes:
commit f42f799b4c15e45cae56eaf840d351fb243bdd4b
Author: syz-cluster <triage@syzkaller.com>
Date:   Thu Oct 1 02:23:49 2026 +0000

    syz-cluster: applied patch under review

diff --git a/Documentation/networking/device_drivers/cellular/qualcomm/rmnet.rst b/Documentation/networking/device_drivers/cellular/qualcomm/rmnet.rst
index 5aedbabb73827..ba8e947d54e68 100644
--- a/Documentation/networking/device_drivers/cellular/qualcomm/rmnet.rst
+++ b/Documentation/networking/device_drivers/cellular/qualcomm/rmnet.rst
@@ -125,8 +125,8 @@ Command (1)/ Data (0) bit value is to indicate if the packet is a MAP command
 or data packet. Command packet is used for transport level flow control. Data
 packets are standard IP packets.
 
-Next header is used to indicate the presence of another header, currently is
-limited to checksum header.
+Next header is used to indicate the presence of another header, currently
+limited to the checksum and coalescing headers.
 
 Padding is the number of bytes to be appended to the payload to
 ensure 4 byte alignment.
@@ -150,11 +150,11 @@ Header Type is to indicate the type of header, this usually is set to CHECKSUM
 
 Header types
 
-= ===============
+= ======================
 0 Reserved
-1 Reserved
+1 coalescing header
 2 checksum header
-= ===============
+= ======================
 
 Checksum Valid is to indicate whether the header checksum is valid. Value of 1
 implies that checksum is calculated on this packet and is valid, value of 0
@@ -162,8 +162,78 @@ indicates that the calculated packet checksum is invalid.
 
 Reserved bits must be zero when sent and ignored when received.
 
-e. MAP packet v1/v5 (command specific)
---------------------------------------
+e. Coalescing header v5
+------------------------
+
+Hardware can coalesce multiple same-flow IP packets of the same length into
+a single MAP frame to reduce per-packet overhead at high data rates.  The
+coalescing header (header type 1) describes the coalesced content.
+
+Packet format::
+
+  Bit         0 - 6         7          8           9-11         12-15
+  Function  Header Type  Next Header  CSUM valid  Num NLOs    (reserved)
+
+  Bit        16-19        20-23
+  Function  Close value  Close type
+
+  Bit        24-27        28-31
+  Function  (reserved)    VEID
+
+  Bit           32 - 47        48 - 55            56 - 63
+  Function   Packet length  CSUM error bitmap  Num packets (NLO 0)
+
+  ... (up to 6 NLO entries total, same 32-bit format per entry)
+
+Header Type is set to 1 (coalescing).
+
+Num NLOs (Number-Length Objects) is the count of active NLO entries
+(1 – 6).  Each NLO describes a group of consecutive coalesced packets
+that all share the same IP packet length.
+
+CSUM valid (bit 8) indicates whether the hardware checksum is valid
+for all packets in the frame.
+
+Close type and close value encode the hardware reason that coalescing
+was terminated for this frame:
+
+Close type values:
+
+= ==============================
+0 non-coalesced (single packet)
+1 IP flow miss
+2 transport flow miss
+3 hardware limit (see value)
+4 coalescing closed (FIN/PSH)
+= ==============================
+
+Close value (used when close type is 3):
+
+= ==================
+0 NL limit reached
+1 packet limit
+2 byte limit
+3 time limit
+4 eviction
+= ==================
+
+VEID is the virtual endpoint ID of the originating flow.
+
+Each NLO entry::
+
+  Bit         0 - 15        16 - 23            24 - 31
+  Function  Pkt length   CSUM error bitmap   Num packets
+
+Pkt length is the full IP packet length, including the IP header,
+transport header, and payload, for every packet in this NLO group.
+
+CSUM error bitmap is a per-packet bitmask. Bit N is set when packet N
+in this NLO has a bad checksum.
+
+Num packets is the count of coalesced packets described by this NLO.
+
+f. MAP packet v1/v5 (command specific)
+---------------------------------------
 
 Packet format::
 
@@ -187,7 +257,7 @@ Command types
 3 is for error during processing of commands
 = ==========================================
 
-f. Aggregation
+g. Aggregation
 --------------
 
 Aggregation is multiple MAP packets (can be data or command) delivered to
@@ -208,3 +278,32 @@ rmnet userspace configuration is done through netlink using iproute2
 https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/
 
 The driver uses rtnl_link_ops for communication.
+
+The data format flags controlling the ingress and egress processing
+pipeline are set via the ``IFLA_RMNET_FLAGS`` attribute
+(``struct ifla_rmnet_flags``).
+
+Relevant ingress flags:
+
+``RMNET_FLAGS_INGRESS_DEAGGREGATION``
+  Enable MAP frame de-aggregation.
+
+``RMNET_FLAGS_INGRESS_MAP_CKSUMV4``
+  Enable MAPv4 downlink checksum offload.
+
+``RMNET_FLAGS_INGRESS_MAP_CKSUMV5``
+  Enable MAPv5 downlink checksum offload (header type 2).
+
+``RMNET_FLAGS_INGRESS_COALESCE``
+  Enable MAPv5 downlink hardware coalescing (header type 1).
+  When set the driver will decode coalescing headers, reconstruct
+  individual IP packets and will deliver batched GSO SKBs to the
+  stack for efficient processing.
+
+Relevant egress flags:
+
+``RMNET_FLAGS_EGRESS_MAP_CKSUMV4``
+  Enable MAPv4 uplink checksum offload.
+
+``RMNET_FLAGS_EGRESS_MAP_CKSUMV5``
+  Enable MAPv5 uplink checksum offload.
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
index 61b04c6c0390e..555659c2edc21 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
@@ -26,6 +26,30 @@ static int rmnet_is_real_dev_registered(const struct net_device *real_dev)
 	return rcu_access_pointer(real_dev->rx_handler) == rmnet_rx_handler;
 }
 
+/* Only three MAP configurations are supported: MAPv1 (no checksum
+ * offload), MAPv4 (v4 checksum offload) and MAPv5 (v5 checksum
+ * offload). QMAP command support is orthogonal and permitted with
+ * any of the three. Mixing v4 and v5 checksum offload flags together
+ * is not a supported configuration. DL packet coalescing additionally
+ * requires a MAPv5 configuration.
+ */
+static bool rmnet_config_data_format_valid(u32 data_format)
+{
+	u32 v4_mask = RMNET_FLAGS_INGRESS_MAP_CKSUMV4 |
+		      RMNET_FLAGS_EGRESS_MAP_CKSUMV4;
+	u32 v5_mask = RMNET_FLAGS_INGRESS_MAP_CKSUMV5 |
+		      RMNET_FLAGS_EGRESS_MAP_CKSUMV5;
+
+	if ((data_format & v4_mask) && (data_format & v5_mask))
+		return false;
+
+	if ((data_format & RMNET_FLAGS_INGRESS_COALESCE) &&
+	    !(data_format & RMNET_FLAGS_INGRESS_MAP_CKSUMV5))
+		return false;
+
+	return true;
+}
+
 /* Needs rtnl lock */
 struct rmnet_port*
 rmnet_get_port_rtnl(const struct net_device *real_dev)
@@ -143,6 +167,20 @@ static int rmnet_newlink(struct net_device *dev,
 		return -ENODEV;
 	}
 
+	if (data[IFLA_RMNET_FLAGS]) {
+		struct ifla_rmnet_flags *flags;
+
+		flags = nla_data(data[IFLA_RMNET_FLAGS]);
+		data_format &= ~flags->mask;
+		data_format |= flags->flags & flags->mask;
+	}
+
+	if (!rmnet_config_data_format_valid(data_format)) {
+		NL_SET_ERR_MSG_MOD(extack,
+				   "unsupported MAP checksum flag combination");
+		return -EINVAL;
+	}
+
 	ep = kzalloc_obj(*ep);
 	if (!ep)
 		return -ENOMEM;
@@ -167,14 +205,6 @@ static int rmnet_newlink(struct net_device *dev,
 
 	hlist_add_head_rcu(&ep->hlnode, &port->muxed_ep[mux_id]);
 
-	if (data[IFLA_RMNET_FLAGS]) {
-		struct ifla_rmnet_flags *flags;
-
-		flags = nla_data(data[IFLA_RMNET_FLAGS]);
-		data_format &= ~flags->mask;
-		data_format |= flags->flags & flags->mask;
-	}
-
 	netdev_dbg(dev, "data format [0x%08X]\n", data_format);
 	WRITE_ONCE(port->data_format, data_format);
 
@@ -301,8 +331,11 @@ static int rmnet_changelink(struct net_device *dev, struct nlattr *tb[],
 			    struct netlink_ext_ack *extack)
 {
 	struct rmnet_priv *priv = netdev_priv(dev);
+	struct ifla_rmnet_flags *flags;
 	struct net_device *real_dev;
 	struct rmnet_port *port;
+	u32 old_data_format;
+	u32 data_format;
 	u16 mux_id;
 
 	if (!dev)
@@ -320,6 +353,19 @@ static int rmnet_changelink(struct net_device *dev, struct nlattr *tb[],
 
 	port = rmnet_get_port_rtnl(real_dev);
 
+	if (data[IFLA_RMNET_FLAGS]) {
+		old_data_format = READ_ONCE(port->data_format);
+		flags = nla_data(data[IFLA_RMNET_FLAGS]);
+		data_format = old_data_format & ~flags->mask;
+		data_format |= flags->flags & flags->mask;
+
+		if (!rmnet_config_data_format_valid(data_format)) {
+			NL_SET_ERR_MSG_MOD(extack,
+					   "unsupported MAP checksum flag combination");
+			return -EINVAL;
+		}
+	}
+
 	if (data[IFLA_RMNET_MUX_ID]) {
 		mux_id = nla_get_u16(data[IFLA_RMNET_MUX_ID]);
 
@@ -346,14 +392,6 @@ static int rmnet_changelink(struct net_device *dev, struct nlattr *tb[],
 	}
 
 	if (data[IFLA_RMNET_FLAGS]) {
-		struct ifla_rmnet_flags *flags;
-		u32 old_data_format;
-		u32 data_format;
-
-		old_data_format = port->data_format;
-		flags = nla_data(data[IFLA_RMNET_FLAGS]);
-		data_format = old_data_format & ~flags->mask;
-		data_format |= flags->flags & flags->mask;
 		WRITE_ONCE(port->data_format, data_format);
 
 		if (rmnet_vnd_update_dev_mtu(port, real_dev)) {
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h
index 5adda0323dda7..2a34f8a7b5276 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h
@@ -80,6 +80,26 @@ struct rmnet_priv_stats {
 	u64 csum_skipped;
 	u64 csum_sw;
 	u64 csum_hw;
+	/* DL coalescing */
+	u64 coal_rx;
+	u64 coal_pkts;
+	u64 coal_hdr_nlo_err;
+	u64 coal_hdr_pkt_err;
+	u64 coal_csum_err;
+	u64 coal_csum_drop;
+	u64 coal_reconstruct;
+	u64 coal_ip_invalid;
+	u64 coal_trans_invalid;
+	/* close-reason sub-counters */
+	u64 coal_close_non_coal;
+	u64 coal_close_ip_miss;
+	u64 coal_close_trans_miss;
+	u64 coal_close_hw_nl;
+	u64 coal_close_hw_pkt;
+	u64 coal_close_hw_byte;
+	u64 coal_close_hw_time;
+	u64 coal_close_hw_evict;
+	u64 coal_close_coal;
 };
 
 struct rmnet_priv {
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
index aa5523f4618eb..bb867ceb01c1c 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
@@ -50,6 +50,16 @@ rmnet_deliver_skb(struct sk_buff *skb)
 	gro_cells_receive(&priv->gro_cells, skb);
 }
 
+static void rmnet_deliver_skb_list(struct sk_buff_head *head)
+{
+	struct sk_buff *skb;
+
+	while ((skb = __skb_dequeue(head))) {
+		rmnet_set_skb_proto(skb);
+		rmnet_deliver_skb(skb);
+	}
+}
+
 /* MAP handler */
 
 static void
@@ -59,6 +69,7 @@ __rmnet_map_ingress_handler(struct sk_buff *skb,
 {
 	struct rmnet_map_header *map_header = (void *)skb->data;
 	struct rmnet_endpoint *ep;
+	struct sk_buff_head list;
 	u16 len, pad;
 	u8 mux_id;
 
@@ -83,12 +94,13 @@ __rmnet_map_ingress_handler(struct sk_buff *skb,
 
 	skb->dev = ep->egress_dev;
 
-	if ((data_format & RMNET_FLAGS_INGRESS_MAP_CKSUMV5) &&
+	__skb_queue_head_init(&list);
+
+	if ((data_format &
+	     (RMNET_FLAGS_INGRESS_MAP_CKSUMV5 | RMNET_FLAGS_INGRESS_COALESCE)) &&
 	    (map_header->flags & MAP_NEXT_HEADER_FLAG)) {
-		if (rmnet_map_process_next_hdr_packet(skb, len))
+		if (rmnet_map_process_next_hdr_packet(skb, &list, len, data_format))
 			goto free_skb;
-		skb_pull(skb, sizeof(*map_header));
-		rmnet_set_skb_proto(skb);
 	} else {
 		/* Subtract MAP header */
 		skb_pull(skb, sizeof(*map_header));
@@ -96,10 +108,11 @@ __rmnet_map_ingress_handler(struct sk_buff *skb,
 		if (data_format & RMNET_FLAGS_INGRESS_MAP_CKSUMV4 &&
 		    !rmnet_map_checksum_downlink_packet(skb, len + pad))
 			skb->ip_summed = CHECKSUM_UNNECESSARY;
+		skb_trim(skb, len);
+		__skb_queue_tail(&list, skb);
 	}
 
-	skb_trim(skb, len);
-	rmnet_deliver_skb(skb);
+	rmnet_deliver_skb_list(&list);
 	return;
 
 free_skb:
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h
index 0977e495f5915..77ddac6023c01 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h
@@ -6,6 +6,22 @@
 #define _RMNET_MAP_H_
 #include <linux/if_rmnet.h>
 
+enum rmnet_map_v5_close_type {
+	RMNET_MAP_COAL_CLOSE_NON_COAL,
+	RMNET_MAP_COAL_CLOSE_IP_MISS,
+	RMNET_MAP_COAL_CLOSE_TRANS_MISS,
+	RMNET_MAP_COAL_CLOSE_HW,
+	RMNET_MAP_COAL_CLOSE_COAL,
+};
+
+enum rmnet_map_v5_close_value {
+	RMNET_MAP_COAL_CLOSE_HW_NL,
+	RMNET_MAP_COAL_CLOSE_HW_PKT,
+	RMNET_MAP_COAL_CLOSE_HW_BYTE,
+	RMNET_MAP_COAL_CLOSE_HW_TIME,
+	RMNET_MAP_COAL_CLOSE_HW_EVICT,
+};
+
 struct rmnet_map_control_command {
 	u8  command_name;
 	u8  cmd_type:2;
@@ -53,7 +69,9 @@ void rmnet_map_checksum_uplink_packet(struct sk_buff *skb,
 				      struct rmnet_port *port,
 				      struct net_device *orig_dev,
 				      int csum_type);
-int rmnet_map_process_next_hdr_packet(struct sk_buff *skb, u16 len);
+int rmnet_map_process_next_hdr_packet(struct sk_buff *skb,
+				      struct sk_buff_head *list,
+				      u16 len, u32 data_format);
 unsigned int rmnet_map_tx_aggregate(struct sk_buff *skb, struct rmnet_port *port,
 				    struct net_device *orig_dev);
 void rmnet_map_tx_aggregate_init(struct rmnet_port *port);
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
index 39d6d084e73f0..2e76bf5a5a90c 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
@@ -7,7 +7,11 @@
 #include <linux/netdevice.h>
 #include <linux/ip.h>
 #include <linux/ipv6.h>
+#include <linux/tcp.h>
+#include <linux/udp.h>
+#include <net/ip.h>
 #include <net/ip6_checksum.h>
+#include <net/ipv6.h>
 #include <linux/bitfield.h>
 #include "rmnet_config.h"
 #include "rmnet_map.h"
@@ -17,6 +21,19 @@
 #define RMNET_MAP_DEAGGR_SPACING  64
 #define RMNET_MAP_DEAGGR_HEADROOM (RMNET_MAP_DEAGGR_SPACING / 2)
 
+struct rmnet_map_coal_metadata {
+	void *ip_header;
+	void *trans_header;
+	u16 ip_len;
+	u16 trans_len;
+	u16 data_offset;
+	u16 data_len;
+	u8 ip_proto;
+	u8 trans_proto;
+	u8 pkt_count;
+	bool zero_csum;
+};
+
 static __sum16 *rmnet_map_get_csum_field(unsigned char protocol,
 					 const void *txporthdr)
 {
@@ -337,8 +354,8 @@ u32 rmnet_map_validate_packet_len(struct sk_buff *skb, u32 data_format)
 {
 	struct rmnet_map_v5_csum_header *next_hdr = NULL;
 	struct rmnet_map_header *maph;
-	void *data = skb->data;
 	u32 packet_len;
+	u8 hdr_type;
 
 	if (skb->len < sizeof(*maph))
 		return 0;
@@ -353,24 +370,28 @@ u32 rmnet_map_validate_packet_len(struct sk_buff *skb, u32 data_format)
 
 	if (data_format & RMNET_FLAGS_INGRESS_MAP_CKSUMV4) {
 		packet_len += sizeof(struct rmnet_map_dl_csum_trailer);
-	} else if ((data_format & RMNET_FLAGS_INGRESS_MAP_CKSUMV5) &&
+	} else if ((data_format &
+		    (RMNET_FLAGS_INGRESS_MAP_CKSUMV5 | RMNET_FLAGS_INGRESS_COALESCE)) &&
 		   !(maph->flags & MAP_CMD_FLAG)) {
-		/* Mapv5 data pkt without csum hdr is invalid */
 		if (!(maph->flags & MAP_NEXT_HEADER_FLAG))
 			return 0;
 
-		packet_len += sizeof(*next_hdr);
-		next_hdr = data + sizeof(*maph);
+		if (skb->len < sizeof(*maph) + sizeof(*next_hdr))
+			return 0;
+
+		next_hdr = (struct rmnet_map_v5_csum_header *)(skb->data + sizeof(*maph));
+		hdr_type = u8_get_bits(next_hdr->header_info,
+				       MAPV5_HDRINFO_HDR_TYPE_FMASK);
+
+		if (hdr_type == RMNET_MAP_HEADER_TYPE_CSUM_OFFLOAD)
+			packet_len += sizeof(*next_hdr);
+		else if (hdr_type != RMNET_MAP_HEADER_TYPE_COALESCING)
+			return 0;
 	}
 
 	if (skb->len < packet_len)
 		return 0;
 
-	if (next_hdr &&
-	    u8_get_bits(next_hdr->header_info, MAPV5_HDRINFO_HDR_TYPE_FMASK) !=
-	    RMNET_MAP_HEADER_TYPE_CSUM_OFFLOAD)
-		return 0;
-
 	return packet_len;
 }
 
@@ -497,34 +518,670 @@ void rmnet_map_checksum_uplink_packet(struct sk_buff *skb,
 	}
 }
 
-/* Process a MAPv5 packet header */
-int rmnet_map_process_next_hdr_packet(struct sk_buff *skb,
+static struct rmnet_map_v5_csum_header *
+rmnet_map_get_next_hdr(struct sk_buff *skb)
+{
+	return (struct rmnet_map_v5_csum_header *)(skb->data +
+						   sizeof(struct rmnet_map_header));
+}
+
+static u8 rmnet_map_get_next_hdr_type(struct sk_buff *skb)
+{
+	struct rmnet_map_v5_csum_header *hdr = rmnet_map_get_next_hdr(skb);
+
+	return u8_get_bits(hdr->header_info, MAPV5_HDRINFO_HDR_TYPE_FMASK);
+}
+
+static bool rmnet_map_get_csum_valid(struct sk_buff *skb)
+{
+	struct rmnet_map_v5_csum_header *hdr = rmnet_map_get_next_hdr(skb);
+
+	return !!(hdr->csum_info & MAPV5_CSUMINFO_VALID_FLAG);
+}
+
+/* Stamp GSO metadata so the network stack can segment a coalesced SKB. */
+static void rmnet_map_gso_stamp(struct sk_buff *skb,
+				struct rmnet_map_coal_metadata *coal_meta)
+{
+	struct skb_shared_info *shinfo = skb_shinfo(skb);
+
+	if (coal_meta->trans_proto == IPPROTO_TCP)
+		shinfo->gso_type = (coal_meta->ip_proto == 4) ?
+				   SKB_GSO_TCPV4 : SKB_GSO_TCPV6;
+	else
+		shinfo->gso_type = SKB_GSO_UDP_L4;
+
+	shinfo->gso_size = coal_meta->data_len;
+	shinfo->gso_segs = coal_meta->pkt_count;
+}
+
+/* Set the transport checksum to the pseudo-header checksum and request
+ * partial checksum offload, letting the NIC or stack finish it.
+ */
+static void rmnet_map_partial_csum(struct sk_buff *skb,
+				   struct rmnet_map_coal_metadata *coal_meta)
+{
+	u16 pkt_len = skb->len - coal_meta->ip_len;
+	unsigned char *data = skb->data;
+	__sum16 pseudo;
+
+	if (coal_meta->ip_proto == 4) {
+		struct iphdr *iph = (struct iphdr *)data;
+
+		pseudo = ~csum_tcpudp_magic(iph->saddr, iph->daddr,
+					    pkt_len, coal_meta->trans_proto, 0);
+	} else {
+		struct ipv6hdr *ip6h = (struct ipv6hdr *)data;
+
+		pseudo = ~csum_ipv6_magic(&ip6h->saddr, &ip6h->daddr,
+					  pkt_len, coal_meta->trans_proto, 0);
+	}
+
+	if (coal_meta->trans_proto == IPPROTO_TCP) {
+		struct tcphdr *tp = (struct tcphdr *)(data + coal_meta->ip_len);
+
+		tp->check = pseudo;
+		skb->csum_offset = offsetof(struct tcphdr, check);
+	} else {
+		struct udphdr *up = (struct udphdr *)(data + coal_meta->ip_len);
+
+		up->check = pseudo;
+		skb->csum_offset = offsetof(struct udphdr, check);
+	}
+
+	skb->ip_summed = CHECKSUM_PARTIAL;
+	skb->csum_start = skb->data + coal_meta->ip_len - skb->head;
+}
+
+/* On some hardware, num_nlos in the coalescing header can be reported
+ * incorrectly under certain conditions even though the per-NLO num_packets
+ * fields it is meant to summarize are correct. Recompute the true NLO count
+ * directly from the nl_pairs[] content rather than trusting the declared
+ * value, so that rmnet_map_v5_csum_fixup()'s single NLO, single packet check
+ * is reliable.
+ */
+static void rmnet_map_v5_fixup_num_nlos(struct rmnet_map_v5_coal_header *coal_hdr)
+{
+	u8 nlos = 0;
+	int i;
+
+	for (i = 0; i < RMNET_MAP_V5_MAX_NLOS; i++) {
+		if (coal_hdr->nl_pairs[i].num_packets)
+			nlos++;
+	}
+
+	coal_hdr->coal_info = u8_encode_bits(nlos, MAPV5_COALINFO_NUM_NLOS_FMASK) |
+			      (coal_hdr->coal_info & MAPV5_COALINFO_CSUM_VALID_FLAG);
+}
+
+/* The checksum valid indication for a single NLO, single packet coalescing
+ * frame cannot be trusted when the close reason is a TCP FIN/PSH, a packet
+ * count limit, a byte count limit or a time limit.
+ */
+static bool rmnet_map_v5_csum_fixup(struct rmnet_map_v5_coal_header *coal_hdr)
+{
+	u8 close_value = u8_get_bits(coal_hdr->close_info,
+				     MAPV5_CLOSEINFO_CLOSE_VALUE_FMASK);
+	u8 close_type = u8_get_bits(coal_hdr->close_info,
+				    MAPV5_CLOSEINFO_CLOSE_TYPE_FMASK);
+	u8 num_nlos = u8_get_bits(coal_hdr->coal_info,
+				  MAPV5_COALINFO_NUM_NLOS_FMASK);
+
+	/* Only applies to single NLO, single packet frames */
+	if (num_nlos != 1 || coal_hdr->nl_pairs[0].num_packets != 1)
+		return false;
+
+	/* TCP FIN or PSH triggered the close */
+	if (close_type == RMNET_MAP_COAL_CLOSE_COAL)
+		return true;
+
+	/* Hit a hardware limit */
+	if (close_type == RMNET_MAP_COAL_CLOSE_HW) {
+		switch (close_value) {
+		case RMNET_MAP_COAL_CLOSE_HW_PKT:
+		case RMNET_MAP_COAL_CLOSE_HW_BYTE:
+		case RMNET_MAP_COAL_CLOSE_HW_TIME:
+			return true;
+		}
+	}
+
+	return false;
+}
+
+/* Carve one logical segment from a coalesced SKB and append it to the list.
+ * Adjusts TCP sequence numbers, IP IDs/lengths, and checksum state.
+ */
+static void
+__rmnet_map_segment_coal_skb(struct sk_buff *coal_skb,
+			     struct rmnet_map_coal_metadata *coal_meta,
+			     struct sk_buff_head *list, u8 pkt_id,
+			     bool csum_valid)
+{
+	u32 dlen = coal_meta->data_len * coal_meta->pkt_count;
+	struct rmnet_priv *priv = netdev_priv(coal_skb->dev);
+	u32 hlen = coal_meta->ip_len + coal_meta->trans_len;
+	struct sk_buff *skbn;
+
+	/* RFC 768: UDP checksum is optional for IPv4, and is 0 if unused.
+	 * Such packets are never actually bad, regardless of what the
+	 * checksum bitmap says.
+	 */
+	if (!csum_valid && coal_meta->zero_csum)
+		csum_valid = true;
+
+	if (!csum_valid) {
+		priv->stats.coal_csum_drop++;
+		goto next_pkt;
+	}
+
+	skbn = alloc_skb(hlen + dlen + RMNET_MAP_DEAGGR_HEADROOM, GFP_ATOMIC);
+	if (!skbn)
+		goto next_pkt;
+
+	skb_reserve(skbn, hlen + RMNET_MAP_DEAGGR_HEADROOM);
+	skb_put_data(skbn,
+		     coal_skb->data + coal_meta->ip_len + coal_meta->trans_len +
+		     coal_meta->data_offset,
+		     dlen);
+
+	/* Restore transport header */
+	skb_push(skbn, coal_meta->trans_len);
+	memcpy(skbn->data, coal_meta->trans_header, coal_meta->trans_len);
+	skb_reset_transport_header(skbn);
+
+	if (coal_meta->trans_proto == IPPROTO_TCP) {
+		struct tcphdr *th = tcp_hdr(skbn);
+
+		th->seq = htonl(ntohl(th->seq) + coal_meta->data_offset);
+		/* Strip dangerous flags from non-final segments */
+		if ((th->fin || th->psh) &&
+		    hlen + coal_meta->data_offset + dlen < coal_skb->len) {
+			th->fin = 0;
+			th->psh = 0;
+		}
+	} else if (coal_meta->trans_proto == IPPROTO_UDP) {
+		struct udphdr *uh = udp_hdr(skbn);
+
+		uh->len = htons(skbn->len);
+	}
+
+	/* Restore IP header */
+	skb_push(skbn, coal_meta->ip_len);
+	memcpy(skbn->data, coal_meta->ip_header, coal_meta->ip_len);
+	skb_reset_network_header(skbn);
+
+	if (coal_meta->ip_proto == 4) {
+		struct iphdr *iph = ip_hdr(skbn);
+
+		iph->id = htons(ntohs(iph->id) + pkt_id);
+		iph->tot_len = htons(skbn->len);
+		iph->check = 0;
+		iph->check = ip_fast_csum(iph, iph->ihl);
+	} else {
+		ipv6_hdr(skbn)->payload_len =
+			htons(skbn->len - sizeof(struct ipv6hdr));
+	}
+
+	rmnet_map_partial_csum(skbn, coal_meta);
+
+	skbn->dev = coal_skb->dev;
+	priv->stats.coal_reconstruct++;
+
+	if (coal_meta->pkt_count > 1)
+		rmnet_map_gso_stamp(skbn, coal_meta);
+
+	__skb_queue_tail(list, skbn);
+
+next_pkt:
+	coal_meta->data_offset += dlen;
+	coal_meta->pkt_count = 0;
+}
+
+/* Parse the IP header of the coalesced frame and perform basic
+ * validation of header fields.
+ */
+static bool rmnet_map_coal_parse_ip_hdr(struct sk_buff *coal_skb,
+					struct rmnet_map_coal_metadata *meta,
+					bool *gro)
+{
+	struct rmnet_priv *priv = netdev_priv(coal_skb->dev);
+	struct ipv6hdr *ip6h;
+	struct iphdr *iph;
+	__be16 frag_off;
+	u8 protocol;
+	int ret;
+
+	if (coal_skb->len < sizeof(*iph)) {
+		priv->stats.coal_ip_invalid++;
+		return false;
+	}
+
+	iph = (struct iphdr *)coal_skb->data;
+
+	if (iph->version == 4) {
+		meta->ip_proto = 4;
+		meta->ip_len = iph->ihl * 4;
+		meta->trans_proto = iph->protocol;
+		meta->ip_header = iph;
+		if (meta->ip_len < sizeof(*iph) || coal_skb->len < meta->ip_len) {
+			priv->stats.coal_ip_invalid++;
+			return false;
+		}
+
+		if (ip_is_fragment(iph)) {
+			priv->stats.coal_ip_invalid++;
+			return false;
+		}
+
+		if (iph->ihl != 5)
+			*gro = false;
+	} else if (iph->version == 6) {
+		if (coal_skb->len < sizeof(*ip6h)) {
+			priv->stats.coal_ip_invalid++;
+			return false;
+		}
+
+		ip6h = (struct ipv6hdr *)iph;
+		protocol = ip6h->nexthdr;
+		meta->ip_proto = 6;
+		ret = ipv6_skip_exthdr(coal_skb, sizeof(*ip6h), &protocol,
+				       &frag_off);
+		if (ret < 0 || frag_off) {
+			priv->stats.coal_ip_invalid++;
+			return false;
+		}
+
+		meta->ip_len = (u16)ret;
+		meta->trans_proto = protocol;
+		meta->ip_header = ip6h;
+		if (meta->ip_len > sizeof(*ip6h))
+			*gro = false;
+	} else {
+		priv->stats.coal_ip_invalid++;
+		return false;
+	}
+
+	return true;
+}
+
+/* Parse the transport header following the IP header into coal_meta. The
+ * available length is checked before any field is read.
+ */
+static bool rmnet_map_coal_parse_trans_hdr(struct sk_buff *coal_skb,
+					   struct rmnet_map_coal_metadata *meta)
+{
+	struct rmnet_priv *priv = netdev_priv(coal_skb->dev);
+	struct udphdr *uh;
+	struct tcphdr *th;
+	u32 avail;
+	u8 *base;
+
+	base = (u8 *)meta->ip_header + meta->ip_len;
+	avail = coal_skb->len - meta->ip_len;
+
+	if (meta->trans_proto == IPPROTO_TCP) {
+		if (avail < sizeof(*th)) {
+			priv->stats.coal_trans_invalid++;
+			return false;
+		}
+
+		th = (struct tcphdr *)base;
+		meta->trans_len = th->doff * 4;
+		meta->trans_header = th;
+		if (meta->trans_len < sizeof(*th) || avail < meta->trans_len) {
+			priv->stats.coal_trans_invalid++;
+			return false;
+		}
+	} else if (meta->trans_proto == IPPROTO_UDP) {
+		if (avail < sizeof(*uh)) {
+			priv->stats.coal_trans_invalid++;
+			return false;
+		}
+
+		uh = (struct udphdr *)base;
+		meta->trans_len = sizeof(*uh);
+		meta->trans_header = uh;
+		if (meta->ip_proto == 4 && !uh->check)
+			meta->zero_csum = true;
+	} else {
+		priv->stats.coal_trans_invalid++;
+		return false;
+	}
+
+	return true;
+}
+
+/* Reject the frame if the total data bytes claimed by all NLOs exceed
+ * the actual payload in the SKB.  Each pkt_len covers IP+transport
+ * headers plus per-packet data. Headers appear once, so subtract hlen
+ * per packet and check the running sum against available data.
+ */
+static bool rmnet_map_coal_validate_bounds(struct sk_buff *coal_skb,
+					   struct rmnet_map_v5_coal_header *coal_hdr,
+					   u8 num_nlos, u32 hlen)
+{
+	u32 total_data = 0;
+	u32 nlo_len;
+	u16 plen;
+	u8 i;
+
+	for (i = 0; i < num_nlos; i++) {
+		plen = ntohs(coal_hdr->nl_pairs[i].pkt_len);
+
+		if (plen < hlen)
+			return false;
+
+		nlo_len = (u32)(plen - hlen) * coal_hdr->nl_pairs[i].num_packets;
+		if (total_data + nlo_len > coal_skb->len - hlen)
+			return false;
+
+		total_data += nlo_len;
+	}
+
+	return true;
+}
+
+/* Attempt the GRO-friendly fast path for a single-NLO, checksum-valid frame
+ * by reusing the original SKB and stamping GSO metadata instead of copying
+ * out each segment.  Returns true if the frame was consumed via the fast
+ * path, or false if the caller should fall back to full segmentation.
+ */
+static bool rmnet_map_coal_gro_fast_path(struct sk_buff *coal_skb,
+					 struct rmnet_map_v5_coal_header *coal_hdr,
+					 struct rmnet_map_coal_metadata *coal_meta,
+					 struct sk_buff_head *list,
+					 u8 num_nlos, bool gro)
+{
+	u32 hlen = coal_meta->ip_len + coal_meta->trans_len;
+
+	if (!gro || num_nlos != 1 ||
+	    !(coal_hdr->coal_info & MAPV5_COALINFO_CSUM_VALID_FLAG))
+		return false;
+
+	coal_meta->data_len = ntohs(coal_hdr->nl_pairs[0].pkt_len) - hlen;
+	coal_meta->pkt_count = coal_hdr->nl_pairs[0].num_packets;
+
+	coal_skb->ip_summed = CHECKSUM_UNNECESSARY;
+	if (coal_meta->pkt_count > 1) {
+		rmnet_map_partial_csum(coal_skb, coal_meta);
+		rmnet_map_gso_stamp(coal_skb, coal_meta);
+	}
+
+	__skb_queue_tail(list, coal_skb);
+	return true;
+}
+
+/* NLO packet lengths are already bounds-checked by
+ * rmnet_map_coal_validate_bounds() so no further validation is needed here.
+ */
+static void rmnet_map_coal_segment_loop(struct sk_buff *coal_skb,
+					struct rmnet_map_v5_coal_header *coal_hdr,
+					struct rmnet_map_coal_metadata *coal_meta,
+					struct sk_buff_head *list,
+					u64 nlo_err_mask, bool gro, u8 num_nlos)
+{
+	struct rmnet_priv *priv = netdev_priv(coal_skb->dev);
+	u32 hlen = coal_meta->ip_len + coal_meta->trans_len;
+	u8 pkt, total_pkt = 0;
+	bool csum_err;
+	u16 pkt_len;
+	u8 nlo;
+
+	for (nlo = 0; nlo < num_nlos; nlo++) {
+		pkt_len = ntohs(coal_hdr->nl_pairs[nlo].pkt_len);
+		pkt_len -= hlen;
+		coal_meta->data_len = pkt_len;
+
+		/* nlo_err_mask is one flat bitstream across all NLOs. Shift
+		 * it once per packet in absolute frame order and do not
+		 * re-align at the NLO boundary above. See the comment on
+		 * rmnet_map_data_check_coal_header() for why.
+		 */
+		for (pkt = 0; pkt < coal_hdr->nl_pairs[nlo].num_packets;
+		     pkt++, total_pkt++, nlo_err_mask >>= 1) {
+			csum_err = nlo_err_mask & 1;
+
+			if (csum_err)
+				priv->stats.coal_csum_err++;
+
+			if (!gro) {
+				coal_meta->pkt_count = 1;
+				__rmnet_map_segment_coal_skb(coal_skb, coal_meta,
+							     list, total_pkt,
+							     !csum_err);
+				continue;
+			}
+
+			if (csum_err) {
+				if (coal_meta->pkt_count)
+					__rmnet_map_segment_coal_skb(coal_skb,
+								     coal_meta,
+								     list,
+								     total_pkt,
+								     true);
+				coal_meta->pkt_count = 1;
+				__rmnet_map_segment_coal_skb(coal_skb, coal_meta,
+							     list, total_pkt,
+							     false);
+			} else {
+				coal_meta->pkt_count++;
+			}
+		}
+
+		/* Flush remaining packets from this NLO */
+		if (coal_meta->pkt_count)
+			__rmnet_map_segment_coal_skb(coal_skb, coal_meta, list,
+						     total_pkt, true);
+	}
+}
+
+/* Expand a coalesced SKB into individual IP packets placed on the list.
+ * NLOs with checksum errors are dropped. __rmnet_map_ingress_handler will
+ * free the SKB in the error case.
+ */
+static int rmnet_map_segment_coal_skb(struct sk_buff *coal_skb,
+				      u64 nlo_err_mask,
+				      struct sk_buff_head *list,
 				      u16 len)
 {
-	struct rmnet_priv *priv = netdev_priv(skb->dev);
-	struct rmnet_map_v5_csum_header *next_hdr;
-	u8 nexthdr_type;
+	bool gro = coal_skb->dev->features & NETIF_F_GRO_HW;
+	struct rmnet_map_v5_coal_header *coal_hdr;
+	struct rmnet_map_coal_metadata coal_meta;
+	u8 num_nlos;
+	u32 hlen;
+
+	memset(&coal_meta, 0, sizeof(coal_meta));
+
+	/* Drop any MAP frame padding. The coal header is counted in len */
+	skb_pull(coal_skb, sizeof(struct rmnet_map_header));
+	skb_trim(coal_skb, len);
+	coal_hdr = (struct rmnet_map_v5_coal_header *)coal_skb->data;
+	rmnet_map_v5_fixup_num_nlos(coal_hdr);
+	num_nlos = u8_get_bits(coal_hdr->coal_info, MAPV5_COALINFO_NUM_NLOS_FMASK);
+	skb_pull(coal_skb, sizeof(*coal_hdr));
+
+	if (!rmnet_map_coal_parse_ip_hdr(coal_skb, &coal_meta, &gro))
+		return -EINVAL;
 
-	next_hdr = (struct rmnet_map_v5_csum_header *)(skb->data +
-			sizeof(struct rmnet_map_header));
+	if (!rmnet_map_coal_parse_trans_hdr(coal_skb, &coal_meta))
+		return -EINVAL;
 
-	nexthdr_type = u8_get_bits(next_hdr->header_info,
-				   MAPV5_HDRINFO_HDR_TYPE_FMASK);
+	hlen = coal_meta.ip_len + coal_meta.trans_len;
 
-	if (nexthdr_type != RMNET_MAP_HEADER_TYPE_CSUM_OFFLOAD)
+	if (!rmnet_map_coal_validate_bounds(coal_skb, coal_hdr, num_nlos, hlen))
 		return -EINVAL;
 
-	if (unlikely(!(skb->dev->features & NETIF_F_RXCSUM))) {
-		priv->stats.csum_sw++;
-	} else if (next_hdr->csum_info & MAPV5_CSUMINFO_VALID_FLAG) {
-		priv->stats.csum_ok++;
-		skb->ip_summed = CHECKSUM_UNNECESSARY;
-	} else {
-		priv->stats.csum_valid_unset++;
+	if (rmnet_map_v5_csum_fixup(coal_hdr) && !coal_meta.zero_csum) {
+		coal_skb->ip_summed = CHECKSUM_NONE;
+		__skb_queue_tail(list, coal_skb);
+		return 0;
+	}
+
+	if (rmnet_map_coal_gro_fast_path(coal_skb, coal_hdr, &coal_meta, list,
+					 num_nlos, gro))
+		return 0;
+
+	rmnet_map_coal_segment_loop(coal_skb, coal_hdr, &coal_meta, list,
+				    nlo_err_mask, gro, num_nlos);
+
+	return 0;
+}
+
+/* Log the hardware close-reason counter for a coalescing header. */
+static void rmnet_map_data_log_close_stats(struct rmnet_priv *priv,
+					   u8 type, u8 code)
+{
+	switch (type) {
+	case RMNET_MAP_COAL_CLOSE_NON_COAL:
+		priv->stats.coal_close_non_coal++;
+		break;
+	case RMNET_MAP_COAL_CLOSE_IP_MISS:
+		priv->stats.coal_close_ip_miss++;
+		break;
+	case RMNET_MAP_COAL_CLOSE_TRANS_MISS:
+		priv->stats.coal_close_trans_miss++;
+		break;
+	case RMNET_MAP_COAL_CLOSE_HW:
+		switch (code) {
+		case RMNET_MAP_COAL_CLOSE_HW_NL:
+			priv->stats.coal_close_hw_nl++;
+			break;
+		case RMNET_MAP_COAL_CLOSE_HW_PKT:
+			priv->stats.coal_close_hw_pkt++;
+			break;
+		case RMNET_MAP_COAL_CLOSE_HW_BYTE:
+			priv->stats.coal_close_hw_byte++;
+			break;
+		case RMNET_MAP_COAL_CLOSE_HW_TIME:
+			priv->stats.coal_close_hw_time++;
+			break;
+		case RMNET_MAP_COAL_CLOSE_HW_EVICT:
+			priv->stats.coal_close_hw_evict++;
+			break;
+		default:
+			break;
+		}
+		break;
+	case RMNET_MAP_COAL_CLOSE_COAL:
+		priv->stats.coal_close_coal++;
+		break;
+	default:
+		break;
+	}
+}
+
+/* Validate the coalescing header and build the checksum error mask.
+ *
+ * Checks performed:
+ *  - MAP pkt_len accommodates the coal header (coal header is counted in
+ *    pkt_len. pkt_len < sizeof(*coal_hdr) means no payload is possible).
+ *  - num_nlos is in [1, RMNET_MAP_V5_MAX_NLOS].
+ *  - Total packet count does not exceed RMNET_MAP_V5_MAX_PACKETS.
+ *
+ * nlo_err_mask is NOT six independent per-NLO bitmaps. Each nl_pairs
+ * slot only has room for an 8 bit csum_error_bitmap, but a single NLO
+ * can carry more than 8 packets (up to RMNET_MAP_V5_MAX_PACKETS), so
+ * hardware spills a wide NLO's error bits into the csum_error_bitmap
+ * bytes of the following slots rather than truncating them. The
+ * six bitmap bytes are therefore always concatenated in slot order
+ * into one flat RMNET_MAP_V5_MAX_NLOS * 8 = RMNET_MAP_V5_MAX_PACKETS
+ * bit value, addressed by a packet's absolute position in the frame,
+ * regardless of how many NLOs are actually in use. Receivers must
+ * walk it as a single contiguous stream and must not expect it to
+ * align it at NLO boundaries.
+ */
+static int rmnet_map_data_check_coal_header(struct sk_buff *skb,
+					    u64 *nlo_err_mask)
+{
+	struct rmnet_map_header *maph = (struct rmnet_map_header *)skb->data;
+	struct rmnet_priv *priv = netdev_priv(skb->dev);
+	struct rmnet_map_v5_coal_header *coal_hdr;
+	u8 num_nlos, pkts = 0;
+	u64 mask = 0;
+	int i;
+
+	/* coal header is counted in pkt_len */
+	if (ntohs(maph->pkt_len) < sizeof(*coal_hdr)) {
+		priv->stats.coal_hdr_nlo_err++;
+		return -EINVAL;
+	}
+
+	coal_hdr = (struct rmnet_map_v5_coal_header *)(skb->data + sizeof(*maph));
+	num_nlos = u8_get_bits(coal_hdr->coal_info, MAPV5_COALINFO_NUM_NLOS_FMASK);
+
+	if (num_nlos == 0 || num_nlos > RMNET_MAP_V5_MAX_NLOS) {
+		priv->stats.coal_hdr_nlo_err++;
+		return -EINVAL;
 	}
 
-	/* Pull csum v5 header */
-	skb_pull(skb, sizeof(*next_hdr));
+	for (i = 0; i < RMNET_MAP_V5_MAX_NLOS; i++) {
+		u8 err = coal_hdr->nl_pairs[i].csum_error_bitmap;
+		u8 pkt = coal_hdr->nl_pairs[i].num_packets;
+
+		mask |= ((u64)err) << (8 * i);
+		pkts += pkt;
+		if (pkts > RMNET_MAP_V5_MAX_PACKETS) {
+			priv->stats.coal_hdr_pkt_err++;
+			return -EINVAL;
+		}
+	}
+
+	priv->stats.coal_pkts += pkts;
+	rmnet_map_data_log_close_stats(priv,
+				       u8_get_bits(coal_hdr->close_info,
+						   MAPV5_CLOSEINFO_CLOSE_TYPE_FMASK),
+				       u8_get_bits(coal_hdr->close_info,
+						   MAPV5_CLOSEINFO_CLOSE_VALUE_FMASK));
+
+	*nlo_err_mask = mask;
+	return 0;
+}
+
+int rmnet_map_process_next_hdr_packet(struct sk_buff *skb,
+				      struct sk_buff_head *list,
+				      u16 len, u32 data_format)
+{
+	struct rmnet_priv *priv = netdev_priv(skb->dev);
+	u64 nlo_err_mask;
+	int rc;
+
+	switch (rmnet_map_get_next_hdr_type(skb)) {
+	case RMNET_MAP_HEADER_TYPE_COALESCING:
+		if (!(data_format & RMNET_FLAGS_INGRESS_COALESCE))
+			return -EINVAL;
+
+		priv->stats.coal_rx++;
+		rc = rmnet_map_data_check_coal_header(skb, &nlo_err_mask);
+		if (rc)
+			return rc;
+
+		rc = rmnet_map_segment_coal_skb(skb, nlo_err_mask, list, len);
+		if (rc)
+			return rc;
+
+		if (skb_peek(list) != skb)
+			consume_skb(skb);
+		break;
+
+	case RMNET_MAP_HEADER_TYPE_CSUM_OFFLOAD:
+		if (unlikely(!(skb->dev->features & NETIF_F_RXCSUM))) {
+			priv->stats.csum_sw++;
+		} else if (rmnet_map_get_csum_valid(skb)) {
+			priv->stats.csum_ok++;
+			skb->ip_summed = CHECKSUM_UNNECESSARY;
+		} else {
+			priv->stats.csum_valid_unset++;
+		}
+
+		skb_pull(skb, sizeof(struct rmnet_map_header) +
+			      sizeof(struct rmnet_map_v5_csum_header));
+		skb_trim(skb, len);
+		__skb_queue_tail(list, skb);
+		break;
+
+	default:
+		return -EINVAL;
+	}
 
 	return 0;
 }
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c
index 5f921cddf82b4..a21d6543c014f 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c
@@ -183,6 +183,26 @@ static const char rmnet_gstrings_stats[][ETH_GSTRING_LEN] = {
 	"Checksum skipped",
 	"Checksum computed in software",
 	"Checksum computed in hardware",
+	/* DL coalescing */
+	"Coal frames received",
+	"Packets in coal frames",
+	"Coal hdr NLO errors",
+	"Coal hdr pkt count errors",
+	"Coal checksum errors",
+	"Coal packets dropped on csum err",
+	"Coal segments reconstructed",
+	"Coal invalid IP version",
+	"Coal invalid transport",
+	/* close reasons */
+	"Coal closed: non-coal",
+	"Coal closed: IP miss",
+	"Coal closed: transport miss",
+	"Coal closed: hw NL limit",
+	"Coal closed: hw pkt limit",
+	"Coal closed: hw byte limit",
+	"Coal closed: hw time limit",
+	"Coal closed: hw evict",
+	"Coal closed: FIN/PSH",
 };
 
 static void rmnet_get_strings(struct net_device *dev, u32 stringset, u8 *buf)
@@ -323,6 +343,7 @@ int rmnet_vnd_newlink(u8 id, struct net_device *rmnet_dev,
 	rmnet_dev->hw_features = NETIF_F_RXCSUM;
 	rmnet_dev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
 	rmnet_dev->hw_features |= NETIF_F_SG;
+	rmnet_dev->hw_features |= NETIF_F_GRO_HW;
 
 	priv->real_dev = real_dev;
 
diff --git a/include/linux/if_rmnet.h b/include/linux/if_rmnet.h
index c44bf6e80ecb4..5df4d417f3d2c 100644
--- a/include/linux/if_rmnet.h
+++ b/include/linux/if_rmnet.h
@@ -70,5 +70,36 @@ struct rmnet_map_v5_csum_header {
 #define MAPV5_HDRINFO_HDR_TYPE_FMASK	GENMASK(7, 1)
 #define MAPV5_CSUMINFO_VALID_FLAG	BIT(7)
 
+#define RMNET_MAP_HEADER_TYPE_COALESCING   1
 #define RMNET_MAP_HEADER_TYPE_CSUM_OFFLOAD 2
+
+/* MAPv5 coalescing header */
+#define RMNET_MAP_V5_MAX_NLOS		6
+#define RMNET_MAP_V5_MAX_PACKETS	48
+
+/* One Number-Length Object pair: per-NLO packet count and length. */
+struct rmnet_map_v5_nl_pair {
+	__be16 pkt_len;
+	u8  csum_error_bitmap;
+	u8  num_packets;
+} __aligned(1);
+
+/* MAPv5 coalescing header: describes up to RMNET_MAP_V5_MAX_NLOS NLOs.
+ * The header immediately follows the MAP header in the frame and is
+ * included in the MAP pkt_len field.
+ */
+struct rmnet_map_v5_coal_header {
+	u8  header_info;	/* MAPV5_HDRINFO_NXT_HDR_FLAG, MAPV5_HDRINFO_HDR_TYPE_FMASK */
+	u8  coal_info;		/* MAPV5_COALINFO_* */
+	u8  close_info;		/* MAPV5_CLOSEINFO_* */
+	u8  veid_info;		/* MAPV5_VEIDINFO_* */
+	struct rmnet_map_v5_nl_pair nl_pairs[RMNET_MAP_V5_MAX_NLOS];
+} __aligned(1);
+
+#define MAPV5_COALINFO_NUM_NLOS_FMASK		GENMASK(6, 4)
+#define MAPV5_COALINFO_CSUM_VALID_FLAG		BIT(7)
+#define MAPV5_CLOSEINFO_CLOSE_TYPE_FMASK	GENMASK(3, 0)
+#define MAPV5_CLOSEINFO_CLOSE_VALUE_FMASK	GENMASK(7, 4)
+#define MAPV5_VEIDINFO_VEID_FMASK		GENMASK(3, 0)
+
 #endif /* !(_LINUX_IF_RMNET_H_) */
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 245b362045253..349fcddc6622f 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -2022,6 +2022,7 @@ enum {
 #define RMNET_FLAGS_EGRESS_MAP_CKSUMV4            (1U << 3)
 #define RMNET_FLAGS_INGRESS_MAP_CKSUMV5           (1U << 4)
 #define RMNET_FLAGS_EGRESS_MAP_CKSUMV5            (1U << 5)
+#define RMNET_FLAGS_INGRESS_COALESCE              (1U << 6)
 
 enum {
 	IFLA_RMNET_UNSPEC,

3/2 2026/10/01 02:23 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 18975
							output: 38
							thoughts: 321
						

Thoughts:
**Assessing the Fuzzing Potential of This Patch**

Okay, let's take a look at this patch and decide if it's worth our time with syzkaller. First, I need to understand what's actually being changed. Looks like we've got modifications to a few files: `Documentation/networking/device_drivers/cellular/qualcomm/rmnet.rst`, some configuration files (`rmnet_config.c`, `rmnet_config.h`), some handler and mapping files (`rmnet_handlers.c`, `rmnet_map.h`, `rmnet_map_data.c`),  `rmnet_vnd.c`, `include/linux/if_rmnet.h`, and `include/uapi/linux/if_link.h`.

Hmm, this all seems to revolve around the rmnet driver. Right, rmnet… that's the virtual network device driver specifically for Qualcomm modems. Now, the key question for fuzzing is always "where are the interesting data flows and control paths?" Can rmnet virtual devices be constructed atop other device types using the rtnl link operations? I think that's a key question here. The rtnl_link_ops are a great target for fuzzing. If this patch interacts with these operations, that's a good sign. Let's dig deeper and see if we can find references to `rmnet_link_ops` in the kernel code using `grepper`. I need to figure out how this rmnet driver interacts with the networking stack in general and see if any newly introduced code paths look interesting.



4/2 2026/10/01 02:23 tool grepper
0m Args:
{
  "Expression": "rmnet_link_ops",
  "PathPrefix": "drivers/net/ethernet/qualcomm/rmnet"
}

Results:
{
  "Output": "drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c=416=static int rmnet_fill_info(struct sk_buff *skb, const struct net_device *dev)\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-437-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:438:struct rtnl_link_ops rmnet_link_ops __read_mostly = {\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-439-\t.kind\t\t= \"rmnet\",\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c=557=static int __init rmnet_init(void)\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-564-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:565:\trc = rtnl_link_register(\u0026rmnet_link_ops);\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-566-\tif (rc != 0) {\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c=573=static void __exit rmnet_exit(void)\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-574-{\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:575:\trtnl_link_unregister(\u0026rmnet_link_ops);\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-576-\tunregister_netdevice_notifier(\u0026rmnet_dev_notifier);\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.h=33=struct rmnet_port {\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.h-55-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.h:56:extern struct rtnl_link_ops rmnet_link_ops;\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.h-57-\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c=327=int rmnet_vnd_newlink(u8 id, struct net_device *rmnet_dev,\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c-362-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c:363:\t\trmnet_dev-\u003ertnl_link_ops = \u0026rmnet_link_ops;\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c-364-\n"
}

5/2 2026/10/01 02:23 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 20393
							output: 47
							thoughts: 53
						

Thoughts:
Okay, here's my take on those thoughts, framed as my own:

**Analyzing the rmnet Registration and Initialization**

Alright, so `rmnet` is getting registered, which means we're dealing with its network link operations. The key, as always, lies in how it's being *initialized*. I need to drill down into `rmnet_config.c` specifically, and zero in on the `rmnet_newlink` function. That's where the magic happens, or at least, that's where the *relevant* magic for my purposes happens. The real question is, what kind of `real_dev` is it expecting or requiring? Is it a virtual device? Is it associated with a physical interface, or is it more of an abstraction? I need to understand its relationship to the underlying hardware to figure out how it behaves and how it fits into the broader network architecture. Time to dive into that code and find the answers.



6/2 2026/10/01 02:24 tool read-file
0m Args:
{
  "File": "drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c",
  "FirstLine": 120,
  "LineCount": 60
}

Results:
{
  "Contents": " 120:\t\tif (port-\u003ermnet_mode != RMNET_EPMODE_BRIDGE)\n 121:\t\t\treturn;\n 122:\t\n 123:\t\trmnet_dev = port-\u003ermnet_dev;\n 124:\t\tif (!port-\u003enr_rmnet_devs) {\n 125:\t\t\t/* bridge device */\n 126:\t\t\treal_dev = port-\u003ebridge_ep;\n 127:\t\t\tbridge_dev = port-\u003edev;\n 128:\t\n 129:\t\t\treal_port = rmnet_get_port_rtnl(real_dev);\n 130:\t\t\treal_port-\u003ebridge_ep = NULL;\n 131:\t\t\treal_port-\u003ermnet_mode = RMNET_EPMODE_VND;\n 132:\t\t} else {\n 133:\t\t\t/* real device */\n 134:\t\t\tbridge_dev = port-\u003ebridge_ep;\n 135:\t\n 136:\t\t\tport-\u003ebridge_ep = NULL;\n 137:\t\t\tport-\u003ermnet_mode = RMNET_EPMODE_VND;\n 138:\t\t}\n 139:\t\n 140:\t\tnetdev_upper_dev_unlink(bridge_dev, rmnet_dev);\n 141:\t\trmnet_unregister_real_device(bridge_dev);\n 142:\t}\n 143:\t\n 144:\tstatic int rmnet_newlink(struct net_device *dev,\n 145:\t\t\t\t struct rtnl_newlink_params *params,\n 146:\t\t\t\t struct netlink_ext_ack *extack)\n 147:\t{\n 148:\t\tstruct net *link_net = rtnl_newlink_link_net(params);\n 149:\t\tu32 data_format = RMNET_FLAGS_INGRESS_DEAGGREGATION;\n 150:\t\tstruct nlattr **data = params-\u003edata;\n 151:\t\tstruct nlattr **tb = params-\u003etb;\n 152:\t\tstruct net_device *real_dev;\n 153:\t\tint mode = RMNET_EPMODE_VND;\n 154:\t\tstruct rmnet_endpoint *ep;\n 155:\t\tstruct rmnet_port *port;\n 156:\t\tint err = 0;\n 157:\t\tu16 mux_id;\n 158:\t\n 159:\t\tif (!tb[IFLA_LINK]) {\n 160:\t\t\tNL_SET_ERR_MSG_MOD(extack, \"link not specified\");\n 161:\t\t\treturn -EINVAL;\n 162:\t\t}\n 163:\t\n 164:\t\treal_dev = __dev_get_by_index(link_net, nla_get_u32(tb[IFLA_LINK]));\n 165:\t\tif (!real_dev) {\n 166:\t\t\tNL_SET_ERR_MSG_MOD(extack, \"link does not exist\");\n 167:\t\t\treturn -ENODEV;\n 168:\t\t}\n 169:\t\n 170:\t\tif (data[IFLA_RMNET_FLAGS]) {\n 171:\t\t\tstruct ifla_rmnet_flags *flags;\n 172:\t\n 173:\t\t\tflags = nla_data(data[IFLA_RMNET_FLAGS]);\n 174:\t\t\tdata_format \u0026= ~flags-\u003emask;\n 175:\t\t\tdata_format |= flags-\u003eflags \u0026 flags-\u003emask;\n 176:\t\t}\n 177:\t\n 178:\t\tif (!rmnet_config_data_format_valid(data_format)) {\n 179:\t\t\tNL_SET_ERR_MSG_MOD(extack,\n"
}

7/2 2026/10/01 02:24 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 21654
							output: 40
							thoughts: 118
						

Thoughts:
**My Analysis of `rmnet_newlink` and Packet Flow**

Okay, so `rmnet_newlink` is using `IFLA_LINK` to conjure an rmnet link, and it's doing this on *any* actual `net_device`? That's the first interesting point. The immediate question then becomes: How exactly do packets from the "real" device get shuttled over to the rmnet interface? I need to understand that hand-off.

My hunch is the key lies within `rmnet_rx_handler`. Let's dig in there. Ah, yes, here we go... When a real device is registered using `rmnet_register_real_device`, the system cleverly hooks up an rx handler. Specifically, it's registering `rmnet_rx_handler` as the receiving handler using `netdev_rx_handler_register(real_dev, rmnet_rx_handler, port)`. The `port` is also of interest, as it is being passed.

To be absolutely sure, let me confirm this setup in `rmnet_config.c`. This is where I'd expect the registration to occur. I'll double-check the arguments being passed to make sure it's consistent.



8/2 2026/10/01 02:24 tool grepper
0m Args:
{
  "Expression": "netdev_rx_handler_register",
  "PathPrefix": "drivers/net/ethernet/qualcomm/rmnet"
}

Results:
{
  "Output": "drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c=77=static int rmnet_register_real_device(struct net_device *real_dev,\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-99-\tport-\u003edev = real_dev;\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:100:\trc = netdev_rx_handler_register(real_dev, rmnet_rx_handler, port);\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-101-\tif (rc) {\n"
}

9/2 2026/10/01 02:24 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 22251
							output: 41
							thoughts: 79
						

Thoughts:
Okay, here's my take on those thoughts, framed as an expert's internal monologue:

**Packet Flow Analysis: The RMNET Ingress Path**

Alright, let's break this down. My initial hunch is confirmed: any packet hitting that `real_dev` interface – and that covers a *lot* of ground, from the obvious like `tun` and `tap` to the more subtle `veth`, `loopback`, and even something as basic as `dummy` – it all funnels right into `rmnet_rx_handler`. That's the entry point, the first stage.

Now, that's the key. That function is the gatekeeper. From there, I need to understand the control flow, the data path. I need to trace *exactly* where that traffic goes. Specifically, my mind hones in on two critical functions: `__rmnet_map_ingress_handler` and `rmnet_map_process_next_hdr_packet`. These are the potential subroutines that will likely do the packet forwarding.

I'm betting these are the work horses. Knowing these names suggests that the next steps involve handling the ingress traffic and examining the headers, probably to decide what to do with the payload. This is where the magic happens. Time to dissect them.



10/2 2026/10/01 02:24 tool grepper
0m Args:
{
  "Expression": "__rmnet_map_ingress_handler",
  "PathPrefix": "drivers/net/ethernet/qualcomm/rmnet"
}

Results:
{
  "Output": "drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c=65=static void\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c:66:__rmnet_map_ingress_handler(struct sk_buff *skb,\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c-67-\t\t\t    struct rmnet_port *port,\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c=123=rmnet_map_ingress_handler(struct sk_buff *skb,\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c-141-\t\twhile ((skbn = rmnet_map_deaggregate(skb, data_format)) != NULL)\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c:142:\t\t\t__rmnet_map_ingress_handler(skbn, port, data_format);\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c-143-\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c-146-\t\tif (rmnet_map_validate_packet_len(skb, data_format))\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c:147:\t\t\t__rmnet_map_ingress_handler(skb, port, data_format);\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c-148-\t\telse\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c=917=static void rmnet_map_coal_segment_loop(struct sk_buff *coal_skb,\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c-978-/* Expand a coalesced SKB into individual IP packets placed on the list.\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c:979: * NLOs with checksum errors are dropped. __rmnet_map_ingress_handler will\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c-980- * free the SKB in the error case.\n"
}

11/2 2026/10/01 02:24 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 23227
							output: 31
							thoughts: 197
						

Thoughts:
**My Assessment of the rmnet Ingress Path and Syzkaller's Capabilities**

Okay, so here's what I'm seeing: the `rmnet_rx_handler` function is the initial entry point, and it's calling `rmnet_map_ingress_handler`. That in turn calls `__rmnet_map_ingress_handler`. Then, `__rmnet_map_ingress_handler` calls `rmnet_map_process_next_hdr_packet`. Got it. That seems like a pretty standard ingress processing flow.

Now, the really interesting part: syzkaller. It looks like syzkaller has *full* netlink support for `rtnl_link`, which is key. It can configure `rmnet` links and inject packets using tun/tap/raw sockets. My mind immediately goes to the potential for exploitation. It's fantastic that syzkaller can manipulate `rtnl_link` because I know that's the backbone of network interface configuration. Let me just check syzkaller's syzlang descriptions... or how `rtnl` links are defined... ah, yes, syzkaller constructs links with `ip link add link ... type rmnet ...`.

And the best part? We can create `rmnet` on *any* dummy or veth interface in userspace. No specialized hardware needed! That's a huge win. This means `rmnet` is completely reachable and testable in standard virtualized environments like QEMU and GCE, without relying on any specific physical hardware setup. This makes testing and fuzzing incredibly accessible. Now I'm just curious, let me check the Kconfig requirements for rmnet, just to make sure there are no other configurations in play that I should be aware of.



12/2 2026/10/01 02:24 tool grepper
0m Args:
{
  "Expression": "RMNET",
  "PathPrefix": "drivers/net/ethernet/qualcomm"
}

Results:
{
  "Output": "\nFull output is too long, showing 200 out of 556 lines.\nUse more precise expression if possible.\n\ndrivers/net/ethernet/qualcomm/Makefile=14=obj-$(CONFIG_QCOM_PPE) += ppe/\ndrivers/net/ethernet/qualcomm/Makefile:15:obj-$(CONFIG_RMNET) += rmnet/\n--\ndrivers/net/ethernet/qualcomm/rmnet/Kconfig-2-#\ndrivers/net/ethernet/qualcomm/rmnet/Kconfig:3:# RMNET MAP driver\ndrivers/net/ethernet/qualcomm/rmnet/Kconfig-4-#\ndrivers/net/ethernet/qualcomm/rmnet/Kconfig-5-\ndrivers/net/ethernet/qualcomm/rmnet/Kconfig:6:menuconfig RMNET\ndrivers/net/ethernet/qualcomm/rmnet/Kconfig-7-\ttristate \"RmNet MAP driver\"\n--\ndrivers/net/ethernet/qualcomm/rmnet/Kconfig-10-\thelp\ndrivers/net/ethernet/qualcomm/rmnet/Kconfig:11:\t  If you select this, you will enable the RMNET module which is used\ndrivers/net/ethernet/qualcomm/rmnet/Kconfig-12-\t  for handling data in the multiplexing and aggregation protocol (MAP)\ndrivers/net/ethernet/qualcomm/rmnet/Kconfig:13:\t  format in the embedded data path. RMNET devices can be attached to\ndrivers/net/ethernet/qualcomm/rmnet/Kconfig-14-\t  any IP mode physical device.\n--\ndrivers/net/ethernet/qualcomm/rmnet/Makefile-2-#\ndrivers/net/ethernet/qualcomm/rmnet/Makefile:3:# Makefile for the RMNET module\ndrivers/net/ethernet/qualcomm/rmnet/Makefile-4-#\n--\ndrivers/net/ethernet/qualcomm/rmnet/Makefile=10=rmnet-y\t\t += rmnet_map_command.o\ndrivers/net/ethernet/qualcomm/rmnet/Makefile:11:obj-$(CONFIG_RMNET) += rmnet.o\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-3- *\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:4: * RMNET configuration engine\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-5- */\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-18-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:19:static const struct nla_policy rmnet_policy[IFLA_RMNET_MAX + 1] = {\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:20:\t[IFLA_RMNET_MUX_ID]\t= { .type = NLA_U16 },\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:21:\t[IFLA_RMNET_FLAGS]\t= { .len = sizeof(struct ifla_rmnet_flags) },\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-22-};\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c=36=static bool rmnet_config_data_format_valid(u32 data_format)\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-37-{\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:38:\tu32 v4_mask = RMNET_FLAGS_INGRESS_MAP_CKSUMV4 |\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:39:\t\t      RMNET_FLAGS_EGRESS_MAP_CKSUMV4;\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:40:\tu32 v5_mask = RMNET_FLAGS_INGRESS_MAP_CKSUMV5 |\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:41:\t\t      RMNET_FLAGS_EGRESS_MAP_CKSUMV5;\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-42-\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-45-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:46:\tif ((data_format \u0026 RMNET_FLAGS_INGRESS_COALESCE) \u0026\u0026\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:47:\t    !(data_format \u0026 RMNET_FLAGS_INGRESS_MAP_CKSUMV5))\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-48-\t\treturn false;\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c=77=static int rmnet_register_real_device(struct net_device *real_dev,\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-86-\t\tport = rmnet_get_port_rtnl(real_dev);\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:87:\t\tif (port-\u003ermnet_mode != RMNET_EPMODE_VND) {\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-88-\t\t\tNL_SET_ERR_MSG_MOD(extack, \"bridge device already exists\");\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-105-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:106:\tfor (entry = 0; entry \u003c RMNET_MAX_LOGICAL_EP; entry++)\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-107-\t\tINIT_HLIST_HEAD(\u0026port-\u003emuxed_ep[entry]);\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c=115=static void rmnet_unregister_bridge(struct rmnet_port *port)\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-119-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:120:\tif (port-\u003ermnet_mode != RMNET_EPMODE_BRIDGE)\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-121-\t\treturn;\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-130-\t\treal_port-\u003ebridge_ep = NULL;\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:131:\t\treal_port-\u003ermnet_mode = RMNET_EPMODE_VND;\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-132-\t} else {\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-136-\t\tport-\u003ebridge_ep = NULL;\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:137:\t\tport-\u003ermnet_mode = RMNET_EPMODE_VND;\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-138-\t}\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c=144=static int rmnet_newlink(struct net_device *dev,\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-148-\tstruct net *link_net = rtnl_newlink_link_net(params);\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:149:\tu32 data_format = RMNET_FLAGS_INGRESS_DEAGGREGATION;\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-150-\tstruct nlattr **data = params-\u003edata;\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-152-\tstruct net_device *real_dev;\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:153:\tint mode = RMNET_EPMODE_VND;\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-154-\tstruct rmnet_endpoint *ep;\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-169-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:170:\tif (data[IFLA_RMNET_FLAGS]) {\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-171-\t\tstruct ifla_rmnet_flags *flags;\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-172-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:173:\t\tflags = nla_data(data[IFLA_RMNET_FLAGS]);\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-174-\t\tdata_format \u0026= ~flags-\u003emask;\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-187-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:188:\tmux_id = nla_get_u16(data[IFLA_RMNET_MUX_ID]);\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-189-\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c=310=static int rmnet_rtnl_validate(struct nlattr *tb[], struct nlattr *data[],\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-314-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:315:\tif (!data || !data[IFLA_RMNET_MUX_ID]) {\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-316-\t\tNL_SET_ERR_MSG_MOD(extack, \"MUX ID not specified\");\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-319-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:320:\tmux_id = nla_get_u16(data[IFLA_RMNET_MUX_ID]);\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:321:\tif (mux_id \u003e (RMNET_MAX_LOGICAL_EP - 1)) {\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-322-\t\tNL_SET_ERR_MSG_MOD(extack, \"invalid MUX ID\");\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c=329=static int rmnet_changelink(struct net_device *dev, struct nlattr *tb[],\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-355-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:356:\tif (data[IFLA_RMNET_FLAGS]) {\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-357-\t\told_data_format = READ_ONCE(port-\u003edata_format);\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:358:\t\tflags = nla_data(data[IFLA_RMNET_FLAGS]);\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-359-\t\tdata_format = old_data_format \u0026 ~flags-\u003emask;\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-368-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:369:\tif (data[IFLA_RMNET_MUX_ID]) {\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:370:\t\tmux_id = nla_get_u16(data[IFLA_RMNET_MUX_ID]);\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-371-\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-393-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:394:\tif (data[IFLA_RMNET_FLAGS]) {\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-395-\t\tWRITE_ONCE(port-\u003edata_format, data_format);\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c=407=static size_t rmnet_get_size(const struct net_device *dev)\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-409-\treturn\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:410:\t\t/* IFLA_RMNET_MUX_ID */\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-411-\t\tnla_total_size(2) +\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:412:\t\t/* IFLA_RMNET_FLAGS */\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-413-\t\tnla_total_size(sizeof(struct ifla_rmnet_flags));\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c=416=static int rmnet_fill_info(struct sk_buff *skb, const struct net_device *dev)\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-421-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:422:\tif (nla_put_u16(skb, IFLA_RMNET_MUX_ID, READ_ONCE(priv-\u003emux_id)))\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-423-\t\treturn -EMSGSIZE;\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-431-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:432:\tif (nla_put(skb, IFLA_RMNET_FLAGS, sizeof(f), \u0026f))\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-433-\t\treturn -EMSGSIZE;\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c=438=struct rtnl_link_ops rmnet_link_ops __read_mostly = {\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-439-\t.kind\t\t= \"rmnet\",\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:440:\t.maxtype\t= IFLA_RMNET_MAX,\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-441-\t.priv_size\t= sizeof(struct rmnet_priv),\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c=477=int rmnet_add_bridge(struct net_device *rmnet_dev,\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-501-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:502:\tif (port-\u003ermnet_mode != RMNET_EPMODE_VND) {\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-503-\t\tNL_SET_ERR_MSG_MOD(extack, \"more than one bridge dev attached\");\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-525-\tslave_port = rmnet_get_port_rtnl(slave_dev);\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:526:\tslave_port-\u003ermnet_mode = RMNET_EPMODE_BRIDGE;\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-527-\tslave_port-\u003ebridge_ep = real_dev;\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-529-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:530:\tport-\u003ermnet_mode = RMNET_EPMODE_BRIDGE;\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-531-\tport-\u003ebridge_ep = slave_dev;\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.h-4- *\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.h:5: * RMNET Data configuration engine\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.h-6- */\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.h-11-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.h:12:#ifndef _RMNET_CONFIG_H_\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.h:13:#define _RMNET_CONFIG_H_\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.h-14-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.h:15:#define RMNET_MAX_LOGICAL_EP 255\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.h-16-\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.h=33=struct rmnet_port {\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.h-37-\tu8 rmnet_mode;\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.h:38:\tstruct hlist_head muxed_ep[RMNET_MAX_LOGICAL_EP];\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.h-39-\tstruct net_device *bridge_ep;\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.h=121=rmnet_get_port_rtnl(const struct net_device *real_dev);\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.h:122:#endif /* _RMNET_CONFIG_H_ */\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c-3- *\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c:4: * RMNET Data ingress/egress handler\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c-5- */\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c-16-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c:17:#define RMNET_IP_VERSION_4 0x40\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c:18:#define RMNET_IP_VERSION_6 0x60\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c-19-\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c=22=static void rmnet_set_skb_proto(struct sk_buff *skb)\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c-24-\tswitch (skb-\u003edata[0] \u0026 0xF0) {\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c:25:\tcase RMNET_IP_VERSION_4:\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c-26-\t\tskb-\u003eprotocol = htons(ETH_P_IP);\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c-27-\t\tbreak;\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c:28:\tcase RMNET_IP_VERSION_6:\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c-29-\t\tskb-\u003eprotocol = htons(ETH_P_IPV6);\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c=66=__rmnet_map_ingress_handler(struct sk_buff *skb,\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c-77-\t\t/* Packet contains a MAP command (not data) */\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c:78:\t\tif (data_format \u0026 RMNET_FLAGS_INGRESS_MAP_COMMANDS)\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c-79-\t\t\treturn rmnet_map_command(skb, port, data_format);\n--\n\n"
}

13/2 2026/10/01 02:24 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 29314
							output: 41
							thoughts: 32
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Investigating the RMNET Configuration Dependencies**

Alright, let's dive straight in. My immediate thought is, before I even start thinking about the implications of `CONFIG_RMNET`, I need to fully understand its dependencies. No point in making a call without knowing what else I'm pulling in. So, the first logical step is to check out the Kconfig file for that specific driver. I'm going to head directly to `drivers/net/ethernet/qualcomm/rmnet/Kconfig`. This should give me the complete picture: what other configurations need to be enabled, what architectural constraints might be at play, and what modules are implicitly included. It's the standard practice: verify the dependencies before committing to any changes. This way, I can ensure I am not accidentally enabling or disabling something I should not.



14/2 2026/10/01 02:24 tool read-file
0m Args:
{
  "File": "drivers/net/ethernet/qualcomm/rmnet/Kconfig",
  "FirstLine": 1,
  "LineCount": 20
}

Results:
{
  "Contents": "   1:\t# SPDX-License-Identifier: GPL-2.0-only\n   2:\t#\n   3:\t# RMNET MAP driver\n   4:\t#\n   5:\t\n   6:\tmenuconfig RMNET\n   7:\t\ttristate \"RmNet MAP driver\"\n   8:\t\tdefault n\n   9:\t\tselect GRO_CELLS\n  10:\t\thelp\n  11:\t\t  If you select this, you will enable the RMNET module which is used\n  12:\t\t  for handling data in the multiplexing and aggregation protocol (MAP)\n  13:\t\t  format in the embedded data path. RMNET devices can be attached to\n  14:\t\t  any IP mode physical device.\n"
}

15/2 2026/10/01 02:24 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 29760
							output: 38
							thoughts: 22
						

Thoughts:
Here's my thought process, as requested:

**Navigating the Kconfig Hierarchy**

Okay, so I need to understand this configuration. The initial Kconfig seems a bit cryptic, and I need to see where its settings are being defined. My gut tells me this will be defined somewhere upstream, and since we're dealing with a Qualcomm ethernet driver, the parent Kconfig file at `drivers/net/ethernet/qualcomm/Kconfig` is the logical place to start. Let's start there. I'll check that file and see if this setting is being sourced from it, or if there is another that is higher in the hierarchy.



16/2 2026/10/01 02:24 tool read-file
0m Args:
{
  "File": "drivers/net/ethernet/qualcomm/Kconfig",
  "FirstLine": 1,
  "LineCount": 40
}

Results:
{
  "Contents": "   1:\t# SPDX-License-Identifier: GPL-2.0-only\n   2:\t#\n   3:\t# Qualcomm network device configuration\n   4:\t#\n   5:\t\n   6:\tconfig NET_VENDOR_QUALCOMM\n   7:\t\tbool \"Qualcomm devices\"\n   8:\t\tdefault y\n   9:\t\thelp\n  10:\t\t  If you have a network (Ethernet) card belonging to this class, say Y.\n  11:\t\n  12:\t\t  Note that the answer to this question doesn't directly affect the\n  13:\t\t  kernel: saying N will just cause the configurator to skip all\n  14:\t\t  the questions about Qualcomm cards. If you say Y, you will be asked\n  15:\t\t  for your specific card in the following questions.\n  16:\t\n  17:\tif NET_VENDOR_QUALCOMM\n  18:\t\n  19:\tconfig QCA7000\n  20:\t\ttristate\n  21:\t\thelp\n  22:\t\t  This enables support for the Qualcomm Atheros QCA7000.\n  23:\t\n  24:\tconfig QCA7000_SPI\n  25:\t\ttristate \"Qualcomm Atheros QCA7000 SPI support\"\n  26:\t\tselect QCA7000\n  27:\t\tdepends on SPI_MASTER \u0026\u0026 OF\n  28:\t\thelp\n  29:\t\t  This SPI protocol driver supports the Qualcomm Atheros QCA7000.\n  30:\t\n  31:\t\t  To compile this driver as a module, choose M here. The module\n  32:\t\t  will be called qcaspi.\n  33:\t\n  34:\tconfig QCA7000_UART\n  35:\t\ttristate \"Qualcomm Atheros QCA7000 UART support\"\n  36:\t\tselect QCA7000\n  37:\t\tdepends on SERIAL_DEV_BUS \u0026\u0026 OF\n  38:\t\thelp\n  39:\t\t  This UART protocol driver supports the Qualcomm Atheros QCA7000.\n  40:\t\n"
}

17/2 2026/10/01 02:24 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 30486
							output: 34
							thoughts: 31
						

Thoughts:
Here's my summary, as the thought process you described:

**Investigating RMNET Configuration in Qualcomm Ethernet Drivers**

Okay, so I need to track down how `rmnet` is being incorporated into the configuration. Let's dig deeper into the kernel configuration files. My intuition is telling me that the `drivers/net/ethernet/qualcomm/Kconfig` file is the most likely place to start, given the device's Qualcomm Ethernet component. I'll need to scroll through this Kconfig to see where and how `rmnet` is being sourced.



18/2 2026/10/01 02:24 tool grepper
0m Args:
{
  "Expression": "rmnet",
  "PathPrefix": "drivers/net/ethernet/qualcomm/Kconfig"
}

Results:
{
  "Output": "drivers/net/ethernet/qualcomm/Kconfig=63=config QCOM_PPE\n--\ndrivers/net/ethernet/qualcomm/Kconfig-77-\ndrivers/net/ethernet/qualcomm/Kconfig:78:source \"drivers/net/ethernet/qualcomm/rmnet/Kconfig\"\ndrivers/net/ethernet/qualcomm/Kconfig-79-\n"
}

19/2 2026/10/01 02:24 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 30776
							output: 32
							thoughts: 46
						

Thoughts:
Okay, let's see, my initial thought here is to zero in on these config options: `NET_VENDOR_QUALCOMM` and `RMNET`. I immediately want to understand their relationship, what they control. Hold on, before I jump to any conclusions, I should probably double-check the `NET_VENDOR_QUALCOMM` definition itself. Good practice, always. I'll go right to `drivers/net/ethernet/Kconfig` to get the definitive answer. This is where the real truth lies, the authoritative source. Gotta make sure I’m not missing something fundamental by making assumptions.



20/2 2026/10/01 02:24 tool grepper
0m Args:
{
  "Expression": "NET_VENDOR_QUALCOMM",
  "PathPrefix": "drivers/net/ethernet"
}

Results:
{
  "Output": "drivers/net/ethernet/Makefile=78=obj-$(CONFIG_NET_VENDOR_QLOGIC) += qlogic/\ndrivers/net/ethernet/Makefile:79:obj-$(CONFIG_NET_VENDOR_QUALCOMM) += qualcomm/\ndrivers/net/ethernet/Makefile-80-obj-$(CONFIG_NET_VENDOR_REALTEK) += realtek/\n--\ndrivers/net/ethernet/qualcomm/Kconfig-5-\ndrivers/net/ethernet/qualcomm/Kconfig:6:config NET_VENDOR_QUALCOMM\ndrivers/net/ethernet/qualcomm/Kconfig-7-\tbool \"Qualcomm devices\"\n--\ndrivers/net/ethernet/qualcomm/Kconfig-16-\ndrivers/net/ethernet/qualcomm/Kconfig:17:if NET_VENDOR_QUALCOMM\ndrivers/net/ethernet/qualcomm/Kconfig-18-\n--\ndrivers/net/ethernet/qualcomm/Kconfig=78=source \"drivers/net/ethernet/qualcomm/rmnet/Kconfig\"\ndrivers/net/ethernet/qualcomm/Kconfig-79-\ndrivers/net/ethernet/qualcomm/Kconfig:80:endif # NET_VENDOR_QUALCOMM\n"
}

21/2 2026/10/01 02:24 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 31286
							output: 38
							thoughts: 594
						

Thoughts:
**Analyzing rmnet Support in Syzkaller**

Okay, so I need to figure out the status of rmnet support, or its potential for use, within the scope of my current project. First, I need to be clear about the tools. I recall some instructions explicitly stating that I shouldn't try to use this tool for direct searches within syzkaller's syzlang descriptions or for those expressions containing 'long syz_'. Apparently, I'm supposed to use `syz-grepper` or `read-syz-spec`, but I realize these tools aren't available to me. Fortunately, I don't need them because I don't need to search any of those files!

My line of thought shifts. I need to see if there's any way to get to rmnet. It seems that anyone with `CAP_NET_ADMIN` can create an rmnet link using standard rtnetlink with `RTM_NEWLINK`. User namespaces and `CLONE_NEWUSER | CLONE_NEWNET` provides this privilege to unprivileged users as well, which is an important point to consider. The equivalent `ip link` command is straightforward. It allows creation of the rmnet link and setting up the link to a real device.

Now I need to address the receive path. Can packets be injected into the `real_dev`? The answer is a potential "yes," if `real_dev` is a tun/tap (or veth) device. Userspace can then write packets to the file descriptor. When packets are written to a tun/tap device and in `tun_get_user()` the packets are received by the kernel's `netif_receive_skb()` or `netif_rx()` functions. It appears that `__netif_receive_skb_core()` calls `rx_handler = rcu_dereference(skb->dev->rx_handler)`. And my attention shifts to that handler: `rx_handler` is indeed `rmnet_rx_handler`! I'm going to verify this in the core netdev code. In `net/core/dev.c`, that `rx_handler` gets executed. This needs to be explored more. I should look into how `rmnet_rx_handler` functions. Looks like `rmnet_handlers.c` should be my next stop.



22/2 2026/10/01 02:24 tool grepper
0m Args:
{
  "Expression": "rmnet_rx_handler",
  "PathPrefix": "drivers/net/ethernet/qualcomm/rmnet"
}

Results:
{
  "Output": "drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c=24=static int rmnet_is_real_dev_registered(const struct net_device *real_dev)\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-25-{\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:26:\treturn rcu_access_pointer(real_dev-\u003erx_handler) == rmnet_rx_handler;\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-27-}\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c=77=static int rmnet_register_real_device(struct net_device *real_dev,\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-99-\tport-\u003edev = real_dev;\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:100:\trc = netdev_rx_handler_register(real_dev, rmnet_rx_handler, port);\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-101-\tif (rc) {\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c=205=rmnet_bridge_handler(struct sk_buff *skb, struct net_device *bridge_dev)\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c-221- */\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c:222:rx_handler_result_t rmnet_rx_handler(struct sk_buff **pskb)\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c-223-{\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.h=12=void rmnet_egress_handler(struct sk_buff *skb);\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.h-13-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.h:14:rx_handler_result_t rmnet_rx_handler(struct sk_buff **pskb);\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.h-15-\n"
}

23/2 2026/10/01 02:24 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 33026
							output: 47
							thoughts: 21
						

Thoughts:
Here's my analysis of the provided text, rendered in the first person, assuming a high level of expertise:

**Diving into the RMNET Receiver Handler**

Okay, time to dig in. Let's start with `rmnet_rx_handler` located within `rmnet_handlers.c`. I need to get a clear picture of how incoming RMNET data is processed. This function is the nerve center, the point of entry for all that juicy data. I want to understand the flow, the conditional branches, error handling, and of course, where the important bits are extracted and handed off. I'm hoping I don't see any obvious performance bottlenecks or potential security vulnerabilities right off the bat, but I'll be meticulously checking for anything that could cause problems down the line, given the critical role RMNET plays.



24/2 2026/10/01 02:24 tool read-file
0m Args:
{
  "File": "drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c",
  "FirstLine": 220,
  "LineCount": 50
}

Results:
{
  "Contents": " 220:\t * egress device listed in the logical endpoint configuration.\n 221:\t */\n 222:\trx_handler_result_t rmnet_rx_handler(struct sk_buff **pskb)\n 223:\t{\n 224:\t\tstruct sk_buff *skb = *pskb;\n 225:\t\tstruct rmnet_port *port;\n 226:\t\tstruct net_device *dev;\n 227:\t\n 228:\t\tif (!skb)\n 229:\t\t\tgoto done;\n 230:\t\n 231:\t\tif (skb_linearize(skb)) {\n 232:\t\t\tkfree_skb(skb);\n 233:\t\t\tgoto done;\n 234:\t\t}\n 235:\t\n 236:\t\tif (skb-\u003epkt_type == PACKET_LOOPBACK)\n 237:\t\t\treturn RX_HANDLER_PASS;\n 238:\t\n 239:\t\tdev = skb-\u003edev;\n 240:\t\tport = rmnet_get_port_rcu(dev);\n 241:\t\tif (unlikely(!port)) {\n 242:\t\t\tdev_core_stats_rx_nohandler_inc(skb-\u003edev);\n 243:\t\t\tkfree_skb(skb);\n 244:\t\t\tgoto done;\n 245:\t\t}\n 246:\t\n 247:\t\tswitch (port-\u003ermnet_mode) {\n 248:\t\tcase RMNET_EPMODE_VND:\n 249:\t\t\trmnet_map_ingress_handler(skb, port);\n 250:\t\t\tbreak;\n 251:\t\tcase RMNET_EPMODE_BRIDGE:\n 252:\t\t\trmnet_bridge_handler(skb, port-\u003ebridge_ep);\n 253:\t\t\tbreak;\n 254:\t\t}\n 255:\t\n 256:\tdone:\n 257:\t\treturn RX_HANDLER_CONSUMED;\n 258:\t}\n 259:\t\n 260:\t/* Modifies packet as per logical endpoint configuration and egress data format\n 261:\t * for egress device configured in logical endpoint. Packet is then transmitted\n 262:\t * on the egress device.\n 263:\t */\n 264:\tvoid rmnet_egress_handler(struct sk_buff *skb)\n 265:\t{\n 266:\t\tstruct net_device *orig_dev;\n 267:\t\tstruct rmnet_port *port;\n 268:\t\tstruct rmnet_priv *priv;\n 269:\t\tu8 mux_id;\n"
}

25/2 2026/10/01 02:24 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 33965
							output: 47
							thoughts: 40
						

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

**Digging into the RMNET Ingress Path**

Okay, so I'm tracing down this RMNET path, and it looks like `rmnet_rx_handler` is the entry point for incoming packets. I need to understand how the system processes these, so the next logical step is to see where it hands the packets off. I see it calls `rmnet_map_ingress_handler`, passing it both the `skb` (presumably the socket buffer) and the `port`. Given my experience, I'm already formulating hypotheses about what that function does. It *maps* something related to *ingress* and the *handler* implies further processing. Let's dive into `rmnet_map_ingress_handler` and see what's happening. I expect to see some port-based routing or classification going on here. Time to confirm my assumptions.



26/2 2026/10/01 02:24 tool read-file
0m Args:
{
  "File": "drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c",
  "FirstLine": 120,
  "LineCount": 50
}

Results:
{
  "Contents": " 120:\t}\n 121:\t\n 122:\tstatic void\n 123:\trmnet_map_ingress_handler(struct sk_buff *skb,\n 124:\t\t\t\t  struct rmnet_port *port)\n 125:\t{\n 126:\t\tstruct sk_buff *skbn;\n 127:\t\tu32 data_format;\n 128:\t\n 129:\t\tif (skb-\u003edev-\u003etype == ARPHRD_ETHER) {\n 130:\t\t\tif (pskb_expand_head(skb, ETH_HLEN, 0, GFP_ATOMIC)) {\n 131:\t\t\t\tkfree_skb(skb);\n 132:\t\t\t\treturn;\n 133:\t\t\t}\n 134:\t\n 135:\t\t\tskb_push(skb, ETH_HLEN);\n 136:\t\t}\n 137:\t\n 138:\t\tdata_format = READ_ONCE(port-\u003edata_format);\n 139:\t\n 140:\t\tif (data_format \u0026 RMNET_FLAGS_INGRESS_DEAGGREGATION) {\n 141:\t\t\twhile ((skbn = rmnet_map_deaggregate(skb, data_format)) != NULL)\n 142:\t\t\t\t__rmnet_map_ingress_handler(skbn, port, data_format);\n 143:\t\n 144:\t\t\tconsume_skb(skb);\n 145:\t\t} else {\n 146:\t\t\tif (rmnet_map_validate_packet_len(skb, data_format))\n 147:\t\t\t\t__rmnet_map_ingress_handler(skb, port, data_format);\n 148:\t\t\telse\n 149:\t\t\t\tkfree_skb(skb);\n 150:\t\t}\n 151:\t}\n 152:\t\n 153:\tstatic int rmnet_map_egress_handler(struct sk_buff *skb,\n 154:\t\t\t\t\t    struct rmnet_port *port, u8 mux_id,\n 155:\t\t\t\t\t    struct net_device *orig_dev)\n 156:\t{\n 157:\t\tint required_headroom, additional_header_len, csum_type = 0;\n 158:\t\tstruct rmnet_map_header *map_header;\n 159:\t\tu32 data_format;\n 160:\t\n 161:\t\tadditional_header_len = 0;\n 162:\t\trequired_headroom = sizeof(struct rmnet_map_header);\n 163:\t\n 164:\t\tdata_format = READ_ONCE(port-\u003edata_format);\n 165:\t\tif (data_format \u0026 RMNET_FLAGS_EGRESS_MAP_CKSUMV4) {\n 166:\t\t\tadditional_header_len = sizeof(struct rmnet_map_ul_csum_header);\n 167:\t\t\tcsum_type = RMNET_FLAGS_EGRESS_MAP_CKSUMV4;\n 168:\t\t} else if (data_format \u0026 RMNET_FLAGS_EGRESS_MAP_CKSUMV5) {\n 169:\t\t\tadditional_header_len = sizeof(struct rmnet_map_v5_csum_header);\n"
}

27/2 2026/10/01 02:24 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 35099
							output: 46
							thoughts: 913
						

Thoughts:
**Deep Dive into RMNET's Packet Processing**

Okay, so I'm revisiting `__rmnet_map_ingress_handler` in `rmnet_handlers.c`. I'm seeing this core function's handling a significant chunk of logic for incoming packets. Specifically, I'm noting the use of `rmnet_map_process_next_hdr_packet`, which itself calls several critical functions: `rmnet_map_data_check_coal_header`, `rmnet_map_segment_coal_skb`, and down the chain, methods like `rmnet_map_v5_fixup_num_nlos`, `rmnet_map_coal_parse_ip_hdr`, `rmnet_map_coal_parse_trans_hdr`, and `rmnet_map_coal_validate_bounds` among others.

This is where it gets interesting. I'm seeing a lot of complex parsing code in `drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c`. We're talking about IP parsing, TCP/UDP parsing, slicing and reassembling packets, sequence number modifications, `alloc_skb`, checksum calculations, GSO stamping, error masking, and bounds checking. It's a comprehensive suite of packet analysis routines. The function itself seems to be parsing network packets coming in on the interface, which raises some questions about security.

The really interesting bit is that `rmnet` doesn't *require* Qualcomm hardware, as it can attach to any IP device via rtnl. This means we can test and fuzz this functionality easily within a standard virtual environment like QEMU or GCE. This is a potential attack surface.

Now, I'm getting curious about the hardware dependency, so let's verify if `rmnet` really does NOT require Qualcomm hardware. The evidence is in `rmnet_newlink`, which takes the `IFLA_LINK` attribute. I see that it grabs the real device by index and uses `rmnet_register_real_device` if it is not already registered. The latter is important because this is where a potential check for the hardware would happen, if there were any. Let's check `rmnet_register_real_device` in `rmnet_config.c` to be sure!



28/2 2026/10/01 02:24 tool read-file
0m Args:
{
  "File": "drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c",
  "FirstLine": 75,
  "LineCount": 40
}

Results:
{
  "Contents": "  75:\t}\n  76:\t\n  77:\tstatic int rmnet_register_real_device(struct net_device *real_dev,\n  78:\t\t\t\t\t      struct netlink_ext_ack *extack)\n  79:\t{\n  80:\t\tstruct rmnet_port *port;\n  81:\t\tint rc, entry;\n  82:\t\n  83:\t\tASSERT_RTNL();\n  84:\t\n  85:\t\tif (rmnet_is_real_dev_registered(real_dev)) {\n  86:\t\t\tport = rmnet_get_port_rtnl(real_dev);\n  87:\t\t\tif (port-\u003ermnet_mode != RMNET_EPMODE_VND) {\n  88:\t\t\t\tNL_SET_ERR_MSG_MOD(extack, \"bridge device already exists\");\n  89:\t\t\t\treturn -EINVAL;\n  90:\t\t\t}\n  91:\t\n  92:\t\t\treturn 0;\n  93:\t\t}\n  94:\t\n  95:\t\tport = kzalloc_obj(*port);\n  96:\t\tif (!port)\n  97:\t\t\treturn -ENOMEM;\n  98:\t\n  99:\t\tport-\u003edev = real_dev;\n 100:\t\trc = netdev_rx_handler_register(real_dev, rmnet_rx_handler, port);\n 101:\t\tif (rc) {\n 102:\t\t\tkfree(port);\n 103:\t\t\treturn -EBUSY;\n 104:\t\t}\n 105:\t\n 106:\t\tfor (entry = 0; entry \u003c RMNET_MAX_LOGICAL_EP; entry++)\n 107:\t\t\tINIT_HLIST_HEAD(\u0026port-\u003emuxed_ep[entry]);\n 108:\t\n 109:\t\trmnet_map_tx_aggregate_init(port);\n 110:\t\n 111:\t\tnetdev_dbg(real_dev, \"registered with rmnet\\n\");\n 112:\t\treturn 0;\n 113:\t}\n 114:\t\n"
}

29/2 2026/10/01 02:24 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 37095
							output: 35
							thoughts: 622
						

Thoughts:
**My Assessment: This RMNET Change is Definitely Worth Fuzzing**

Okay, so here's my thinking. `rmnet_register_real_device` essentially just hooks up an `rx_handler` to a physical or virtual device. No hardware checks, nothing fancy. And the Kconfig explicitly states that RMNET devices can be attached to *any* IP mode physical or virtual device. When packets hit the underlying device, `rmnet_rx_handler` kicks in.

Specifically, if the `data_format` has `RMNET_FLAGS_INGRESS_COALESCE` (and `RMNET_FLAGS_INGRESS_MAP_CKSUMV5`), which we can configure via netlink and `IFLA_RMNET_FLAGS`, then `rmnet_map_process_next_hdr_packet` gets called for packets with `MAP_NEXT_HEADER_FLAG`. That sounds like where the interesting stuff is happening.

Now, does this merit fuzzing? Absolutely. Let's refer to Section 3: "WHEN TO RETURN WorthFuzzing=true." This change hits the criteria dead-on:

*   **Refactorings and Code Cleanups:** The patch involves restructuring complex packet parsing and de-coalescing/reconstruction logic in `rmnet_map_data.c`, data format validation in `rmnet_config.c`, and significant packet handling changes in `rmnet_handlers.c`. These are perfect areas to look for edge cases and vulnerabilities.
*   **Reachable Drivers and Protocols:** `rmnet` is a virtual driver, configurable via rtnetlink (`rtnl_link_ops`), and can be attached to *any* net device (loopback, dummy, veth, tap, etc.) – which makes it incredibly accessible for fuzzing.

Therefore, this change *definitely* justifies fuzzing.

Now, let's nail down what kernel configurations are needed:

Tracing the Kconfig, we see `RMNET` is under `NET_VENDOR_QUALCOMM` in `drivers/net/ethernet/qualcomm/Kconfig`. `NET_VENDOR_QUALCOMM` is simply a boolean, defaulting to 'y' and depends on nothing. Thus, any kernel that enables `NET_VENDOR_QUALCOMM` would work.



30/2 2026/10/01 02:24 tool grepper
0m Error:
no matches

Args:
{
  "Expression": "NET_VENDOR_QUALCOMM",
  "PathPrefix": "drivers/net/ethernet/Kconfig"
}

Results:
{
  "error": "no matches"
}

31/2 2026/10/01 02:24 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 38254
							output: 28
							thoughts: 22
						

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

**Kconfig Dependency Exploration**

Okay, so I need to figure out where the `drivers/net/ethernet/qualcomm/Kconfig` file is being pulled into the build system. This is a common debugging step, especially when dealing with complex driver configurations. I need to understand what's enabling or disabling this particular Kconfig file. I'm thinking I'll start by tracing the inclusions. My goal here is to establish the dependency tree. I need to see which higher-level Kconfig files are referencing it, either directly or indirectly. This will give me clues about the features or platform configurations that control the inclusion of the Qualcomm Ethernet driver. From there, I can analyze the associated configuration options.



32/2 2026/10/01 02:24 tool grepper
0m Args:
{
  "Expression": "qualcomm/Kconfig",
  "PathPrefix": "drivers/net"
}

Results:
{
  "Output": "drivers/net/ethernet/Kconfig=164=source \"drivers/net/ethernet/brocade/Kconfig\"\ndrivers/net/ethernet/Kconfig:165:source \"drivers/net/ethernet/qualcomm/Kconfig\"\ndrivers/net/ethernet/Kconfig-166-source \"drivers/net/ethernet/rdc/Kconfig\"\n"
}

33/2 2026/10/01 02:24 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 38566
							output: 37
							thoughts: 23
						

Thoughts:
Here's my thought process, as if I were considering those lines:

**Examining Kconfig for Ethernet Driver Configuration**

Okay, let's zero in on `drivers/net/ethernet/Kconfig`. Time to get granular. I'm specifically interested in what's happening around line 165. My guess is it's likely a configuration option, or perhaps a dependency definition for an Ethernet driver. Given the file and the general structure of Kconfig files, I'm expecting to see a `config` statement, a `depends on` clause, maybe a `bool` or `tristate` assignment, and probably some help text to guide the user. I want to quickly understand what feature is being controlled there, what hardware it relates to (if any), and how it might impact the build. I'm looking for anything that might be problematic, or interesting given some related driver I have to interact with. A quick scan should be enough to capture the intent. No need to get bogged down in the minutiae unless something jumps out as unexpected. This is all about gaining situational awareness in the build system.



34/2 2026/10/01 02:24 tool read-file
0m Args:
{
  "File": "drivers/net/ethernet/Kconfig",
  "FirstLine": 155,
  "LineCount": 25
}

Results:
{
  "Contents": " 155:\t\t  This library implements OPEN Alliance TC6 10BASE-T1x MAC-PHY\n 156:\t\t  Serial Interface protocol for supporting 10BASE-T1x MAC-PHYs.\n 157:\t\n 158:\t\t  To know the implementation details, refer documentation in\n 159:\t\t  \u003cfile:Documentation/networking/oa-tc6-framework.rst\u003e.\n 160:\t\n 161:\tsource \"drivers/net/ethernet/pasemi/Kconfig\"\n 162:\tsource \"drivers/net/ethernet/pensando/Kconfig\"\n 163:\tsource \"drivers/net/ethernet/qlogic/Kconfig\"\n 164:\tsource \"drivers/net/ethernet/brocade/Kconfig\"\n 165:\tsource \"drivers/net/ethernet/qualcomm/Kconfig\"\n 166:\tsource \"drivers/net/ethernet/rdc/Kconfig\"\n 167:\tsource \"drivers/net/ethernet/realtek/Kconfig\"\n 168:\tsource \"drivers/net/ethernet/renesas/Kconfig\"\n 169:\tsource \"drivers/net/ethernet/rocker/Kconfig\"\n 170:\tsource \"drivers/net/ethernet/samsung/Kconfig\"\n 171:\tsource \"drivers/net/ethernet/seeq/Kconfig\"\n 172:\tsource \"drivers/net/ethernet/sgi/Kconfig\"\n 173:\tsource \"drivers/net/ethernet/silan/Kconfig\"\n 174:\tsource \"drivers/net/ethernet/sis/Kconfig\"\n 175:\tsource \"drivers/net/ethernet/sfc/Kconfig\"\n 176:\tsource \"drivers/net/ethernet/smsc/Kconfig\"\n 177:\tsource \"drivers/net/ethernet/socionext/Kconfig\"\n 178:\tsource \"drivers/net/ethernet/spacemit/Kconfig\"\n 179:\tsource \"drivers/net/ethernet/stmicro/Kconfig\"\n"
}

35/2 2026/10/01 02:24 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 39400
							output: 35
							thoughts: 32
						

Thoughts:
Here's my thought process, as if I were analyzing that situation:

**Checking the Ethernet Kconfig for Top-Level Dependencies**

Okay, first things first, I need to get a high-level view of this `drivers/net/ethernet/Kconfig` file. I'm going to scan the beginning, specifically looking for any top-level `if` statements or `depends on` clauses. These are crucial for understanding the overall conditional compilation structure for Ethernet drivers. What are the global dependencies? What are the overarching configurations that enable or disable the whole Ethernet subsystem? I need this context before I can delve deeper into the specifics of individual drivers or features within that Kconfig. This will let me quickly build a mental map of what this Kconfig controls. No use getting lost in the weeds before I see the forest.



36/2 2026/10/01 02:25 tool read-file
0m Args:
{
  "File": "drivers/net/ethernet/Kconfig",
  "FirstLine": 1,
  "LineCount": 40
}

Results:
{
  "Contents": "   1:\t# SPDX-License-Identifier: GPL-2.0-only\n   2:\t#\n   3:\t# Ethernet LAN device configuration\n   4:\t#\n   5:\t\n   6:\tmenuconfig ETHERNET\n   7:\t\tbool \"Ethernet driver support\"\n   8:\t\tdepends on NET\n   9:\t\tdefault y\n  10:\t\thelp\n  11:\t\t  This section contains all the Ethernet device drivers.\n  12:\t\n  13:\tif ETHERNET\n  14:\t\n  15:\tconfig MDIO\n  16:\t\ttristate\n  17:\t\n  18:\tsource \"drivers/net/ethernet/3com/Kconfig\"\n  19:\tsource \"drivers/net/ethernet/actions/Kconfig\"\n  20:\tsource \"drivers/net/ethernet/adaptec/Kconfig\"\n  21:\tsource \"drivers/net/ethernet/aeroflex/Kconfig\"\n  22:\tsource \"drivers/net/ethernet/agere/Kconfig\"\n  23:\tsource \"drivers/net/ethernet/airoha/Kconfig\"\n  24:\tsource \"drivers/net/ethernet/alacritech/Kconfig\"\n  25:\tsource \"drivers/net/ethernet/alibaba/Kconfig\"\n  26:\tsource \"drivers/net/ethernet/allwinner/Kconfig\"\n  27:\tsource \"drivers/net/ethernet/altera/Kconfig\"\n  28:\tsource \"drivers/net/ethernet/amazon/Kconfig\"\n  29:\tsource \"drivers/net/ethernet/amd/Kconfig\"\n  30:\tsource \"drivers/net/ethernet/apm/Kconfig\"\n  31:\tsource \"drivers/net/ethernet/apple/Kconfig\"\n  32:\tsource \"drivers/net/ethernet/aquantia/Kconfig\"\n  33:\tsource \"drivers/net/ethernet/arc/Kconfig\"\n  34:\tsource \"drivers/net/ethernet/asix/Kconfig\"\n  35:\tsource \"drivers/net/ethernet/atheros/Kconfig\"\n  36:\t\n  37:\tconfig CX_ECAT\n  38:\t\ttristate \"Beckhoff CX5020 EtherCAT master support\"\n  39:\t\tdepends on PCI\n  40:\t\tdepends on X86 || COMPILE_TEST\n"
}

37/2 2026/10/01 02:25 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 40243
							output: 358
							thoughts: 2147
						

Thoughts:
**Analysis of RmNet MAPv5 Downlink Patch for Fuzzing**

Alright, let's break this down systematically. My initial thought is to identify the critical configuration options. Clearly, `RMNET` and `NET_VENDOR_QUALCOMM` are essential, with `RMNET` depending on `NET_VENDOR_QUALCOMM`, and the `GRO_CELLS` kconfig option also involved. Looking at the Kconfig and Makefile, it's confirmed: both `RMNET` and `NET_VENDOR_QUALCOMM` need to be enabled.

Now, I need to pinpoint the `FocusSymbols` – the key functions that represent the new logic and entrypoints of this patch. I'll need to remember the "AVOID UBIQUITOUS LIFECYCLE HOT-PATHS" and "TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS" guidelines. I'll include functions which specifically implement the new feature, or are entrypoints for the subsystem. I've noted the added or modified functions across the various `.c` files within the `rmnet` directory.

I've carefully examined the code changes, differentiating between static and non-static functions. Given the guidelines on dealing with static inline functions, I'll prioritize non-static entrypoints and key static functions that embody the new logic. The non-static candidates are: `rmnet_map_process_next_hdr_packet`, `rmnet_newlink`, `rmnet_changelink`, `rmnet_vnd_newlink`, and `rmnet_map_validate_packet_len`. And based on the code, `rmnet_rx_handler` appears to be a crucial entrypoint from the net receive path.

I've also identified several static functions that are core to the new feature's implementation: `rmnet_map_segment_coal_skb`, `rmnet_map_data_check_coal_header`, `rmnet_map_coal_segment_loop`, `rmnet_map_coal_gro_fast_path`, `rmnet_map_coal_validate_bounds`, `rmnet_map_coal_parse_ip_hdr`, `rmnet_map_coal_parse_trans_hdr`, `__rmnet_map_segment_coal_skb`, `rmnet_map_v5_csum_fixup`, `rmnet_map_v5_fixup_num_nlos`, `rmnet_config_data_format_valid`, and `__rmnet_map_ingress_handler`.

Now, I'll need to confirm that `rmnet_map_process_next_hdr_packet` is indeed global/exported. Yes, it's declared in `rmnet_map.h` and defined in `rmnet_map_data.c`, and called by `rmnet_handlers.c`, as is `rmnet_map_validate_packet_len`. `rmnet_newlink`, `rmnet_changelink`, and `rmnet_vnd_newlink` are also in .h files and defined in the respective .c files.

Finally, I'm doing a thorough review of the patch's overall functionality. It implements MAPv5 downlink hardware packet de-coalescing in the Qualcomm RmNet driver. This includes unpacking coalesced MAPv5 frames, validating the headers, segmenting skbs, adjusting sequence numbers, correcting IP lengths, recalculating checksums, and delivering the now-separate packets to the network stack. I've noted that it also validates configuration flags.

Crucially, the RmNet driver can be utilized without specific hardware, by using virtual network interfaces, created through the rtnetlink interface.  This means that the driver logic is reachable in a controlled environment. The complexity of the packet parsing, validation, and reconstruction involved here warrants fuzzing with syzkaller.

Therefore, my final arguments for `set-results` will be:

*   `WorthFuzzing`: true
*   `EnableConfigs`: `["RMNET", "NET_VENDOR_QUALCOMM"]`
*   `FocusSymbols`: `["rmnet_map_process_next_hdr_packet", "rmnet_map_segment_coal_skb", "rmnet_map_data_check_coal_header", "rmnet_map_coal_segment_loop", "rmnet_map_coal_gro_fast_path", "rmnet_map_coal_validate_bounds", "rmnet_map_coal_parse_ip_hdr", "rmnet_map_coal_parse_trans_hdr", "__rmnet_map_segment_coal_skb", "rmnet_map_v5_csum_fixup", "rmnet_map_v5_fixup_num_nlos


38/2 2026/10/01 02:25 tool set-results
0m Args:
{
  "EnableConfigs": [
    "RMNET",
    "NET_VENDOR_QUALCOMM"
  ],
  "FocusSymbols": [
    "rmnet_map_process_next_hdr_packet",
    "rmnet_map_segment_coal_skb",
    "rmnet_map_data_check_coal_header",
    "rmnet_map_coal_segment_loop",
    "rmnet_map_coal_gro_fast_path",
    "rmnet_map_coal_validate_bounds",
    "rmnet_map_coal_parse_ip_hdr",
    "rmnet_map_coal_parse_trans_hdr",
    "__rmnet_map_segment_coal_skb",
    "rmnet_map_v5_csum_fixup",
    "rmnet_map_v5_fixup_num_nlos",
    "rmnet_map_validate_packet_len",
    "rmnet_config_data_format_valid",
    "rmnet_newlink",
    "rmnet_changelink"
  ],
  "Reasoning": "The patch adds support for MAPv5 downlink packet coalescing in the Qualcomm RmNet driver. RmNet devices are virtual network devices configured via rtnetlink (rtnl_link_ops) that can attach to any network device (e.g., dummy, veth, or tun/tap), without requiring physical hardware. The patch introduces complex packet parsing, validation, skb segmentation, sequence number manipulation, and checksum calculations for coalesced packets in the ingress data path, which is reachable in standard virtualized environments and warrants fuzzing.",
  "WorthFuzzing": true
}

Results:
{
  "EnableConfigs": [
    "RMNET",
    "NET_VENDOR_QUALCOMM"
  ],
  "FocusSymbols": [
    "rmnet_map_process_next_hdr_packet",
    "rmnet_map_segment_coal_skb",
    "rmnet_map_data_check_coal_header",
    "rmnet_map_coal_segment_loop",
    "rmnet_map_coal_gro_fast_path",
    "rmnet_map_coal_validate_bounds",
    "rmnet_map_coal_parse_ip_hdr",
    "rmnet_map_coal_parse_trans_hdr",
    "__rmnet_map_segment_coal_skb",
    "rmnet_map_v5_csum_fixup",
    "rmnet_map_v5_fixup_num_nlos",
    "rmnet_map_validate_packet_len",
    "rmnet_config_data_format_valid",
    "rmnet_newlink",
    "rmnet_changelink"
  ],
  "Reasoning": "The patch adds support for MAPv5 downlink packet coalescing in the Qualcomm RmNet driver. RmNet devices are virtual network devices configured via rtnetlink (rtnl_link_ops) that can attach to any network device (e.g., dummy, veth, or tun/tap), without requiring physical hardware. The patch introduces complex packet parsing, validation, skb segmentation, sequence number manipulation, and checksum calculations for coalesced packets in the ingress data path, which is reachable in standard virtualized environments and warrants fuzzing.",
  "WorthFuzzing": true
}

39/1 2026/10/01 02:25 action If
2m Args:
{
  "WorthFuzzing": true
}

Results:
null

40/2 2026/10/01 02:25 agent kmsan-evaluator
2m Model:
core

Args:
null

Results:
{
  "KMSANReasoning": "The patch series introduces hardware coalescing (MAPv5 downlink coalescing) support in the Qualcomm RMNET driver. This involves parsing MAPv5 coalescing headers, validating bounds, de-coalescing packets into individual or GSO-stamped SKBs, and exposing coalescing statistics via ethtool.\n\nAnalysis of potential uninitialized memory risks:\n1. Local structs and variables:\n   - `struct rmnet_map_coal_metadata` is explicitly zero-initialized using `memset` before use.\n   - `struct sk_buff_head list` is initialized with `__skb_queue_head_init`.\n   - `nlo_err_mask` is initialized upon successful return from `rmnet_map_data_check_coal_header` and not used on error paths.\n   - In `rmnet_config.c`, `data_format` and `old_data_format` in `rmnet_changelink` are initialized and accessed strictly within the `if (data[IFLA_RMNET_FLAGS])` block.\n2. Kernel-to-userspace data (ethtool \u0026 netlink):\n   - The new counters in `struct rmnet_priv_stats` consist entirely of 64-bit integers (`u64`) with no padding holes.\n   - Device private data `rmnet_priv` is allocated with zero-initialization via `alloc_netdev` / `rtnl_link_ops`.\n   - The count of strings in `rmnet_gstrings_stats` exactly matches the number of `u64` fields in `struct rmnet_priv_stats`, so `rmnet_get_ethtool_stats` copies only initialized counter values without uninitialized data leaks.\n3. SKB payload reconstruction:\n   - For carved SKBs in `__rmnet_map_segment_coal_skb`, the packet buffer is fully populated via `skb_put_data` and header `memcpy` operations without leaving uninitialized gaps in the packet buffer.\n   - Any boundary issues when parsing incoming frame headers or slicing payloads would constitute out-of-bounds memory accesses or length calculation bugs, which are detected by standard KASAN.\n\nBecause there are no uninitialized memory usages or kernel-to-user info-leak risks, and any potential memory corruption or out-of-bounds accesses are covered by KASAN, a dedicated KMSAN fuzzing session is not warranted.",
  "NeedsKMSAN": false
}

Instruction:
You are an expert Linux kernel security engineer specializing in kernel memory
error detectors (KASAN and KMSAN). Your job is to review the provided patch series and
determine if the code changes justify spawning a dedicated KMSAN (KernelMemorySanitizer)
fuzzing session in addition to standard KASAN fuzzing.

CRITICAL DISTINCTION BETWEEN KASAN AND KMSAN:
- Standard KASAN kernel builds (upstream-apparmor-kasan.config) already enable
  a comprehensive suite of debugging tools and sanitizers, including KASAN
  (out-of-bounds accesses, use-after-free, double free, invalid free), LOCKDEP
  (locking bugs and deadlocks), UB-sanitizers, and memory corruption checks.
- KMSAN (KernelMemorySanitizer) detects reads of UNINITIALIZED memory (stack, heap,
  or page allocations) and kernel-to-user memory info-leaks.

Rule: THERE IS NO SENSE IN RUNNING A KMSAN SESSION IF A BUG CAN BE CAUGHT BY KASAN,
LOCKDEP, OR OTHER STANDARD BUG DETECTORS.
A dedicated KMSAN fuzzing session incurs significant resource costs. You must ONLY
set NeedsKMSAN=true if the code changes introduce or expose UNINITIALIZED MEMORY risks
that are detected ONLY by KMSAN.

Look holistically at the patch series and surrounding code. Even if no direct
uninitialized field accesses or new buffer allocations are added in the diff itself,
a patch may alter control flow, bounds checking, or data length calculations in ways
that change how the rest of the code operates on existing buffers (e.g. allowing
uninitialized stack/heap memory to be read, copied to user space, or used in control
flow). Do not hesitate to use your code access tools to inspect the surrounding code,
called functions, and callers.

Set NeedsKMSAN=true ONLY IF the patch introduces or modifies:
1. Kernel structures sent to user space (via copy_to_user, put_user, netlink skb
   attributes, ioctl output arguments, socket options, or BPF buffers) where fields
   or structure padding might not be fully initialized/zeroed.
2. Conditional logic or branching that depends on potentially uninitialized variables
   or struct fields.
3. Allocation or initialization of complex data structures where uninitialized fields
   could be read later in reachable code paths.
4. Bounds checks, lengths, or logic in a way that allows surrounding code to access
   uninitialized bytes of existing buffers.

Set NeedsKMSAN=false IF:
- The code changes primarily risk out-of-bounds access, array overflows, NULL pointer
  dereferences, locking deadlocks, or use-after-free bugs (these are already caught
  by KASAN, LOCKDEP, or standard bug detectors).
- All stack/heap structures touched or introduced by the patch are fully zeroed
  or initialized (e.g. using = {0}, memset, kzalloc) before being read or copied.
- The patch does not introduce any risk of uninitialized memory usage or info-leaks.

Use your code access tools to inspect the surrounding code if necessary, then provide
detailed KMSANReasoning contrasting KASAN vs KMSAN applicability for this patch.
Prefer calling several tools at the same time to save round-trips.


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

Prompt:
Target architecture: amd64

For your convenience, here is the diff of the changes:
commit f42f799b4c15e45cae56eaf840d351fb243bdd4b
Author: syz-cluster <triage@syzkaller.com>
Date:   Thu Oct 1 02:23:49 2026 +0000

    syz-cluster: applied patch under review

diff --git a/Documentation/networking/device_drivers/cellular/qualcomm/rmnet.rst b/Documentation/networking/device_drivers/cellular/qualcomm/rmnet.rst
index 5aedbabb73827..ba8e947d54e68 100644
--- a/Documentation/networking/device_drivers/cellular/qualcomm/rmnet.rst
+++ b/Documentation/networking/device_drivers/cellular/qualcomm/rmnet.rst
@@ -125,8 +125,8 @@ Command (1)/ Data (0) bit value is to indicate if the packet is a MAP command
 or data packet. Command packet is used for transport level flow control. Data
 packets are standard IP packets.
 
-Next header is used to indicate the presence of another header, currently is
-limited to checksum header.
+Next header is used to indicate the presence of another header, currently
+limited to the checksum and coalescing headers.
 
 Padding is the number of bytes to be appended to the payload to
 ensure 4 byte alignment.
@@ -150,11 +150,11 @@ Header Type is to indicate the type of header, this usually is set to CHECKSUM
 
 Header types
 
-= ===============
+= ======================
 0 Reserved
-1 Reserved
+1 coalescing header
 2 checksum header
-= ===============
+= ======================
 
 Checksum Valid is to indicate whether the header checksum is valid. Value of 1
 implies that checksum is calculated on this packet and is valid, value of 0
@@ -162,8 +162,78 @@ indicates that the calculated packet checksum is invalid.
 
 Reserved bits must be zero when sent and ignored when received.
 
-e. MAP packet v1/v5 (command specific)
---------------------------------------
+e. Coalescing header v5
+------------------------
+
+Hardware can coalesce multiple same-flow IP packets of the same length into
+a single MAP frame to reduce per-packet overhead at high data rates.  The
+coalescing header (header type 1) describes the coalesced content.
+
+Packet format::
+
+  Bit         0 - 6         7          8           9-11         12-15
+  Function  Header Type  Next Header  CSUM valid  Num NLOs    (reserved)
+
+  Bit        16-19        20-23
+  Function  Close value  Close type
+
+  Bit        24-27        28-31
+  Function  (reserved)    VEID
+
+  Bit           32 - 47        48 - 55            56 - 63
+  Function   Packet length  CSUM error bitmap  Num packets (NLO 0)
+
+  ... (up to 6 NLO entries total, same 32-bit format per entry)
+
+Header Type is set to 1 (coalescing).
+
+Num NLOs (Number-Length Objects) is the count of active NLO entries
+(1 – 6).  Each NLO describes a group of consecutive coalesced packets
+that all share the same IP packet length.
+
+CSUM valid (bit 8) indicates whether the hardware checksum is valid
+for all packets in the frame.
+
+Close type and close value encode the hardware reason that coalescing
+was terminated for this frame:
+
+Close type values:
+
+= ==============================
+0 non-coalesced (single packet)
+1 IP flow miss
+2 transport flow miss
+3 hardware limit (see value)
+4 coalescing closed (FIN/PSH)
+= ==============================
+
+Close value (used when close type is 3):
+
+= ==================
+0 NL limit reached
+1 packet limit
+2 byte limit
+3 time limit
+4 eviction
+= ==================
+
+VEID is the virtual endpoint ID of the originating flow.
+
+Each NLO entry::
+
+  Bit         0 - 15        16 - 23            24 - 31
+  Function  Pkt length   CSUM error bitmap   Num packets
+
+Pkt length is the full IP packet length, including the IP header,
+transport header, and payload, for every packet in this NLO group.
+
+CSUM error bitmap is a per-packet bitmask. Bit N is set when packet N
+in this NLO has a bad checksum.
+
+Num packets is the count of coalesced packets described by this NLO.
+
+f. MAP packet v1/v5 (command specific)
+---------------------------------------
 
 Packet format::
 
@@ -187,7 +257,7 @@ Command types
 3 is for error during processing of commands
 = ==========================================
 
-f. Aggregation
+g. Aggregation
 --------------
 
 Aggregation is multiple MAP packets (can be data or command) delivered to
@@ -208,3 +278,32 @@ rmnet userspace configuration is done through netlink using iproute2
 https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/
 
 The driver uses rtnl_link_ops for communication.
+
+The data format flags controlling the ingress and egress processing
+pipeline are set via the ``IFLA_RMNET_FLAGS`` attribute
+(``struct ifla_rmnet_flags``).
+
+Relevant ingress flags:
+
+``RMNET_FLAGS_INGRESS_DEAGGREGATION``
+  Enable MAP frame de-aggregation.
+
+``RMNET_FLAGS_INGRESS_MAP_CKSUMV4``
+  Enable MAPv4 downlink checksum offload.
+
+``RMNET_FLAGS_INGRESS_MAP_CKSUMV5``
+  Enable MAPv5 downlink checksum offload (header type 2).
+
+``RMNET_FLAGS_INGRESS_COALESCE``
+  Enable MAPv5 downlink hardware coalescing (header type 1).
+  When set the driver will decode coalescing headers, reconstruct
+  individual IP packets and will deliver batched GSO SKBs to the
+  stack for efficient processing.
+
+Relevant egress flags:
+
+``RMNET_FLAGS_EGRESS_MAP_CKSUMV4``
+  Enable MAPv4 uplink checksum offload.
+
+``RMNET_FLAGS_EGRESS_MAP_CKSUMV5``
+  Enable MAPv5 uplink checksum offload.
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
index 61b04c6c0390e..555659c2edc21 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c
@@ -26,6 +26,30 @@ static int rmnet_is_real_dev_registered(const struct net_device *real_dev)
 	return rcu_access_pointer(real_dev->rx_handler) == rmnet_rx_handler;
 }
 
+/* Only three MAP configurations are supported: MAPv1 (no checksum
+ * offload), MAPv4 (v4 checksum offload) and MAPv5 (v5 checksum
+ * offload). QMAP command support is orthogonal and permitted with
+ * any of the three. Mixing v4 and v5 checksum offload flags together
+ * is not a supported configuration. DL packet coalescing additionally
+ * requires a MAPv5 configuration.
+ */
+static bool rmnet_config_data_format_valid(u32 data_format)
+{
+	u32 v4_mask = RMNET_FLAGS_INGRESS_MAP_CKSUMV4 |
+		      RMNET_FLAGS_EGRESS_MAP_CKSUMV4;
+	u32 v5_mask = RMNET_FLAGS_INGRESS_MAP_CKSUMV5 |
+		      RMNET_FLAGS_EGRESS_MAP_CKSUMV5;
+
+	if ((data_format & v4_mask) && (data_format & v5_mask))
+		return false;
+
+	if ((data_format & RMNET_FLAGS_INGRESS_COALESCE) &&
+	    !(data_format & RMNET_FLAGS_INGRESS_MAP_CKSUMV5))
+		return false;
+
+	return true;
+}
+
 /* Needs rtnl lock */
 struct rmnet_port*
 rmnet_get_port_rtnl(const struct net_device *real_dev)
@@ -143,6 +167,20 @@ static int rmnet_newlink(struct net_device *dev,
 		return -ENODEV;
 	}
 
+	if (data[IFLA_RMNET_FLAGS]) {
+		struct ifla_rmnet_flags *flags;
+
+		flags = nla_data(data[IFLA_RMNET_FLAGS]);
+		data_format &= ~flags->mask;
+		data_format |= flags->flags & flags->mask;
+	}
+
+	if (!rmnet_config_data_format_valid(data_format)) {
+		NL_SET_ERR_MSG_MOD(extack,
+				   "unsupported MAP checksum flag combination");
+		return -EINVAL;
+	}
+
 	ep = kzalloc_obj(*ep);
 	if (!ep)
 		return -ENOMEM;
@@ -167,14 +205,6 @@ static int rmnet_newlink(struct net_device *dev,
 
 	hlist_add_head_rcu(&ep->hlnode, &port->muxed_ep[mux_id]);
 
-	if (data[IFLA_RMNET_FLAGS]) {
-		struct ifla_rmnet_flags *flags;
-
-		flags = nla_data(data[IFLA_RMNET_FLAGS]);
-		data_format &= ~flags->mask;
-		data_format |= flags->flags & flags->mask;
-	}
-
 	netdev_dbg(dev, "data format [0x%08X]\n", data_format);
 	WRITE_ONCE(port->data_format, data_format);
 
@@ -301,8 +331,11 @@ static int rmnet_changelink(struct net_device *dev, struct nlattr *tb[],
 			    struct netlink_ext_ack *extack)
 {
 	struct rmnet_priv *priv = netdev_priv(dev);
+	struct ifla_rmnet_flags *flags;
 	struct net_device *real_dev;
 	struct rmnet_port *port;
+	u32 old_data_format;
+	u32 data_format;
 	u16 mux_id;
 
 	if (!dev)
@@ -320,6 +353,19 @@ static int rmnet_changelink(struct net_device *dev, struct nlattr *tb[],
 
 	port = rmnet_get_port_rtnl(real_dev);
 
+	if (data[IFLA_RMNET_FLAGS]) {
+		old_data_format = READ_ONCE(port->data_format);
+		flags = nla_data(data[IFLA_RMNET_FLAGS]);
+		data_format = old_data_format & ~flags->mask;
+		data_format |= flags->flags & flags->mask;
+
+		if (!rmnet_config_data_format_valid(data_format)) {
+			NL_SET_ERR_MSG_MOD(extack,
+					   "unsupported MAP checksum flag combination");
+			return -EINVAL;
+		}
+	}
+
 	if (data[IFLA_RMNET_MUX_ID]) {
 		mux_id = nla_get_u16(data[IFLA_RMNET_MUX_ID]);
 
@@ -346,14 +392,6 @@ static int rmnet_changelink(struct net_device *dev, struct nlattr *tb[],
 	}
 
 	if (data[IFLA_RMNET_FLAGS]) {
-		struct ifla_rmnet_flags *flags;
-		u32 old_data_format;
-		u32 data_format;
-
-		old_data_format = port->data_format;
-		flags = nla_data(data[IFLA_RMNET_FLAGS]);
-		data_format = old_data_format & ~flags->mask;
-		data_format |= flags->flags & flags->mask;
 		WRITE_ONCE(port->data_format, data_format);
 
 		if (rmnet_vnd_update_dev_mtu(port, real_dev)) {
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h
index 5adda0323dda7..2a34f8a7b5276 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h
@@ -80,6 +80,26 @@ struct rmnet_priv_stats {
 	u64 csum_skipped;
 	u64 csum_sw;
 	u64 csum_hw;
+	/* DL coalescing */
+	u64 coal_rx;
+	u64 coal_pkts;
+	u64 coal_hdr_nlo_err;
+	u64 coal_hdr_pkt_err;
+	u64 coal_csum_err;
+	u64 coal_csum_drop;
+	u64 coal_reconstruct;
+	u64 coal_ip_invalid;
+	u64 coal_trans_invalid;
+	/* close-reason sub-counters */
+	u64 coal_close_non_coal;
+	u64 coal_close_ip_miss;
+	u64 coal_close_trans_miss;
+	u64 coal_close_hw_nl;
+	u64 coal_close_hw_pkt;
+	u64 coal_close_hw_byte;
+	u64 coal_close_hw_time;
+	u64 coal_close_hw_evict;
+	u64 coal_close_coal;
 };
 
 struct rmnet_priv {
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
index aa5523f4618eb..bb867ceb01c1c 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c
@@ -50,6 +50,16 @@ rmnet_deliver_skb(struct sk_buff *skb)
 	gro_cells_receive(&priv->gro_cells, skb);
 }
 
+static void rmnet_deliver_skb_list(struct sk_buff_head *head)
+{
+	struct sk_buff *skb;
+
+	while ((skb = __skb_dequeue(head))) {
+		rmnet_set_skb_proto(skb);
+		rmnet_deliver_skb(skb);
+	}
+}
+
 /* MAP handler */
 
 static void
@@ -59,6 +69,7 @@ __rmnet_map_ingress_handler(struct sk_buff *skb,
 {
 	struct rmnet_map_header *map_header = (void *)skb->data;
 	struct rmnet_endpoint *ep;
+	struct sk_buff_head list;
 	u16 len, pad;
 	u8 mux_id;
 
@@ -83,12 +94,13 @@ __rmnet_map_ingress_handler(struct sk_buff *skb,
 
 	skb->dev = ep->egress_dev;
 
-	if ((data_format & RMNET_FLAGS_INGRESS_MAP_CKSUMV5) &&
+	__skb_queue_head_init(&list);
+
+	if ((data_format &
+	     (RMNET_FLAGS_INGRESS_MAP_CKSUMV5 | RMNET_FLAGS_INGRESS_COALESCE)) &&
 	    (map_header->flags & MAP_NEXT_HEADER_FLAG)) {
-		if (rmnet_map_process_next_hdr_packet(skb, len))
+		if (rmnet_map_process_next_hdr_packet(skb, &list, len, data_format))
 			goto free_skb;
-		skb_pull(skb, sizeof(*map_header));
-		rmnet_set_skb_proto(skb);
 	} else {
 		/* Subtract MAP header */
 		skb_pull(skb, sizeof(*map_header));
@@ -96,10 +108,11 @@ __rmnet_map_ingress_handler(struct sk_buff *skb,
 		if (data_format & RMNET_FLAGS_INGRESS_MAP_CKSUMV4 &&
 		    !rmnet_map_checksum_downlink_packet(skb, len + pad))
 			skb->ip_summed = CHECKSUM_UNNECESSARY;
+		skb_trim(skb, len);
+		__skb_queue_tail(&list, skb);
 	}
 
-	skb_trim(skb, len);
-	rmnet_deliver_skb(skb);
+	rmnet_deliver_skb_list(&list);
 	return;
 
 free_skb:
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h
index 0977e495f5915..77ddac6023c01 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map.h
@@ -6,6 +6,22 @@
 #define _RMNET_MAP_H_
 #include <linux/if_rmnet.h>
 
+enum rmnet_map_v5_close_type {
+	RMNET_MAP_COAL_CLOSE_NON_COAL,
+	RMNET_MAP_COAL_CLOSE_IP_MISS,
+	RMNET_MAP_COAL_CLOSE_TRANS_MISS,
+	RMNET_MAP_COAL_CLOSE_HW,
+	RMNET_MAP_COAL_CLOSE_COAL,
+};
+
+enum rmnet_map_v5_close_value {
+	RMNET_MAP_COAL_CLOSE_HW_NL,
+	RMNET_MAP_COAL_CLOSE_HW_PKT,
+	RMNET_MAP_COAL_CLOSE_HW_BYTE,
+	RMNET_MAP_COAL_CLOSE_HW_TIME,
+	RMNET_MAP_COAL_CLOSE_HW_EVICT,
+};
+
 struct rmnet_map_control_command {
 	u8  command_name;
 	u8  cmd_type:2;
@@ -53,7 +69,9 @@ void rmnet_map_checksum_uplink_packet(struct sk_buff *skb,
 				      struct rmnet_port *port,
 				      struct net_device *orig_dev,
 				      int csum_type);
-int rmnet_map_process_next_hdr_packet(struct sk_buff *skb, u16 len);
+int rmnet_map_process_next_hdr_packet(struct sk_buff *skb,
+				      struct sk_buff_head *list,
+				      u16 len, u32 data_format);
 unsigned int rmnet_map_tx_aggregate(struct sk_buff *skb, struct rmnet_port *port,
 				    struct net_device *orig_dev);
 void rmnet_map_tx_aggregate_init(struct rmnet_port *port);
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
index 39d6d084e73f0..2e76bf5a5a90c 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c
@@ -7,7 +7,11 @@
 #include <linux/netdevice.h>
 #include <linux/ip.h>
 #include <linux/ipv6.h>
+#include <linux/tcp.h>
+#include <linux/udp.h>
+#include <net/ip.h>
 #include <net/ip6_checksum.h>
+#include <net/ipv6.h>
 #include <linux/bitfield.h>
 #include "rmnet_config.h"
 #include "rmnet_map.h"
@@ -17,6 +21,19 @@
 #define RMNET_MAP_DEAGGR_SPACING  64
 #define RMNET_MAP_DEAGGR_HEADROOM (RMNET_MAP_DEAGGR_SPACING / 2)
 
+struct rmnet_map_coal_metadata {
+	void *ip_header;
+	void *trans_header;
+	u16 ip_len;
+	u16 trans_len;
+	u16 data_offset;
+	u16 data_len;
+	u8 ip_proto;
+	u8 trans_proto;
+	u8 pkt_count;
+	bool zero_csum;
+};
+
 static __sum16 *rmnet_map_get_csum_field(unsigned char protocol,
 					 const void *txporthdr)
 {
@@ -337,8 +354,8 @@ u32 rmnet_map_validate_packet_len(struct sk_buff *skb, u32 data_format)
 {
 	struct rmnet_map_v5_csum_header *next_hdr = NULL;
 	struct rmnet_map_header *maph;
-	void *data = skb->data;
 	u32 packet_len;
+	u8 hdr_type;
 
 	if (skb->len < sizeof(*maph))
 		return 0;
@@ -353,24 +370,28 @@ u32 rmnet_map_validate_packet_len(struct sk_buff *skb, u32 data_format)
 
 	if (data_format & RMNET_FLAGS_INGRESS_MAP_CKSUMV4) {
 		packet_len += sizeof(struct rmnet_map_dl_csum_trailer);
-	} else if ((data_format & RMNET_FLAGS_INGRESS_MAP_CKSUMV5) &&
+	} else if ((data_format &
+		    (RMNET_FLAGS_INGRESS_MAP_CKSUMV5 | RMNET_FLAGS_INGRESS_COALESCE)) &&
 		   !(maph->flags & MAP_CMD_FLAG)) {
-		/* Mapv5 data pkt without csum hdr is invalid */
 		if (!(maph->flags & MAP_NEXT_HEADER_FLAG))
 			return 0;
 
-		packet_len += sizeof(*next_hdr);
-		next_hdr = data + sizeof(*maph);
+		if (skb->len < sizeof(*maph) + sizeof(*next_hdr))
+			return 0;
+
+		next_hdr = (struct rmnet_map_v5_csum_header *)(skb->data + sizeof(*maph));
+		hdr_type = u8_get_bits(next_hdr->header_info,
+				       MAPV5_HDRINFO_HDR_TYPE_FMASK);
+
+		if (hdr_type == RMNET_MAP_HEADER_TYPE_CSUM_OFFLOAD)
+			packet_len += sizeof(*next_hdr);
+		else if (hdr_type != RMNET_MAP_HEADER_TYPE_COALESCING)
+			return 0;
 	}
 
 	if (skb->len < packet_len)
 		return 0;
 
-	if (next_hdr &&
-	    u8_get_bits(next_hdr->header_info, MAPV5_HDRINFO_HDR_TYPE_FMASK) !=
-	    RMNET_MAP_HEADER_TYPE_CSUM_OFFLOAD)
-		return 0;
-
 	return packet_len;
 }
 
@@ -497,34 +518,670 @@ void rmnet_map_checksum_uplink_packet(struct sk_buff *skb,
 	}
 }
 
-/* Process a MAPv5 packet header */
-int rmnet_map_process_next_hdr_packet(struct sk_buff *skb,
+static struct rmnet_map_v5_csum_header *
+rmnet_map_get_next_hdr(struct sk_buff *skb)
+{
+	return (struct rmnet_map_v5_csum_header *)(skb->data +
+						   sizeof(struct rmnet_map_header));
+}
+
+static u8 rmnet_map_get_next_hdr_type(struct sk_buff *skb)
+{
+	struct rmnet_map_v5_csum_header *hdr = rmnet_map_get_next_hdr(skb);
+
+	return u8_get_bits(hdr->header_info, MAPV5_HDRINFO_HDR_TYPE_FMASK);
+}
+
+static bool rmnet_map_get_csum_valid(struct sk_buff *skb)
+{
+	struct rmnet_map_v5_csum_header *hdr = rmnet_map_get_next_hdr(skb);
+
+	return !!(hdr->csum_info & MAPV5_CSUMINFO_VALID_FLAG);
+}
+
+/* Stamp GSO metadata so the network stack can segment a coalesced SKB. */
+static void rmnet_map_gso_stamp(struct sk_buff *skb,
+				struct rmnet_map_coal_metadata *coal_meta)
+{
+	struct skb_shared_info *shinfo = skb_shinfo(skb);
+
+	if (coal_meta->trans_proto == IPPROTO_TCP)
+		shinfo->gso_type = (coal_meta->ip_proto == 4) ?
+				   SKB_GSO_TCPV4 : SKB_GSO_TCPV6;
+	else
+		shinfo->gso_type = SKB_GSO_UDP_L4;
+
+	shinfo->gso_size = coal_meta->data_len;
+	shinfo->gso_segs = coal_meta->pkt_count;
+}
+
+/* Set the transport checksum to the pseudo-header checksum and request
+ * partial checksum offload, letting the NIC or stack finish it.
+ */
+static void rmnet_map_partial_csum(struct sk_buff *skb,
+				   struct rmnet_map_coal_metadata *coal_meta)
+{
+	u16 pkt_len = skb->len - coal_meta->ip_len;
+	unsigned char *data = skb->data;
+	__sum16 pseudo;
+
+	if (coal_meta->ip_proto == 4) {
+		struct iphdr *iph = (struct iphdr *)data;
+
+		pseudo = ~csum_tcpudp_magic(iph->saddr, iph->daddr,
+					    pkt_len, coal_meta->trans_proto, 0);
+	} else {
+		struct ipv6hdr *ip6h = (struct ipv6hdr *)data;
+
+		pseudo = ~csum_ipv6_magic(&ip6h->saddr, &ip6h->daddr,
+					  pkt_len, coal_meta->trans_proto, 0);
+	}
+
+	if (coal_meta->trans_proto == IPPROTO_TCP) {
+		struct tcphdr *tp = (struct tcphdr *)(data + coal_meta->ip_len);
+
+		tp->check = pseudo;
+		skb->csum_offset = offsetof(struct tcphdr, check);
+	} else {
+		struct udphdr *up = (struct udphdr *)(data + coal_meta->ip_len);
+
+		up->check = pseudo;
+		skb->csum_offset = offsetof(struct udphdr, check);
+	}
+
+	skb->ip_summed = CHECKSUM_PARTIAL;
+	skb->csum_start = skb->data + coal_meta->ip_len - skb->head;
+}
+
+/* On some hardware, num_nlos in the coalescing header can be reported
+ * incorrectly under certain conditions even though the per-NLO num_packets
+ * fields it is meant to summarize are correct. Recompute the true NLO count
+ * directly from the nl_pairs[] content rather than trusting the declared
+ * value, so that rmnet_map_v5_csum_fixup()'s single NLO, single packet check
+ * is reliable.
+ */
+static void rmnet_map_v5_fixup_num_nlos(struct rmnet_map_v5_coal_header *coal_hdr)
+{
+	u8 nlos = 0;
+	int i;
+
+	for (i = 0; i < RMNET_MAP_V5_MAX_NLOS; i++) {
+		if (coal_hdr->nl_pairs[i].num_packets)
+			nlos++;
+	}
+
+	coal_hdr->coal_info = u8_encode_bits(nlos, MAPV5_COALINFO_NUM_NLOS_FMASK) |
+			      (coal_hdr->coal_info & MAPV5_COALINFO_CSUM_VALID_FLAG);
+}
+
+/* The checksum valid indication for a single NLO, single packet coalescing
+ * frame cannot be trusted when the close reason is a TCP FIN/PSH, a packet
+ * count limit, a byte count limit or a time limit.
+ */
+static bool rmnet_map_v5_csum_fixup(struct rmnet_map_v5_coal_header *coal_hdr)
+{
+	u8 close_value = u8_get_bits(coal_hdr->close_info,
+				     MAPV5_CLOSEINFO_CLOSE_VALUE_FMASK);
+	u8 close_type = u8_get_bits(coal_hdr->close_info,
+				    MAPV5_CLOSEINFO_CLOSE_TYPE_FMASK);
+	u8 num_nlos = u8_get_bits(coal_hdr->coal_info,
+				  MAPV5_COALINFO_NUM_NLOS_FMASK);
+
+	/* Only applies to single NLO, single packet frames */
+	if (num_nlos != 1 || coal_hdr->nl_pairs[0].num_packets != 1)
+		return false;
+
+	/* TCP FIN or PSH triggered the close */
+	if (close_type == RMNET_MAP_COAL_CLOSE_COAL)
+		return true;
+
+	/* Hit a hardware limit */
+	if (close_type == RMNET_MAP_COAL_CLOSE_HW) {
+		switch (close_value) {
+		case RMNET_MAP_COAL_CLOSE_HW_PKT:
+		case RMNET_MAP_COAL_CLOSE_HW_BYTE:
+		case RMNET_MAP_COAL_CLOSE_HW_TIME:
+			return true;
+		}
+	}
+
+	return false;
+}
+
+/* Carve one logical segment from a coalesced SKB and append it to the list.
+ * Adjusts TCP sequence numbers, IP IDs/lengths, and checksum state.
+ */
+static void
+__rmnet_map_segment_coal_skb(struct sk_buff *coal_skb,
+			     struct rmnet_map_coal_metadata *coal_meta,
+			     struct sk_buff_head *list, u8 pkt_id,
+			     bool csum_valid)
+{
+	u32 dlen = coal_meta->data_len * coal_meta->pkt_count;
+	struct rmnet_priv *priv = netdev_priv(coal_skb->dev);
+	u32 hlen = coal_meta->ip_len + coal_meta->trans_len;
+	struct sk_buff *skbn;
+
+	/* RFC 768: UDP checksum is optional for IPv4, and is 0 if unused.
+	 * Such packets are never actually bad, regardless of what the
+	 * checksum bitmap says.
+	 */
+	if (!csum_valid && coal_meta->zero_csum)
+		csum_valid = true;
+
+	if (!csum_valid) {
+		priv->stats.coal_csum_drop++;
+		goto next_pkt;
+	}
+
+	skbn = alloc_skb(hlen + dlen + RMNET_MAP_DEAGGR_HEADROOM, GFP_ATOMIC);
+	if (!skbn)
+		goto next_pkt;
+
+	skb_reserve(skbn, hlen + RMNET_MAP_DEAGGR_HEADROOM);
+	skb_put_data(skbn,
+		     coal_skb->data + coal_meta->ip_len + coal_meta->trans_len +
+		     coal_meta->data_offset,
+		     dlen);
+
+	/* Restore transport header */
+	skb_push(skbn, coal_meta->trans_len);
+	memcpy(skbn->data, coal_meta->trans_header, coal_meta->trans_len);
+	skb_reset_transport_header(skbn);
+
+	if (coal_meta->trans_proto == IPPROTO_TCP) {
+		struct tcphdr *th = tcp_hdr(skbn);
+
+		th->seq = htonl(ntohl(th->seq) + coal_meta->data_offset);
+		/* Strip dangerous flags from non-final segments */
+		if ((th->fin || th->psh) &&
+		    hlen + coal_meta->data_offset + dlen < coal_skb->len) {
+			th->fin = 0;
+			th->psh = 0;
+		}
+	} else if (coal_meta->trans_proto == IPPROTO_UDP) {
+		struct udphdr *uh = udp_hdr(skbn);
+
+		uh->len = htons(skbn->len);
+	}
+
+	/* Restore IP header */
+	skb_push(skbn, coal_meta->ip_len);
+	memcpy(skbn->data, coal_meta->ip_header, coal_meta->ip_len);
+	skb_reset_network_header(skbn);
+
+	if (coal_meta->ip_proto == 4) {
+		struct iphdr *iph = ip_hdr(skbn);
+
+		iph->id = htons(ntohs(iph->id) + pkt_id);
+		iph->tot_len = htons(skbn->len);
+		iph->check = 0;
+		iph->check = ip_fast_csum(iph, iph->ihl);
+	} else {
+		ipv6_hdr(skbn)->payload_len =
+			htons(skbn->len - sizeof(struct ipv6hdr));
+	}
+
+	rmnet_map_partial_csum(skbn, coal_meta);
+
+	skbn->dev = coal_skb->dev;
+	priv->stats.coal_reconstruct++;
+
+	if (coal_meta->pkt_count > 1)
+		rmnet_map_gso_stamp(skbn, coal_meta);
+
+	__skb_queue_tail(list, skbn);
+
+next_pkt:
+	coal_meta->data_offset += dlen;
+	coal_meta->pkt_count = 0;
+}
+
+/* Parse the IP header of the coalesced frame and perform basic
+ * validation of header fields.
+ */
+static bool rmnet_map_coal_parse_ip_hdr(struct sk_buff *coal_skb,
+					struct rmnet_map_coal_metadata *meta,
+					bool *gro)
+{
+	struct rmnet_priv *priv = netdev_priv(coal_skb->dev);
+	struct ipv6hdr *ip6h;
+	struct iphdr *iph;
+	__be16 frag_off;
+	u8 protocol;
+	int ret;
+
+	if (coal_skb->len < sizeof(*iph)) {
+		priv->stats.coal_ip_invalid++;
+		return false;
+	}
+
+	iph = (struct iphdr *)coal_skb->data;
+
+	if (iph->version == 4) {
+		meta->ip_proto = 4;
+		meta->ip_len = iph->ihl * 4;
+		meta->trans_proto = iph->protocol;
+		meta->ip_header = iph;
+		if (meta->ip_len < sizeof(*iph) || coal_skb->len < meta->ip_len) {
+			priv->stats.coal_ip_invalid++;
+			return false;
+		}
+
+		if (ip_is_fragment(iph)) {
+			priv->stats.coal_ip_invalid++;
+			return false;
+		}
+
+		if (iph->ihl != 5)
+			*gro = false;
+	} else if (iph->version == 6) {
+		if (coal_skb->len < sizeof(*ip6h)) {
+			priv->stats.coal_ip_invalid++;
+			return false;
+		}
+
+		ip6h = (struct ipv6hdr *)iph;
+		protocol = ip6h->nexthdr;
+		meta->ip_proto = 6;
+		ret = ipv6_skip_exthdr(coal_skb, sizeof(*ip6h), &protocol,
+				       &frag_off);
+		if (ret < 0 || frag_off) {
+			priv->stats.coal_ip_invalid++;
+			return false;
+		}
+
+		meta->ip_len = (u16)ret;
+		meta->trans_proto = protocol;
+		meta->ip_header = ip6h;
+		if (meta->ip_len > sizeof(*ip6h))
+			*gro = false;
+	} else {
+		priv->stats.coal_ip_invalid++;
+		return false;
+	}
+
+	return true;
+}
+
+/* Parse the transport header following the IP header into coal_meta. The
+ * available length is checked before any field is read.
+ */
+static bool rmnet_map_coal_parse_trans_hdr(struct sk_buff *coal_skb,
+					   struct rmnet_map_coal_metadata *meta)
+{
+	struct rmnet_priv *priv = netdev_priv(coal_skb->dev);
+	struct udphdr *uh;
+	struct tcphdr *th;
+	u32 avail;
+	u8 *base;
+
+	base = (u8 *)meta->ip_header + meta->ip_len;
+	avail = coal_skb->len - meta->ip_len;
+
+	if (meta->trans_proto == IPPROTO_TCP) {
+		if (avail < sizeof(*th)) {
+			priv->stats.coal_trans_invalid++;
+			return false;
+		}
+
+		th = (struct tcphdr *)base;
+		meta->trans_len = th->doff * 4;
+		meta->trans_header = th;
+		if (meta->trans_len < sizeof(*th) || avail < meta->trans_len) {
+			priv->stats.coal_trans_invalid++;
+			return false;
+		}
+	} else if (meta->trans_proto == IPPROTO_UDP) {
+		if (avail < sizeof(*uh)) {
+			priv->stats.coal_trans_invalid++;
+			return false;
+		}
+
+		uh = (struct udphdr *)base;
+		meta->trans_len = sizeof(*uh);
+		meta->trans_header = uh;
+		if (meta->ip_proto == 4 && !uh->check)
+			meta->zero_csum = true;
+	} else {
+		priv->stats.coal_trans_invalid++;
+		return false;
+	}
+
+	return true;
+}
+
+/* Reject the frame if the total data bytes claimed by all NLOs exceed
+ * the actual payload in the SKB.  Each pkt_len covers IP+transport
+ * headers plus per-packet data. Headers appear once, so subtract hlen
+ * per packet and check the running sum against available data.
+ */
+static bool rmnet_map_coal_validate_bounds(struct sk_buff *coal_skb,
+					   struct rmnet_map_v5_coal_header *coal_hdr,
+					   u8 num_nlos, u32 hlen)
+{
+	u32 total_data = 0;
+	u32 nlo_len;
+	u16 plen;
+	u8 i;
+
+	for (i = 0; i < num_nlos; i++) {
+		plen = ntohs(coal_hdr->nl_pairs[i].pkt_len);
+
+		if (plen < hlen)
+			return false;
+
+		nlo_len = (u32)(plen - hlen) * coal_hdr->nl_pairs[i].num_packets;
+		if (total_data + nlo_len > coal_skb->len - hlen)
+			return false;
+
+		total_data += nlo_len;
+	}
+
+	return true;
+}
+
+/* Attempt the GRO-friendly fast path for a single-NLO, checksum-valid frame
+ * by reusing the original SKB and stamping GSO metadata instead of copying
+ * out each segment.  Returns true if the frame was consumed via the fast
+ * path, or false if the caller should fall back to full segmentation.
+ */
+static bool rmnet_map_coal_gro_fast_path(struct sk_buff *coal_skb,
+					 struct rmnet_map_v5_coal_header *coal_hdr,
+					 struct rmnet_map_coal_metadata *coal_meta,
+					 struct sk_buff_head *list,
+					 u8 num_nlos, bool gro)
+{
+	u32 hlen = coal_meta->ip_len + coal_meta->trans_len;
+
+	if (!gro || num_nlos != 1 ||
+	    !(coal_hdr->coal_info & MAPV5_COALINFO_CSUM_VALID_FLAG))
+		return false;
+
+	coal_meta->data_len = ntohs(coal_hdr->nl_pairs[0].pkt_len) - hlen;
+	coal_meta->pkt_count = coal_hdr->nl_pairs[0].num_packets;
+
+	coal_skb->ip_summed = CHECKSUM_UNNECESSARY;
+	if (coal_meta->pkt_count > 1) {
+		rmnet_map_partial_csum(coal_skb, coal_meta);
+		rmnet_map_gso_stamp(coal_skb, coal_meta);
+	}
+
+	__skb_queue_tail(list, coal_skb);
+	return true;
+}
+
+/* NLO packet lengths are already bounds-checked by
+ * rmnet_map_coal_validate_bounds() so no further validation is needed here.
+ */
+static void rmnet_map_coal_segment_loop(struct sk_buff *coal_skb,
+					struct rmnet_map_v5_coal_header *coal_hdr,
+					struct rmnet_map_coal_metadata *coal_meta,
+					struct sk_buff_head *list,
+					u64 nlo_err_mask, bool gro, u8 num_nlos)
+{
+	struct rmnet_priv *priv = netdev_priv(coal_skb->dev);
+	u32 hlen = coal_meta->ip_len + coal_meta->trans_len;
+	u8 pkt, total_pkt = 0;
+	bool csum_err;
+	u16 pkt_len;
+	u8 nlo;
+
+	for (nlo = 0; nlo < num_nlos; nlo++) {
+		pkt_len = ntohs(coal_hdr->nl_pairs[nlo].pkt_len);
+		pkt_len -= hlen;
+		coal_meta->data_len = pkt_len;
+
+		/* nlo_err_mask is one flat bitstream across all NLOs. Shift
+		 * it once per packet in absolute frame order and do not
+		 * re-align at the NLO boundary above. See the comment on
+		 * rmnet_map_data_check_coal_header() for why.
+		 */
+		for (pkt = 0; pkt < coal_hdr->nl_pairs[nlo].num_packets;
+		     pkt++, total_pkt++, nlo_err_mask >>= 1) {
+			csum_err = nlo_err_mask & 1;
+
+			if (csum_err)
+				priv->stats.coal_csum_err++;
+
+			if (!gro) {
+				coal_meta->pkt_count = 1;
+				__rmnet_map_segment_coal_skb(coal_skb, coal_meta,
+							     list, total_pkt,
+							     !csum_err);
+				continue;
+			}
+
+			if (csum_err) {
+				if (coal_meta->pkt_count)
+					__rmnet_map_segment_coal_skb(coal_skb,
+								     coal_meta,
+								     list,
+								     total_pkt,
+								     true);
+				coal_meta->pkt_count = 1;
+				__rmnet_map_segment_coal_skb(coal_skb, coal_meta,
+							     list, total_pkt,
+							     false);
+			} else {
+				coal_meta->pkt_count++;
+			}
+		}
+
+		/* Flush remaining packets from this NLO */
+		if (coal_meta->pkt_count)
+			__rmnet_map_segment_coal_skb(coal_skb, coal_meta, list,
+						     total_pkt, true);
+	}
+}
+
+/* Expand a coalesced SKB into individual IP packets placed on the list.
+ * NLOs with checksum errors are dropped. __rmnet_map_ingress_handler will
+ * free the SKB in the error case.
+ */
+static int rmnet_map_segment_coal_skb(struct sk_buff *coal_skb,
+				      u64 nlo_err_mask,
+				      struct sk_buff_head *list,
 				      u16 len)
 {
-	struct rmnet_priv *priv = netdev_priv(skb->dev);
-	struct rmnet_map_v5_csum_header *next_hdr;
-	u8 nexthdr_type;
+	bool gro = coal_skb->dev->features & NETIF_F_GRO_HW;
+	struct rmnet_map_v5_coal_header *coal_hdr;
+	struct rmnet_map_coal_metadata coal_meta;
+	u8 num_nlos;
+	u32 hlen;
+
+	memset(&coal_meta, 0, sizeof(coal_meta));
+
+	/* Drop any MAP frame padding. The coal header is counted in len */
+	skb_pull(coal_skb, sizeof(struct rmnet_map_header));
+	skb_trim(coal_skb, len);
+	coal_hdr = (struct rmnet_map_v5_coal_header *)coal_skb->data;
+	rmnet_map_v5_fixup_num_nlos(coal_hdr);
+	num_nlos = u8_get_bits(coal_hdr->coal_info, MAPV5_COALINFO_NUM_NLOS_FMASK);
+	skb_pull(coal_skb, sizeof(*coal_hdr));
+
+	if (!rmnet_map_coal_parse_ip_hdr(coal_skb, &coal_meta, &gro))
+		return -EINVAL;
 
-	next_hdr = (struct rmnet_map_v5_csum_header *)(skb->data +
-			sizeof(struct rmnet_map_header));
+	if (!rmnet_map_coal_parse_trans_hdr(coal_skb, &coal_meta))
+		return -EINVAL;
 
-	nexthdr_type = u8_get_bits(next_hdr->header_info,
-				   MAPV5_HDRINFO_HDR_TYPE_FMASK);
+	hlen = coal_meta.ip_len + coal_meta.trans_len;
 
-	if (nexthdr_type != RMNET_MAP_HEADER_TYPE_CSUM_OFFLOAD)
+	if (!rmnet_map_coal_validate_bounds(coal_skb, coal_hdr, num_nlos, hlen))
 		return -EINVAL;
 
-	if (unlikely(!(skb->dev->features & NETIF_F_RXCSUM))) {
-		priv->stats.csum_sw++;
-	} else if (next_hdr->csum_info & MAPV5_CSUMINFO_VALID_FLAG) {
-		priv->stats.csum_ok++;
-		skb->ip_summed = CHECKSUM_UNNECESSARY;
-	} else {
-		priv->stats.csum_valid_unset++;
+	if (rmnet_map_v5_csum_fixup(coal_hdr) && !coal_meta.zero_csum) {
+		coal_skb->ip_summed = CHECKSUM_NONE;
+		__skb_queue_tail(list, coal_skb);
+		return 0;
+	}
+
+	if (rmnet_map_coal_gro_fast_path(coal_skb, coal_hdr, &coal_meta, list,
+					 num_nlos, gro))
+		return 0;
+
+	rmnet_map_coal_segment_loop(coal_skb, coal_hdr, &coal_meta, list,
+				    nlo_err_mask, gro, num_nlos);
+
+	return 0;
+}
+
+/* Log the hardware close-reason counter for a coalescing header. */
+static void rmnet_map_data_log_close_stats(struct rmnet_priv *priv,
+					   u8 type, u8 code)
+{
+	switch (type) {
+	case RMNET_MAP_COAL_CLOSE_NON_COAL:
+		priv->stats.coal_close_non_coal++;
+		break;
+	case RMNET_MAP_COAL_CLOSE_IP_MISS:
+		priv->stats.coal_close_ip_miss++;
+		break;
+	case RMNET_MAP_COAL_CLOSE_TRANS_MISS:
+		priv->stats.coal_close_trans_miss++;
+		break;
+	case RMNET_MAP_COAL_CLOSE_HW:
+		switch (code) {
+		case RMNET_MAP_COAL_CLOSE_HW_NL:
+			priv->stats.coal_close_hw_nl++;
+			break;
+		case RMNET_MAP_COAL_CLOSE_HW_PKT:
+			priv->stats.coal_close_hw_pkt++;
+			break;
+		case RMNET_MAP_COAL_CLOSE_HW_BYTE:
+			priv->stats.coal_close_hw_byte++;
+			break;
+		case RMNET_MAP_COAL_CLOSE_HW_TIME:
+			priv->stats.coal_close_hw_time++;
+			break;
+		case RMNET_MAP_COAL_CLOSE_HW_EVICT:
+			priv->stats.coal_close_hw_evict++;
+			break;
+		default:
+			break;
+		}
+		break;
+	case RMNET_MAP_COAL_CLOSE_COAL:
+		priv->stats.coal_close_coal++;
+		break;
+	default:
+		break;
+	}
+}
+
+/* Validate the coalescing header and build the checksum error mask.
+ *
+ * Checks performed:
+ *  - MAP pkt_len accommodates the coal header (coal header is counted in
+ *    pkt_len. pkt_len < sizeof(*coal_hdr) means no payload is possible).
+ *  - num_nlos is in [1, RMNET_MAP_V5_MAX_NLOS].
+ *  - Total packet count does not exceed RMNET_MAP_V5_MAX_PACKETS.
+ *
+ * nlo_err_mask is NOT six independent per-NLO bitmaps. Each nl_pairs
+ * slot only has room for an 8 bit csum_error_bitmap, but a single NLO
+ * can carry more than 8 packets (up to RMNET_MAP_V5_MAX_PACKETS), so
+ * hardware spills a wide NLO's error bits into the csum_error_bitmap
+ * bytes of the following slots rather than truncating them. The
+ * six bitmap bytes are therefore always concatenated in slot order
+ * into one flat RMNET_MAP_V5_MAX_NLOS * 8 = RMNET_MAP_V5_MAX_PACKETS
+ * bit value, addressed by a packet's absolute position in the frame,
+ * regardless of how many NLOs are actually in use. Receivers must
+ * walk it as a single contiguous stream and must not expect it to
+ * align it at NLO boundaries.
+ */
+static int rmnet_map_data_check_coal_header(struct sk_buff *skb,
+					    u64 *nlo_err_mask)
+{
+	struct rmnet_map_header *maph = (struct rmnet_map_header *)skb->data;
+	struct rmnet_priv *priv = netdev_priv(skb->dev);
+	struct rmnet_map_v5_coal_header *coal_hdr;
+	u8 num_nlos, pkts = 0;
+	u64 mask = 0;
+	int i;
+
+	/* coal header is counted in pkt_len */
+	if (ntohs(maph->pkt_len) < sizeof(*coal_hdr)) {
+		priv->stats.coal_hdr_nlo_err++;
+		return -EINVAL;
+	}
+
+	coal_hdr = (struct rmnet_map_v5_coal_header *)(skb->data + sizeof(*maph));
+	num_nlos = u8_get_bits(coal_hdr->coal_info, MAPV5_COALINFO_NUM_NLOS_FMASK);
+
+	if (num_nlos == 0 || num_nlos > RMNET_MAP_V5_MAX_NLOS) {
+		priv->stats.coal_hdr_nlo_err++;
+		return -EINVAL;
 	}
 
-	/* Pull csum v5 header */
-	skb_pull(skb, sizeof(*next_hdr));
+	for (i = 0; i < RMNET_MAP_V5_MAX_NLOS; i++) {
+		u8 err = coal_hdr->nl_pairs[i].csum_error_bitmap;
+		u8 pkt = coal_hdr->nl_pairs[i].num_packets;
+
+		mask |= ((u64)err) << (8 * i);
+		pkts += pkt;
+		if (pkts > RMNET_MAP_V5_MAX_PACKETS) {
+			priv->stats.coal_hdr_pkt_err++;
+			return -EINVAL;
+		}
+	}
+
+	priv->stats.coal_pkts += pkts;
+	rmnet_map_data_log_close_stats(priv,
+				       u8_get_bits(coal_hdr->close_info,
+						   MAPV5_CLOSEINFO_CLOSE_TYPE_FMASK),
+				       u8_get_bits(coal_hdr->close_info,
+						   MAPV5_CLOSEINFO_CLOSE_VALUE_FMASK));
+
+	*nlo_err_mask = mask;
+	return 0;
+}
+
+int rmnet_map_process_next_hdr_packet(struct sk_buff *skb,
+				      struct sk_buff_head *list,
+				      u16 len, u32 data_format)
+{
+	struct rmnet_priv *priv = netdev_priv(skb->dev);
+	u64 nlo_err_mask;
+	int rc;
+
+	switch (rmnet_map_get_next_hdr_type(skb)) {
+	case RMNET_MAP_HEADER_TYPE_COALESCING:
+		if (!(data_format & RMNET_FLAGS_INGRESS_COALESCE))
+			return -EINVAL;
+
+		priv->stats.coal_rx++;
+		rc = rmnet_map_data_check_coal_header(skb, &nlo_err_mask);
+		if (rc)
+			return rc;
+
+		rc = rmnet_map_segment_coal_skb(skb, nlo_err_mask, list, len);
+		if (rc)
+			return rc;
+
+		if (skb_peek(list) != skb)
+			consume_skb(skb);
+		break;
+
+	case RMNET_MAP_HEADER_TYPE_CSUM_OFFLOAD:
+		if (unlikely(!(skb->dev->features & NETIF_F_RXCSUM))) {
+			priv->stats.csum_sw++;
+		} else if (rmnet_map_get_csum_valid(skb)) {
+			priv->stats.csum_ok++;
+			skb->ip_summed = CHECKSUM_UNNECESSARY;
+		} else {
+			priv->stats.csum_valid_unset++;
+		}
+
+		skb_pull(skb, sizeof(struct rmnet_map_header) +
+			      sizeof(struct rmnet_map_v5_csum_header));
+		skb_trim(skb, len);
+		__skb_queue_tail(list, skb);
+		break;
+
+	default:
+		return -EINVAL;
+	}
 
 	return 0;
 }
diff --git a/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c b/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c
index 5f921cddf82b4..a21d6543c014f 100644
--- a/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c
+++ b/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c
@@ -183,6 +183,26 @@ static const char rmnet_gstrings_stats[][ETH_GSTRING_LEN] = {
 	"Checksum skipped",
 	"Checksum computed in software",
 	"Checksum computed in hardware",
+	/* DL coalescing */
+	"Coal frames received",
+	"Packets in coal frames",
+	"Coal hdr NLO errors",
+	"Coal hdr pkt count errors",
+	"Coal checksum errors",
+	"Coal packets dropped on csum err",
+	"Coal segments reconstructed",
+	"Coal invalid IP version",
+	"Coal invalid transport",
+	/* close reasons */
+	"Coal closed: non-coal",
+	"Coal closed: IP miss",
+	"Coal closed: transport miss",
+	"Coal closed: hw NL limit",
+	"Coal closed: hw pkt limit",
+	"Coal closed: hw byte limit",
+	"Coal closed: hw time limit",
+	"Coal closed: hw evict",
+	"Coal closed: FIN/PSH",
 };
 
 static void rmnet_get_strings(struct net_device *dev, u32 stringset, u8 *buf)
@@ -323,6 +343,7 @@ int rmnet_vnd_newlink(u8 id, struct net_device *rmnet_dev,
 	rmnet_dev->hw_features = NETIF_F_RXCSUM;
 	rmnet_dev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
 	rmnet_dev->hw_features |= NETIF_F_SG;
+	rmnet_dev->hw_features |= NETIF_F_GRO_HW;
 
 	priv->real_dev = real_dev;
 
diff --git a/include/linux/if_rmnet.h b/include/linux/if_rmnet.h
index c44bf6e80ecb4..5df4d417f3d2c 100644
--- a/include/linux/if_rmnet.h
+++ b/include/linux/if_rmnet.h
@@ -70,5 +70,36 @@ struct rmnet_map_v5_csum_header {
 #define MAPV5_HDRINFO_HDR_TYPE_FMASK	GENMASK(7, 1)
 #define MAPV5_CSUMINFO_VALID_FLAG	BIT(7)
 
+#define RMNET_MAP_HEADER_TYPE_COALESCING   1
 #define RMNET_MAP_HEADER_TYPE_CSUM_OFFLOAD 2
+
+/* MAPv5 coalescing header */
+#define RMNET_MAP_V5_MAX_NLOS		6
+#define RMNET_MAP_V5_MAX_PACKETS	48
+
+/* One Number-Length Object pair: per-NLO packet count and length. */
+struct rmnet_map_v5_nl_pair {
+	__be16 pkt_len;
+	u8  csum_error_bitmap;
+	u8  num_packets;
+} __aligned(1);
+
+/* MAPv5 coalescing header: describes up to RMNET_MAP_V5_MAX_NLOS NLOs.
+ * The header immediately follows the MAP header in the frame and is
+ * included in the MAP pkt_len field.
+ */
+struct rmnet_map_v5_coal_header {
+	u8  header_info;	/* MAPV5_HDRINFO_NXT_HDR_FLAG, MAPV5_HDRINFO_HDR_TYPE_FMASK */
+	u8  coal_info;		/* MAPV5_COALINFO_* */
+	u8  close_info;		/* MAPV5_CLOSEINFO_* */
+	u8  veid_info;		/* MAPV5_VEIDINFO_* */
+	struct rmnet_map_v5_nl_pair nl_pairs[RMNET_MAP_V5_MAX_NLOS];
+} __aligned(1);
+
+#define MAPV5_COALINFO_NUM_NLOS_FMASK		GENMASK(6, 4)
+#define MAPV5_COALINFO_CSUM_VALID_FLAG		BIT(7)
+#define MAPV5_CLOSEINFO_CLOSE_TYPE_FMASK	GENMASK(3, 0)
+#define MAPV5_CLOSEINFO_CLOSE_VALUE_FMASK	GENMASK(7, 4)
+#define MAPV5_VEIDINFO_VEID_FMASK		GENMASK(3, 0)
+
 #endif /* !(_LINUX_IF_RMNET_H_) */
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 245b362045253..349fcddc6622f 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -2022,6 +2022,7 @@ enum {
 #define RMNET_FLAGS_EGRESS_MAP_CKSUMV4            (1U << 3)
 #define RMNET_FLAGS_INGRESS_MAP_CKSUMV5           (1U << 4)
 #define RMNET_FLAGS_EGRESS_MAP_CKSUMV5            (1U << 5)
+#define RMNET_FLAGS_INGRESS_COALESCE              (1U << 6)
 
 enum {
 	IFLA_RMNET_UNSPEC,

41/3 2026/10/01 02:25 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 18187
							output: 43
							thoughts: 807
						

Thoughts:
**Analyzing Potential Uninitialized Memory Risks in the RMNET Driver Patch**

Okay, so I need to assess this patch for potential uninitialized memory risks. My gut feeling tells me this hardware coalescing feature could introduce a vulnerability, so I need to be thorough. First, I’ll break down the changes. It looks like we're adding hardware coalescing support in the Qualcomm RMNET driver (`drivers/net/ethernet/qualcomm/rmnet/`), and the documentation (`rmnet.rst`) has been updated. The changes are spread across a bunch of files.

In `rmnet_config.c`, they've added `rmnet_config_data_format_valid`, and are checking the data format validity in `rmnet_newlink` and `rmnet_changelink`. They also added support for `RMNET_FLAGS_INGRESS_COALESCE`. `rmnet_config.h` includes new `coal_*` counters in `struct rmnet_priv_stats`. That's where it starts to get interesting. Any stats exposed to userspace always pique my interest.

`rmnet_handlers.c` has changes related to delivering a queue of SKBs. Specifically, `rmnet_deliver_skb_list`, `__rmnet_map_ingress_handler`, and it calls `rmnet_map_process_next_hdr_packet` while delivering the SKB list. `rmnet_map.h` has new enums and a signature update. Now, `rmnet_map_data.c` is where things are getting dense. We have a new `struct rmnet_map_coal_metadata` that includes pointers to IP and transport headers, lengths, offsets, and protocol information, and a packet count. There are also many functions dealing with packet validation, checksums, segmentation, and GRO. All those new functions and structs are making my alarm bells ring: `rmnet_map_validate_packet_len`, `rmnet_map_gso_stamp`, `rmnet_map_partial_csum`, `__rmnet_map_segment_coal_skb`, the coal-prefixed functions, etc. This is the place to look!

`rmnet_vnd.c` seems to add some string stats and a `NETIF_F_GRO_HW` flag. But the stats are the key. I need to understand how the stats are exposed. This is the place to check. And lastly, the header files have a bunch of new definitions related to the hardware coalescing: `struct rmnet_map_v5_nl_pair`, `struct rmnet_map_v5_coal_header`, etc., and the `RMNET_FLAGS_INGRESS_COALESCE` flag in `if_link.h`.

Okay, my main focus now is to see if any of these new structures or functions potentially read from uninitialized memory. Given the complexity of the changes – especially those dealing with packet processing and the new stats structure – I need to pay *very* close attention to data structure initialization and memory copying within those new coalescing-related functions. `rmnet_priv_stats` is the one to target!

I need to quickly inspect `rmnet_vnd.c` and understand how the stats are used and exposed. I’ll fire up `grepper` or `read-file` to zero in on this now! Then, if I see anything suspicious, I will launch a KMSAN fuzzing session to confirm and triage.



42/3 2026/10/01 02:25 tool grepper
0m Args:
{
  "Expression": "rmnet_get_ethtool_stats",
  "PathPrefix": "drivers/net/ethernet/qualcomm/rmnet/"
}

Results:
{
  "Output": "drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c=218=static int rmnet_get_sset_count(struct net_device *dev, int sset)\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c-227-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c:228:static void rmnet_get_ethtool_stats(struct net_device *dev,\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c-229-\t\t\t\t    struct ethtool_stats *stats, u64 *data)\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c=289=static const struct ethtool_ops rmnet_ethtool_ops = {\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c-292-\t.set_coalesce = rmnet_set_coalesce,\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c:293:\t.get_ethtool_stats = rmnet_get_ethtool_stats,\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c-294-\t.get_strings = rmnet_get_strings,\n"
}

43/3 2026/10/01 02:25 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 20128
							output: 47
							thoughts: 36
						

Thoughts:
Here's a summary of my mental walkthrough, assuming I'm an expert:

**Diving into `rmnet_vnd.c`**

Alright, let's zero in on `drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c`, specifically the region around lines 180 to 240. I expect this section to be handling vendor-specific aspects of the RMNET (Remote Medium Access Network) interface, likely dealing with some level of data channel management or control specific to Qualcomm hardware. Given the file name, it seems related to the RMNET Virtual Network Driver. I'm going to look for areas related to packet handling, potentially examining how the driver interacts with the underlying hardware, how it processes incoming and outgoing packets, or maybe how it handles flow control or QoS for vendor-specific interfaces. My initial expectation is that this segment will contain a mix of device-specific register manipulation, interrupt handling, or interactions with the data plane processing within the Qualcomm platform. I'll be particularly interested in whether it handles any unusual or non-standard RMNET extensions or how it's interfacing with modem-specific functionality.



44/3 2026/10/01 02:25 tool read-file
0m Args:
{
  "File": "drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c",
  "FirstLine": 180,
  "LineCount": 60
}

Results:
{
  "Contents": " 180:\t\t\"Checksum error bad ip version\",\n 181:\t\t\"Checksum error bad transport\",\n 182:\t\t\"Checksum skipped on ip fragment\",\n 183:\t\t\"Checksum skipped\",\n 184:\t\t\"Checksum computed in software\",\n 185:\t\t\"Checksum computed in hardware\",\n 186:\t\t/* DL coalescing */\n 187:\t\t\"Coal frames received\",\n 188:\t\t\"Packets in coal frames\",\n 189:\t\t\"Coal hdr NLO errors\",\n 190:\t\t\"Coal hdr pkt count errors\",\n 191:\t\t\"Coal checksum errors\",\n 192:\t\t\"Coal packets dropped on csum err\",\n 193:\t\t\"Coal segments reconstructed\",\n 194:\t\t\"Coal invalid IP version\",\n 195:\t\t\"Coal invalid transport\",\n 196:\t\t/* close reasons */\n 197:\t\t\"Coal closed: non-coal\",\n 198:\t\t\"Coal closed: IP miss\",\n 199:\t\t\"Coal closed: transport miss\",\n 200:\t\t\"Coal closed: hw NL limit\",\n 201:\t\t\"Coal closed: hw pkt limit\",\n 202:\t\t\"Coal closed: hw byte limit\",\n 203:\t\t\"Coal closed: hw time limit\",\n 204:\t\t\"Coal closed: hw evict\",\n 205:\t\t\"Coal closed: FIN/PSH\",\n 206:\t};\n 207:\t\n 208:\tstatic void rmnet_get_strings(struct net_device *dev, u32 stringset, u8 *buf)\n 209:\t{\n 210:\t\tswitch (stringset) {\n 211:\t\tcase ETH_SS_STATS:\n 212:\t\t\tmemcpy(buf, \u0026rmnet_gstrings_stats,\n 213:\t\t\t       sizeof(rmnet_gstrings_stats));\n 214:\t\t\tbreak;\n 215:\t\t}\n 216:\t}\n 217:\t\n 218:\tstatic int rmnet_get_sset_count(struct net_device *dev, int sset)\n 219:\t{\n 220:\t\tswitch (sset) {\n 221:\t\tcase ETH_SS_STATS:\n 222:\t\t\treturn ARRAY_SIZE(rmnet_gstrings_stats);\n 223:\t\tdefault:\n 224:\t\t\treturn -EOPNOTSUPP;\n 225:\t\t}\n 226:\t}\n 227:\t\n 228:\tstatic void rmnet_get_ethtool_stats(struct net_device *dev,\n 229:\t\t\t\t\t    struct ethtool_stats *stats, u64 *data)\n 230:\t{\n 231:\t\tstruct rmnet_priv *priv = netdev_priv(dev);\n 232:\t\tstruct rmnet_priv_stats *st = \u0026priv-\u003estats;\n 233:\t\n 234:\t\tif (!data)\n 235:\t\t\treturn;\n 236:\t\n 237:\t\tmemcpy(data, st, ARRAY_SIZE(rmnet_gstrings_stats) * sizeof(u64));\n 238:\t}\n 239:\t\n"
}

45/3 2026/10/01 02:25 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 21288
							output: 46
							thoughts: 116
						

Thoughts:
**Analyzing the Ethernet Statistics Retrieval**

Okay, let's dive into this `rmnet_get_ethtool_stats` function. I see a `memcpy` call here, which immediately catches my attention. The code is copying data from `st` to `data` using `memcpy`. My initial thought is about the efficiency of this copy. The second argument is `st`, which appears to be a pointer to stats, and the third argument looks like it is to do with the size of the copy. This raises a red flag. I need to understand what those values are.

Specifically, I need to know how many fields are in `struct rmnet_priv_stats`, because that will indicate the data that is being copied. I also need to verify what `ARRAY_SIZE(rmnet_gstrings_stats)` actually evaluates to. I need to be sure that the copy is correctly sized. I'll need to check the definition of `struct rmnet_priv_stats` to verify, to ensure the copy is complete. I'll head over to `drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h` to confirm the structure and field sizes. I need to be sure the data is properly aligned.



46/3 2026/10/01 02:25 tool read-file
0m Args:
{
  "File": "drivers/net/ethernet/qualcomm/rmnet/rmnet_config.h",
  "FirstLine": 40,
  "LineCount": 70
}

Results:
{
  "Contents": "  40:\t\tstruct net_device *rmnet_dev;\n  41:\t\n  42:\t\t/* Egress aggregation information */\n  43:\t\tstruct rmnet_egress_agg_params egress_agg_params;\n  44:\t\t/* Protect aggregation related elements */\n  45:\t\tspinlock_t agg_lock;\n  46:\t\tstruct sk_buff *skbagg_head;\n  47:\t\tstruct sk_buff *skbagg_tail;\n  48:\t\tint agg_state;\n  49:\t\tu8 agg_count;\n  50:\t\tstruct timespec64 agg_time;\n  51:\t\tstruct timespec64 agg_last;\n  52:\t\tstruct hrtimer hrtimer;\n  53:\t\tstruct work_struct agg_wq;\n  54:\t};\n  55:\t\n  56:\textern struct rtnl_link_ops rmnet_link_ops;\n  57:\t\n  58:\tstruct rmnet_vnd_stats {\n  59:\t\tu64 rx_pkts;\n  60:\t\tu64 rx_bytes;\n  61:\t\tu64 tx_pkts;\n  62:\t\tu64 tx_bytes;\n  63:\t\tu32 tx_drops;\n  64:\t};\n  65:\t\n  66:\tstruct rmnet_pcpu_stats {\n  67:\t\tstruct rmnet_vnd_stats stats;\n  68:\t\tstruct u64_stats_sync syncp;\n  69:\t};\n  70:\t\n  71:\tstruct rmnet_priv_stats {\n  72:\t\tu64 csum_ok;\n  73:\t\tu64 csum_ip4_header_bad;\n  74:\t\tu64 csum_valid_unset;\n  75:\t\tu64 csum_validation_failed;\n  76:\t\tu64 csum_err_bad_buffer;\n  77:\t\tu64 csum_err_invalid_ip_version;\n  78:\t\tu64 csum_err_invalid_transport;\n  79:\t\tu64 csum_fragmented_pkt;\n  80:\t\tu64 csum_skipped;\n  81:\t\tu64 csum_sw;\n  82:\t\tu64 csum_hw;\n  83:\t\t/* DL coalescing */\n  84:\t\tu64 coal_rx;\n  85:\t\tu64 coal_pkts;\n  86:\t\tu64 coal_hdr_nlo_err;\n  87:\t\tu64 coal_hdr_pkt_err;\n  88:\t\tu64 coal_csum_err;\n  89:\t\tu64 coal_csum_drop;\n  90:\t\tu64 coal_reconstruct;\n  91:\t\tu64 coal_ip_invalid;\n  92:\t\tu64 coal_trans_invalid;\n  93:\t\t/* close-reason sub-counters */\n  94:\t\tu64 coal_close_non_coal;\n  95:\t\tu64 coal_close_ip_miss;\n  96:\t\tu64 coal_close_trans_miss;\n  97:\t\tu64 coal_close_hw_nl;\n  98:\t\tu64 coal_close_hw_pkt;\n  99:\t\tu64 coal_close_hw_byte;\n 100:\t\tu64 coal_close_hw_time;\n 101:\t\tu64 coal_close_hw_evict;\n 102:\t\tu64 coal_close_coal;\n 103:\t};\n 104:\t\n 105:\tstruct rmnet_priv {\n 106:\t\tu8 mux_id;\n 107:\t\tstruct net_device *real_dev;\n 108:\t\tstruct rmnet_pcpu_stats __percpu *pcpu_stats;\n 109:\t\tstruct gro_cells gro_cells;\n"
}

47/3 2026/10/01 02:25 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 22724
							output: 47
							thoughts: 35
						

Thoughts:
Okay, let's dive into this. Here's how I'd approach that snippet of code, assuming I'm already pretty familiar with the RMNET driver and Qualcomm's networking implementation:

**Diving into RMNET GSTRING Stats**

Right, let's take a look at `rmnet_gstrings_stats`. I need to figure out how they are implemented, I'll go directly to the source code, diving into `drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c`. That's likely the right place to find the implementation, or at least the registration of this particular statistic. My goal is to understand how these gstrings are being collected, what sort of data they are representing, and how the statistics are being handled overall within the RMNET framework. My experience with this likely helps me avoid getting lost in the broader system and go directly to the relevant piece of code. I'm going to look for the declaration and usage of the function. I expect to find some indication of the data structures involved, and the mechanisms for gathering the statistical data. It is possible that this function call is tied into the hardware's counters, which I'll be keeping an eye out for. Time to go spelunking!



48/3 2026/10/01 02:25 tool read-file
0m Args:
{
  "File": "drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c",
  "FirstLine": 170,
  "LineCount": 40
}

Results:
{
  "Contents": " 170:\t\t.ndo_uninit     = rmnet_vnd_uninit,\n 171:\t\t.ndo_get_stats64 = rmnet_get_stats64,\n 172:\t};\n 173:\t\n 174:\tstatic const char rmnet_gstrings_stats[][ETH_GSTRING_LEN] = {\n 175:\t\t\"Checksum ok\",\n 176:\t\t\"Bad IPv4 header checksum\",\n 177:\t\t\"Checksum valid bit not set\",\n 178:\t\t\"Checksum validation failed\",\n 179:\t\t\"Checksum error bad buffer\",\n 180:\t\t\"Checksum error bad ip version\",\n 181:\t\t\"Checksum error bad transport\",\n 182:\t\t\"Checksum skipped on ip fragment\",\n 183:\t\t\"Checksum skipped\",\n 184:\t\t\"Checksum computed in software\",\n 185:\t\t\"Checksum computed in hardware\",\n 186:\t\t/* DL coalescing */\n 187:\t\t\"Coal frames received\",\n 188:\t\t\"Packets in coal frames\",\n 189:\t\t\"Coal hdr NLO errors\",\n 190:\t\t\"Coal hdr pkt count errors\",\n 191:\t\t\"Coal checksum errors\",\n 192:\t\t\"Coal packets dropped on csum err\",\n 193:\t\t\"Coal segments reconstructed\",\n 194:\t\t\"Coal invalid IP version\",\n 195:\t\t\"Coal invalid transport\",\n 196:\t\t/* close reasons */\n 197:\t\t\"Coal closed: non-coal\",\n 198:\t\t\"Coal closed: IP miss\",\n 199:\t\t\"Coal closed: transport miss\",\n 200:\t\t\"Coal closed: hw NL limit\",\n 201:\t\t\"Coal closed: hw pkt limit\",\n 202:\t\t\"Coal closed: hw byte limit\",\n 203:\t\t\"Coal closed: hw time limit\",\n 204:\t\t\"Coal closed: hw evict\",\n 205:\t\t\"Coal closed: FIN/PSH\",\n 206:\t};\n 207:\t\n 208:\tstatic void rmnet_get_strings(struct net_device *dev, u32 stringset, u8 *buf)\n 209:\t{\n"
}

49/3 2026/10/01 02:25 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 23649
							output: 37
							thoughts: 757
						

Thoughts:
**Analyzing RMNet Statistics: A Deep Dive**

Okay, let's break this down systematically. My immediate thought is to enumerate the strings used for `rmnet_gstrings_stats`. I count them, carefully: one, two, three… twenty-nine!  Interesting.  Now, the plan is to compare this with the fields in the `struct rmnet_priv_stats`.  Let's see: `csum_ok`, `csum_ip4_header_bad`... Right, down the list, and, yes, there are exactly 29 u64 fields. Perfect! A clean correspondence.  

Next, the allocation of `priv`. I need to confirm where `priv` comes from, specifically, that `netdev_priv(dev)` is allocated, and importantly, is zero-initialized when the net device is allocated. I'll need to double-check `rmnet_vnd.c` for that allocation.  My assumption is these strings likely correlate to those stats within the `struct`, right? Seems pretty reasonable, the mapping being exact like this.



50/3 2026/10/01 02:25 tool grepper
0m Error:
no matches

Args:
{
  "Expression": "alloc_netdev",
  "PathPrefix": "drivers/net/ethernet/qualcomm/rmnet/"
}

Results:
{
  "error": "no matches"
}

51/3 2026/10/01 02:25 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 24689
							output: 36
							thoughts: 27
						

Thoughts:
Here's a breakdown of my thought process regarding the allocation of `priv`, presented from my expert perspective:

**Diving into Network Device Driver Initialization**

Okay, so I'm focusing on the allocation of the private data (`priv`) within the context of network device driver initialization, specifically looking at `rmnet_vnd_newlink` or the broader `rtnl_link_ops` mechanism. I need to understand how these functions, or more generally, how the networking stack, handles memory management for driver-specific state. It's crucial for understanding driver design, memory usage, potential bottlenecks, and, of course, troubleshooting.

My initial line of inquiry starts with `rmnet_vnd_newlink` (or its equivalent in other drivers) because this is typically where a new virtual link is created, and logically, where the driver's private data structure would be initialized. If I don't find it there, I'll need to look at the broader `rtnl_link_ops` structure and the corresponding `ndo_init` or equivalent net_device initialization code. I need to trace this sequence to understand the allocation strategy: is it a `kmalloc`? `kzalloc`? Is it slab allocated? Is it using a custom allocator? Is this related to `net_device` struct? I'll probably be looking for a call to a memory allocation function.

I want to see *where* this `priv` is being assigned to the `net_device` structure and what considerations they had in place. This will give me clues about the expected size of `priv`, if the driver performs any dynamic sizing based on configuration, and how the driver handles potential allocation failures. I'll need to pay close attention to error handling – how the driver gracefully fails if the memory allocation goes wrong and how it frees the allocated memory when the interface is brought down or removed.

I'll be mindful of the surrounding code. Is this allocation done under a lock? If so, what kind of lock? What are the implications for concurrency and performance? I know some drivers have specific locking strategies for device initialization to avoid race conditions.

Finally, I'll keep an eye out for any memory leaks. A well-designed driver should always deallocate its private data when the device is unregistered or removed. I’ll look for the corresponding cleanup functions, usually called during device de-registration. Seeing the *entire* lifecycle will really give me the context I need.



52/3 2026/10/01 02:25 tool grepper
0m Args:
{
  "Expression": "priv_size",
  "PathPrefix": "drivers/net/ethernet/qualcomm/rmnet/"
}

Results:
{
  "Output": "drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c=438=struct rtnl_link_ops rmnet_link_ops __read_mostly = {\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-440-\t.maxtype\t= IFLA_RMNET_MAX,\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:441:\t.priv_size\t= sizeof(struct rmnet_priv),\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-442-\t.setup\t\t= rmnet_vnd_setup,\n"
}

53/3 2026/10/01 02:25 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 25442
							output: 42
							thoughts: 1648
						

Thoughts:
**Analyzing the Packet Processing Path**

Okay, so `priv_size` is initialized with `kzalloc` via `alloc_netdev_mqs` called by `rtnl_link_ops`. This means both `priv` and `priv->stats` are zeroed out. That's good to know, no surprises there.

Now, let's dive into the packet processing code. I need to understand this data path thoroughly. I'll focus on these functions: `__rmnet_map_ingress_handler`, `rmnet_map_process_next_hdr_packet`, `rmnet_map_data_check_coal_header`, `rmnet_map_segment_coal_skb`, `rmnet_map_coal_gro_fast_path`, `rmnet_map_coal_segment_loop`, `__rmnet_map_segment_coal_skb`, `rmnet_map_coal_parse_ip_hdr`, `rmnet_map_coal_parse_trans_hdr`, `rmnet_map_coal_validate_bounds`, `rmnet_map_gso_stamp`, `rmnet_map_partial_csum`, `rmnet_map_v5_fixup_num_nlos`, and `rmnet_map_v5_csum_fixup`. That's a lot, but a systematic approach is key here.

Let's start with `__rmnet_map_segment_coal_skb`. This seems central to the reassembly logic. Reading through it, I see:

1.  A check for checksum validity. If invalid, and it's a UDP with a zero checksum, it's considered valid. Okay, makes sense - RFC 768. I also see a counter `priv->stats.coal_csum_drop` that increments.
2.  An allocation: `alloc_skb(hlen + dlen + RMNET_MAP_DEAGGR_HEADROOM, GFP_ATOMIC);` This is where I need to pay close attention. `alloc_skb` doesn't zero the buffer, but the code proceeds with `skb_reserve`. Then `skb_put_data` is used.

Here's the critical question: Does the code *fully* initialize the data buffer? `skb_put_data` copies `dlen` bytes from the `coal_skb` to the new `skbn`. Then, the code pushes and copies the transport and IP headers using `skb_push` and `memcpy`. So every byte of the payload `hlen+dlen` should be initialized via `memcpy` or `skb_put_data`. Headroom is handled separately, and it's not part of the data being evaluated.

Wait a second, there's a potential vulnerability here. What if `coal_skb` is non-linear or truncated? Does the code properly handle those cases? This could lead to a read out of bounds. This requires more investigation.

Okay, I need to understand the path *before* `__rmnet_map_ingress_handler`. Let's search for the callers of this function to trace the entire flow. This is crucial for fully understanding the security implications of this function.



54/3 2026/10/01 02:26 tool grepper
0m Args:
{
  "Expression": "__rmnet_map_ingress_handler",
  "PathPrefix": "drivers/net/ethernet/qualcomm/rmnet/"
}

Results:
{
  "Output": "drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c=65=static void\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c:66:__rmnet_map_ingress_handler(struct sk_buff *skb,\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c-67-\t\t\t    struct rmnet_port *port,\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c=123=rmnet_map_ingress_handler(struct sk_buff *skb,\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c-141-\t\twhile ((skbn = rmnet_map_deaggregate(skb, data_format)) != NULL)\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c:142:\t\t\t__rmnet_map_ingress_handler(skbn, port, data_format);\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c-143-\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c-146-\t\tif (rmnet_map_validate_packet_len(skb, data_format))\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c:147:\t\t\t__rmnet_map_ingress_handler(skb, port, data_format);\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c-148-\t\telse\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c=917=static void rmnet_map_coal_segment_loop(struct sk_buff *coal_skb,\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c-978-/* Expand a coalesced SKB into individual IP packets placed on the list.\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c:979: * NLOs with checksum errors are dropped. __rmnet_map_ingress_handler will\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c-980- * free the SKB in the error case.\n"
}

55/3 2026/10/01 02:26 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 28414
							output: 47
							thoughts: 32
						

Thoughts:
Okay, let's dive into this. Here's how I'd approach that prompt, keeping in mind my field of expertise:

**Diving into RMNET Handler Details**

Alright, I'm thinking I need to refresh my memory on how this RMNET ingress and egress handling works, specifically focusing on how data is received and managed. I'm going to jump into `rmnet_handlers.c` and take a closer look at the key functions here. Let's start with `rmnet_map_ingress_handler`, to see how incoming data gets processed and mapped. After that, I will also analyze `rmnet_rx_handler` to understand how the received data from the ingress handler are handled and forwarded. I know they're critical for understanding how packets are routed and managed within the RMNET framework, so I want to solidify my mental picture of their specific responsibilities and how they work in conjunction with each other. This should give me a better handle on the overall data flow.



56/3 2026/10/01 02:26 tool read-file
0m Args:
{
  "File": "drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c",
  "FirstLine": 115,
  "LineCount": 70
}

Results:
{
  "Contents": " 115:\t\trmnet_deliver_skb_list(\u0026list);\n 116:\t\treturn;\n 117:\t\n 118:\tfree_skb:\n 119:\t\tkfree_skb(skb);\n 120:\t}\n 121:\t\n 122:\tstatic void\n 123:\trmnet_map_ingress_handler(struct sk_buff *skb,\n 124:\t\t\t\t  struct rmnet_port *port)\n 125:\t{\n 126:\t\tstruct sk_buff *skbn;\n 127:\t\tu32 data_format;\n 128:\t\n 129:\t\tif (skb-\u003edev-\u003etype == ARPHRD_ETHER) {\n 130:\t\t\tif (pskb_expand_head(skb, ETH_HLEN, 0, GFP_ATOMIC)) {\n 131:\t\t\t\tkfree_skb(skb);\n 132:\t\t\t\treturn;\n 133:\t\t\t}\n 134:\t\n 135:\t\t\tskb_push(skb, ETH_HLEN);\n 136:\t\t}\n 137:\t\n 138:\t\tdata_format = READ_ONCE(port-\u003edata_format);\n 139:\t\n 140:\t\tif (data_format \u0026 RMNET_FLAGS_INGRESS_DEAGGREGATION) {\n 141:\t\t\twhile ((skbn = rmnet_map_deaggregate(skb, data_format)) != NULL)\n 142:\t\t\t\t__rmnet_map_ingress_handler(skbn, port, data_format);\n 143:\t\n 144:\t\t\tconsume_skb(skb);\n 145:\t\t} else {\n 146:\t\t\tif (rmnet_map_validate_packet_len(skb, data_format))\n 147:\t\t\t\t__rmnet_map_ingress_handler(skb, port, data_format);\n 148:\t\t\telse\n 149:\t\t\t\tkfree_skb(skb);\n 150:\t\t}\n 151:\t}\n 152:\t\n 153:\tstatic int rmnet_map_egress_handler(struct sk_buff *skb,\n 154:\t\t\t\t\t    struct rmnet_port *port, u8 mux_id,\n 155:\t\t\t\t\t    struct net_device *orig_dev)\n 156:\t{\n 157:\t\tint required_headroom, additional_header_len, csum_type = 0;\n 158:\t\tstruct rmnet_map_header *map_header;\n 159:\t\tu32 data_format;\n 160:\t\n 161:\t\tadditional_header_len = 0;\n 162:\t\trequired_headroom = sizeof(struct rmnet_map_header);\n 163:\t\n 164:\t\tdata_format = READ_ONCE(port-\u003edata_format);\n 165:\t\tif (data_format \u0026 RMNET_FLAGS_EGRESS_MAP_CKSUMV4) {\n 166:\t\t\tadditional_header_len = sizeof(struct rmnet_map_ul_csum_header);\n 167:\t\t\tcsum_type = RMNET_FLAGS_EGRESS_MAP_CKSUMV4;\n 168:\t\t} else if (data_format \u0026 RMNET_FLAGS_EGRESS_MAP_CKSUMV5) {\n 169:\t\t\tadditional_header_len = sizeof(struct rmnet_map_v5_csum_header);\n 170:\t\t\tcsum_type = RMNET_FLAGS_EGRESS_MAP_CKSUMV5;\n 171:\t\t}\n 172:\t\n 173:\t\trequired_headroom += additional_header_len;\n 174:\t\n 175:\t\tif (skb_cow_head(skb, required_headroom) \u003c 0)\n 176:\t\t\treturn -ENOMEM;\n 177:\t\n 178:\t\tif (csum_type)\n 179:\t\t\trmnet_map_checksum_uplink_packet(skb, port, orig_dev,\n 180:\t\t\t\t\t\t\t csum_type);\n 181:\t\n 182:\t\tmap_header = rmnet_map_add_map_header(skb, additional_header_len,\n 183:\t\t\t\t\t\t      data_format, 0);\n 184:\t\tif (!map_header)\n"
}

57/3 2026/10/01 02:26 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 29853
							output: 40
							thoughts: 38
						

Thoughts:
Okay, let's break this down.

**Investigating the `skb` Creation in `rmnet_map_deaggregate`**

Alright, so I'm diving into the `rmnet_map_deaggregate` function. My initial question is: where and how exactly is the `skb` (socket buffer) being created within this specific function? To answer that, I need to get into the weeds, and specifically, I'm going to consult `rmnet_map_data.c`, since this seems like the most likely place the socket buffer logic is located for rmnet data handling. I'm assuming that the creation, allocation, or population of `skb`s is directly related to the data structures or methods defined in that particular file.



58/3 2026/10/01 02:26 tool grepper
0m Args:
{
  "Expression": "rmnet_map_deaggregate",
  "PathPrefix": "drivers/net/ethernet/qualcomm/rmnet/"
}

Results:
{
  "Output": "drivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c=123=rmnet_map_ingress_handler(struct sk_buff *skb,\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c-140-\tif (data_format \u0026 RMNET_FLAGS_INGRESS_DEAGGREGATION) {\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c:141:\t\twhile ((skbn = rmnet_map_deaggregate(skb, data_format)) != NULL)\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_handlers.c-142-\t\t\t__rmnet_map_ingress_handler(skbn, port, data_format);\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_map.h=42=enum rmnet_map_commands {\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_map.h-58-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_map.h:59:struct sk_buff *rmnet_map_deaggregate(struct sk_buff *skb,\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_map.h-60-\t\t\t\t      u32 data_format);\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c=353=u32 rmnet_map_validate_packet_len(struct sk_buff *skb, u32 data_format)\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c-403- */\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c:404:struct sk_buff *rmnet_map_deaggregate(struct sk_buff *skb,\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c-405-\t\t\t\t      u32 data_format)\n"
}

59/3 2026/10/01 02:26 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 30599
							output: 49
							thoughts: 24
						

Thoughts:
Okay, let's dive into this. Here's my take on those thoughts, as if they're my own:

**Analyzing `rmnet_map_deaggregate` in `rmnet_map_data.c`**

Alright, time to get my hands dirty. My instinct is telling me we need to dissect the `rmnet_map_deaggregate` function, specifically within the `rmnet_map_data.c` file. I'm already visualizing the likely challenges: deaggregation is usually where you encounter the messy details. I suspect we're likely dealing with fragmented data here, which means we have to reassemble packets, handle potential header mismatches, and probably manage some sort of buffering. I expect there might be some intricate pointer arithmetic or memory management tricks in there. Let's see if my suspicions are correct. This will require careful attention to detail, but this is a critical function, so there is no time to waste. I am ready. Let's start.



60/3 2026/10/01 02:26 tool read-file
0m Args:
{
  "File": "drivers/net/ethernet/qualcomm/rmnet/rmnet_map_data.c",
  "FirstLine": 404,
  "LineCount": 45
}

Results:
{
  "Contents": " 404:\tstruct sk_buff *rmnet_map_deaggregate(struct sk_buff *skb,\n 405:\t\t\t\t\t      u32 data_format)\n 406:\t{\n 407:\t\tstruct sk_buff *skbn;\n 408:\t\tu32 packet_len;\n 409:\t\n 410:\t\tpacket_len = rmnet_map_validate_packet_len(skb, data_format);\n 411:\t\tif (!packet_len)\n 412:\t\t\treturn NULL;\n 413:\t\n 414:\t\tskbn = alloc_skb(packet_len + RMNET_MAP_DEAGGR_SPACING, GFP_ATOMIC);\n 415:\t\tif (!skbn)\n 416:\t\t\treturn NULL;\n 417:\t\n 418:\t\tskbn-\u003edev = skb-\u003edev;\n 419:\t\tskb_reserve(skbn, RMNET_MAP_DEAGGR_HEADROOM);\n 420:\t\tskb_put(skbn, packet_len);\n 421:\t\tmemcpy(skbn-\u003edata, skb-\u003edata, packet_len);\n 422:\t\tskb_pull(skb, packet_len);\n 423:\t\n 424:\t\treturn skbn;\n 425:\t}\n 426:\t\n 427:\t/* Validates packet checksums. Function takes a pointer to\n 428:\t * the beginning of a buffer which contains the IP payload +\n 429:\t * padding + checksum trailer.\n 430:\t * Only IPv4 and IPv6 are supported along with TCP \u0026 UDP.\n 431:\t * Fragmented or tunneled packets are not supported.\n 432:\t */\n 433:\tint rmnet_map_checksum_downlink_packet(struct sk_buff *skb, u16 len)\n 434:\t{\n 435:\t\tstruct rmnet_priv *priv = netdev_priv(skb-\u003edev);\n 436:\t\tstruct rmnet_map_dl_csum_trailer *csum_trailer;\n 437:\t\n 438:\t\tif (unlikely(!(skb-\u003edev-\u003efeatures \u0026 NETIF_F_RXCSUM))) {\n 439:\t\t\tpriv-\u003estats.csum_sw++;\n 440:\t\t\treturn -EOPNOTSUPP;\n 441:\t\t}\n 442:\t\n 443:\t\tcsum_trailer = (struct rmnet_map_dl_csum_trailer *)(skb-\u003edata + len);\n 444:\t\n 445:\t\tif (!(csum_trailer-\u003eflags \u0026 MAP_CSUM_DL_VALID_FLAG)) {\n 446:\t\t\tpriv-\u003estats.csum_valid_unset++;\n 447:\t\t\treturn -EINVAL;\n 448:\t\t}\n"
}

61/3 2026/10/01 02:26 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 31623
							output: 39
							thoughts: 2521
						

Thoughts:
**Analyzing Potential KMSAN Issues in RMNET Code**

Okay, let's break down this RMNET code and see if there are any KMSAN (Kernel Memory Sanitizer) concerns, especially focusing on uninitialized memory reads or information leaks to userspace.

First, I examined `rmnet_map_validate_packet_len` in `rmnet_map_data.c`. This function validates the length of RMNET MAP packets, considering different header types (v4 checksum, v5 checksum, coalescing). The key here is ensuring packet lengths are correctly calculated, particularly when handling optional headers like the checksum or coalescing headers, which can be in a special `next_hdr` field. The documentation clearly states the `coal_header` is counted in `pkt_len`. While there were checks, especially around the coalescing header, the logic seemed sound in terms of calculating `packet_len`.

Next, I looked at how coalesced packets are segmented using `rmnet_map_segment_coal_skb`. This function pulls the RMNET and Coalesced headers from the SKB and trims the SKB to the correct `len`. It's crucial here to ensure the `len` argument passed to this function is accurate.

That's when I dug further into `__rmnet_map_ingress_handler`, which handles incoming packets. Here, the critical area is how `len` (the packet length) is determined: `len = ntohs(map_header->pkt_len) - pad;`. I became concerned about the potential for integer underflow if the `pad` field (padding length) is greater than `ntohs(map_header->pkt_len)`. However, the code does check for this using `rmnet_map_data_check_coal_header`. So underflow should not happen.

The key question is if there can be any uninitialized memory. KMSAN's goal is to detect memory reads of UNINITIALIZED memory, or kernel-to-user memory info-leaks.

I then started going through the KMSAN requirements to check for potential KMSAN issues. I checked whether kernel structures are 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.

I focused on the `rmnet_get_ethtool_stats` function in `rmnet_vnd.c`, which copies statistics data to user space via the ethtool interface. The critical point is whether the `priv->stats` structure is fully initialized. After tracing `priv`'s allocation via `alloc_netdev_mqs`, it is initialized to zero using `kzalloc`. The statistics struct is only initialized via `rmnet_get_ethtool_stats`. The `ARRAY_SIZE` and `sizeof` calls look correct, and there's no padding. So the entire stats struct is fully initialized.

I then looked for other potential areas, like netlink operations. Based on initial review of `rmnet_config.c`, I need to check `rmnet_changelink` and `rmnet_newlink` and whether they leak potentially uninitialized data.

Overall, I'm not seeing any *obvious* KMSAN violations at this point. The padding and length calculations appear handled correctly, and the structures copied to user space seem fully initialized.



62/3 2026/10/01 02:26 tool grepper
0m Args:
{
  "Expression": "rmnet_fill_info",
  "PathPrefix": "drivers/net/ethernet/qualcomm/rmnet/"
}

Results:
{
  "Output": "drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c=407=static size_t rmnet_get_size(const struct net_device *dev)\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-415-\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:416:static int rmnet_fill_info(struct sk_buff *skb, const struct net_device *dev)\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-417-{\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c=438=struct rtnl_link_ops rmnet_link_ops __read_mostly = {\n--\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-448-\t.policy\t\t= rmnet_policy,\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c:449:\t.fill_info\t= rmnet_fill_info,\ndrivers/net/ethernet/qualcomm/rmnet/rmnet_config.c-450-};\n"
}

63/3 2026/10/01 02:26 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 35221
							output: 47
							thoughts: 21
						

Thoughts:
Here's a summary of my thought process:

**Diving into RMNET Configuration**

Okay, let's drill down into this. I need to understand how RMNET information is populated, and the `rmnet_fill_info` function in `rmnet_config.c` is the logical place to start. This function almost certainly handles the crucial task of gathering and organizing the necessary data for RMNET configuration. I'm hoping I can glean insights into the data structures used, the sources of information (e.g., hardware registers, NVRAM, user input), and the overall logic of the configuration process from examining this function. My deep dive begins now.



64/3 2026/10/01 02:26 tool read-file
0m Args:
{
  "File": "drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c",
  "FirstLine": 415,
  "LineCount": 25
}

Results:
{
  "Contents": " 415:\t\n 416:\tstatic int rmnet_fill_info(struct sk_buff *skb, const struct net_device *dev)\n 417:\t{\n 418:\t\tconst struct rmnet_priv *priv = netdev_priv(dev);\n 419:\t\tconst struct rmnet_port *port;\n 420:\t\tstruct ifla_rmnet_flags f;\n 421:\t\n 422:\t\tif (nla_put_u16(skb, IFLA_RMNET_MUX_ID, READ_ONCE(priv-\u003emux_id)))\n 423:\t\t\treturn -EMSGSIZE;\n 424:\t\n 425:\t\trcu_read_lock();\n 426:\t\tport = rmnet_get_port_rcu(priv-\u003ereal_dev);\n 427:\t\tf.flags = port ? READ_ONCE(port-\u003edata_format) : 0;\n 428:\t\trcu_read_unlock();\n 429:\t\n 430:\t\tf.mask  = ~0;\n 431:\t\n 432:\t\tif (nla_put(skb, IFLA_RMNET_FLAGS, sizeof(f), \u0026f))\n 433:\t\t\treturn -EMSGSIZE;\n 434:\t\n 435:\t\treturn 0;\n 436:\t}\n 437:\t\n 438:\tstruct rtnl_link_ops rmnet_link_ops __read_mostly = {\n 439:\t\t.kind\t\t= \"rmnet\",\n"
}

65/3 2026/10/01 02:26 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 35846
							output: 34
							thoughts: 3524
						

Thoughts:
**Analysis of Potential Uninitialized Data in RMNET Coalesced SKBs**

Okay, let's break this down systematically. My primary concern is the possibility of uninitialized data leaking from the RMNET coalescing process, potentially via segmented SKBs, and exposing it to user-space.  The `rmnet_fill_info` function wasn't touched, and `f.flags` and `f.mask` in `struct ifla_rmnet_flags` are correctly set. This part is clear.

My investigation focuses on `__rmnet_map_segment_coal_skb`. The key here is how the new SKBs are constructed from coalesced data. The data source appears to be `coal_skb->data`, and is placed using `skb_put_data`. The code carefully calculates the data length (`dlen`), IP header length (`hlen`), transport header length, and various offsets. The crucial step is verifying whether the source data (`coal_skb->data`) is fully initialized, and that access to `coal_skb->data` does not go out of bounds.

The function `rmnet_map_coal_validate_bounds` checks the bounds of `coal_skb->data`, but does so based on the header's contents, and the length of the new SKB. This is my key concern: If the bounds checks are bypassed or contain some logic error, then `skb_put_data` could attempt an out-of-bounds read. This could lead to a KASAN (Kernel Address Sanitizer) detection. But `coal_skb->data` comes from a network packet, and is considered initialized in a standard networking scenario, so the code is probably correct.

Next, I checked how `coal_meta` is initialized: it's zeroed with `memset`. So, no worries there. Then, looking into `rmnet_map_coal_parse_ip_hdr`, all fields of `meta` are set properly within the function. Same case in `rmnet_map_coal_parse_trans_hdr`. No surprises there.

The function `rmnet_map_v5_fixup_num_nlos` seems okay, but then I looked at the code that deals with `coal_hdr` inside `rmnet_map_segment_coal_skb`. First, `skb_pull` is used to skip the `struct rmnet_map_header`, then `skb_trim` truncates the SKB to `len`, and `coal_hdr` is defined as a pointer to the start of the `coal_skb->data` after these operations.

I then verified whether the size of `coal_hdr` is smaller than the remaining bytes in `coal_skb->len`. This check is performed using `rmnet_map_data_check_coal_header`, which contains a check that prevents out-of-bounds reads into `coal_skb->data`. This prevents a potential KASAN hit.

I looked at the initialization of `struct rmnet_map_v5_coal_header`. Again, I made sure that the fields are set correctly, and the code also checks `*nlo_err_mask` is initialized.

`struct sk_buff_head list` is initialized with `__skb_queue_head_init(&list);`. I'm going to look at that function to check how it's initialized, to be fully certain.

Then, there's `gro`. It is initialized using `coal_skb->dev->features`, and it is being used to determine the path used in the rest of the code, so that is okay.

Finally, I checked the initialization of `frag_off` and `protocol`, which are used in `rmnet_map_coal_parse_ip_hdr`. The code is correctly using `ip6h->nexthdr` to initialize `protocol`, which seems safe, and the function `ipv6_skip_exthdr` initializes `frag_off`. I'm going to look at the implementation of `ipv6_skip_exthdr` to be 100% sure that it does what it is supposed to.

In conclusion, after a thorough review of the code and checking potential vulnerabilities that might lead to an out-of-bounds read and leakage of uninitialized data, I am confident that the code is well-structured and safe.



66/3 2026/10/01 02:27 tool grepper
0m Args:
{
  "Expression": "int ipv6_skip_exthdr",
  "PathPrefix": "net/ipv6/"
}

Results:
{
  "Output": "net/ipv6/exthdrs_core.c=25=EXPORT_SYMBOL(ipv6_ext_hdr);\n--\nnet/ipv6/exthdrs_core.c-71-\nnet/ipv6/exthdrs_core.c:72:int ipv6_skip_exthdr(const struct sk_buff *skb, int start, u8 *nexthdrp,\nnet/ipv6/exthdrs_core.c-73-\t\t     __be16 *frag_offp)\n"
}

67/3 2026/10/01 02:27 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 40490
							output: 40
							thoughts: 30
						

Thoughts:
Okay, here's my take on those thoughts, tailored for an expert audience:

**Examining `ipv6_skip_exthdr` in `exthdrs_core.c`**

Alright, let's dive into this. My initial thought process here is to zero in on `ipv6_skip_exthdr` within `net/ipv6/exthdrs_core.c`. This function is fundamental to how the IPv6 stack handles extension headers, specifically the skipping or parsing of them. I'm immediately interested in understanding how it's implemented. I'll be looking for how it determines which headers to skip, how it interacts with the lower layers, and any potential areas of concern regarding performance or security. I'll probably be focusing on the function's logic flow, how it manages the `frag_off`, and any potential bugs. The goal is to fully understand its function within the network.



68/3 2026/10/01 02:27 tool read-file
0m Args:
{
  "File": "net/ipv6/exthdrs_core.c",
  "FirstLine": 72,
  "LineCount": 40
}

Results:
{
  "Contents": "  72:\tint ipv6_skip_exthdr(const struct sk_buff *skb, int start, u8 *nexthdrp,\n  73:\t\t\t     __be16 *frag_offp)\n  74:\t{\n  75:\t\tu8 nexthdr = *nexthdrp;\n  76:\t\tint exthdr_cnt = 0;\n  77:\t\n  78:\t\t*frag_offp = 0;\n  79:\t\n  80:\t\twhile (ipv6_ext_hdr(nexthdr)) {\n  81:\t\t\tstruct ipv6_opt_hdr _hdr, *hp;\n  82:\t\t\tint hdrlen;\n  83:\t\n  84:\t\t\tif (nexthdr == NEXTHDR_NONE)\n  85:\t\t\t\treturn -1;\n  86:\t\t\tif (unlikely(exthdr_cnt++ \u003e= IP6_MAX_EXT_HDRS_CNT))\n  87:\t\t\t\treturn -1;\n  88:\t\t\thp = skb_header_pointer(skb, start, sizeof(_hdr), \u0026_hdr);\n  89:\t\t\tif (!hp)\n  90:\t\t\t\treturn -1;\n  91:\t\t\tif (nexthdr == NEXTHDR_FRAGMENT) {\n  92:\t\t\t\t__be16 _frag_off, *fp;\n  93:\t\t\t\tfp = skb_header_pointer(skb,\n  94:\t\t\t\t\t\t\tstart+offsetof(struct frag_hdr,\n  95:\t\t\t\t\t\t\t\t       frag_off),\n  96:\t\t\t\t\t\t\tsizeof(_frag_off),\n  97:\t\t\t\t\t\t\t\u0026_frag_off);\n  98:\t\t\t\tif (!fp)\n  99:\t\t\t\t\treturn -1;\n 100:\t\n 101:\t\t\t\t*frag_offp = *fp;\n 102:\t\t\t\tif (ntohs(*frag_offp) \u0026 ~0x7)\n 103:\t\t\t\t\tbreak;\n 104:\t\t\t\thdrlen = 8;\n 105:\t\t\t} else if (nexthdr == NEXTHDR_AUTH)\n 106:\t\t\t\thdrlen = ipv6_authlen(hp);\n 107:\t\t\telse\n 108:\t\t\t\thdrlen = ipv6_optlen(hp);\n 109:\t\n 110:\t\t\tnexthdr = hp-\u003enexthdr;\n 111:\t\t\tstart += hdrlen;\n"
}

69/3 2026/10/01 02:27 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 41355
							output: 47
							thoughts: 541
						

Thoughts:
**Digging into potential data corruption**

Okay, first thing's first, I see that we're initializing `*frag_offp = 0;` in `ipv6_skip_exthdr`, which is as expected. However, that's not what I'm focused on at the moment.  I've got a nagging feeling about something else.

Let's switch gears and go spelunking into `rmnet_changelink` within `rmnet_config.c`. The code block with the `IFLA_RMNET_FLAGS` check is interesting. I'm focusing on these lines:

```c
	if (data[IFLA_RMNET_FLAGS]) {
		old_data_format = READ_ONCE(port->data_format);
		flags = nla_data(data[IFLA_RMNET_FLAGS]);
		data_format = old_data_format & ~flags->mask;
		data_format |= flags->flags & flags->mask;

		if (!rmnet_config_data_format_valid(data_format)) {
			NL_SET_ERR_MSG_MOD(extack,
					   "unsupported MAP checksum flag combination");
			return -EINVAL;
		}
	}
```

My brain is screaming, "Is `data_format` properly initialized if `data[IFLA_RMNET_FLAGS]` *isn't* set?" I see that `data_format` is declared locally *inside* the `rmnet_changelink` function:

```c
	u32 old_data_format;
	u32 data_format;
```

That got me thinking: Where is `WRITE_ONCE(port->data_format, data_format);` located? The diff shows that it's moved! The original code was:

```c
@@ -346,14 +392,6 @@ static int rmnet_changelink(struct net_device *dev, struct nlattr *tb[],
 	}
 
 	if (data[IFLA_RMNET_FLAGS]) {
-		struct ifla_rmnet_flags *flags;
-		u32 old_data_format;
-		u32 data_format;
-
-		old_data_format = port->data_format;
-		flags = nla_data(data[IFLA_RMNET_FLAGS]);
-		data_format = old_data_format & ~flags->mask;
-		data_format |= flags->flags & flags->mask;
 		WRITE_ONCE(port->data_format, data_format);
 
 		if (rmnet_vnd_update_dev_mtu(port, real_dev)) {
```

I suspect this means the `data_format` wasn't being set previously if `data[IFLA_RMNET_FLAGS]` was false. I need to confirm. I'm going to grab the full source with `read-file` and check the control flow. I'm looking for the path where the `data_format` is potentially uninitialized.



70/3 2026/10/01 02:27 tool read-file
0m Args:
{
  "File": "drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c",
  "FirstLine": 350,
  "LineCount": 60
}

Results:
{
  "Contents": " 350:\t\t\t\t\t   \"request modifies device in another netns\");\n 351:\t\t\treturn -EPERM;\n 352:\t\t}\n 353:\t\n 354:\t\tport = rmnet_get_port_rtnl(real_dev);\n 355:\t\n 356:\t\tif (data[IFLA_RMNET_FLAGS]) {\n 357:\t\t\told_data_format = READ_ONCE(port-\u003edata_format);\n 358:\t\t\tflags = nla_data(data[IFLA_RMNET_FLAGS]);\n 359:\t\t\tdata_format = old_data_format \u0026 ~flags-\u003emask;\n 360:\t\t\tdata_format |= flags-\u003eflags \u0026 flags-\u003emask;\n 361:\t\n 362:\t\t\tif (!rmnet_config_data_format_valid(data_format)) {\n 363:\t\t\t\tNL_SET_ERR_MSG_MOD(extack,\n 364:\t\t\t\t\t\t   \"unsupported MAP checksum flag combination\");\n 365:\t\t\t\treturn -EINVAL;\n 366:\t\t\t}\n 367:\t\t}\n 368:\t\n 369:\t\tif (data[IFLA_RMNET_MUX_ID]) {\n 370:\t\t\tmux_id = nla_get_u16(data[IFLA_RMNET_MUX_ID]);\n 371:\t\n 372:\t\t\tif (mux_id != priv-\u003emux_id) {\n 373:\t\t\t\tstruct rmnet_endpoint *ep;\n 374:\t\n 375:\t\t\t\tep = rmnet_get_endpoint(port, priv-\u003emux_id);\n 376:\t\t\t\tif (!ep)\n 377:\t\t\t\t\treturn -ENODEV;\n 378:\t\n 379:\t\t\t\tif (rmnet_get_endpoint(port, mux_id)) {\n 380:\t\t\t\t\tNL_SET_ERR_MSG_MOD(extack,\n 381:\t\t\t\t\t\t\t   \"MUX ID already exists\");\n 382:\t\t\t\t\treturn -EINVAL;\n 383:\t\t\t\t}\n 384:\t\n 385:\t\t\t\thlist_del_init_rcu(\u0026ep-\u003ehlnode);\n 386:\t\t\t\tWRITE_ONCE(ep-\u003emux_id, mux_id);\n 387:\t\t\t\thlist_add_head_rcu(\u0026ep-\u003ehlnode,\n 388:\t\t\t\t\t\t   \u0026port-\u003emuxed_ep[mux_id]);\n 389:\t\n 390:\t\t\t\tWRITE_ONCE(priv-\u003emux_id, mux_id);\n 391:\t\t\t}\n 392:\t\t}\n 393:\t\n 394:\t\tif (data[IFLA_RMNET_FLAGS]) {\n 395:\t\t\tWRITE_ONCE(port-\u003edata_format, data_format);\n 396:\t\n 397:\t\t\tif (rmnet_vnd_update_dev_mtu(port, real_dev)) {\n 398:\t\t\t\tWRITE_ONCE(port-\u003edata_format, old_data_format);\n 399:\t\t\t\tNL_SET_ERR_MSG_MOD(extack, \"Invalid MTU on real dev\");\n 400:\t\t\t\treturn -EINVAL;\n 401:\t\t\t}\n 402:\t\t}\n 403:\t\n 404:\t\treturn 0;\n 405:\t}\n 406:\t\n 407:\tstatic size_t rmnet_get_size(const struct net_device *dev)\n 408:\t{\n 409:\t\treturn\n"
}

71/3 2026/10/01 02:27 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 43553
							output: 47
							thoughts: 263
						

Thoughts:
**Analyzing RMNET Link Configuration**

Okay, let's break this down. In the `rmnet_changelink` function, the code is checking for `IFLA_RMNET_FLAGS`. Inside that conditional, `data_format` and `old_data_format` are read and *also* initialized within the same `if` block.  There's no way they're uninitialized, which is good.

Now, let's move onto `rmnet_newlink`. I see the same check for `IFLA_RMNET_FLAGS`.  Inside, it extracts `flags`, then it modifies `data_format`.  The crucial part is understanding *where* `data_format` gets its initial value in `rmnet_newlink`. I need to trace back and find its declaration and assignment. That's the missing piece of the puzzle here to see where the problem might arise, if at all.



72/3 2026/10/01 02:27 tool read-file
0m Args:
{
  "File": "drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c",
  "FirstLine": 140,
  "LineCount": 40
}

Results:
{
  "Contents": " 140:\t\tnetdev_upper_dev_unlink(bridge_dev, rmnet_dev);\n 141:\t\trmnet_unregister_real_device(bridge_dev);\n 142:\t}\n 143:\t\n 144:\tstatic int rmnet_newlink(struct net_device *dev,\n 145:\t\t\t\t struct rtnl_newlink_params *params,\n 146:\t\t\t\t struct netlink_ext_ack *extack)\n 147:\t{\n 148:\t\tstruct net *link_net = rtnl_newlink_link_net(params);\n 149:\t\tu32 data_format = RMNET_FLAGS_INGRESS_DEAGGREGATION;\n 150:\t\tstruct nlattr **data = params-\u003edata;\n 151:\t\tstruct nlattr **tb = params-\u003etb;\n 152:\t\tstruct net_device *real_dev;\n 153:\t\tint mode = RMNET_EPMODE_VND;\n 154:\t\tstruct rmnet_endpoint *ep;\n 155:\t\tstruct rmnet_port *port;\n 156:\t\tint err = 0;\n 157:\t\tu16 mux_id;\n 158:\t\n 159:\t\tif (!tb[IFLA_LINK]) {\n 160:\t\t\tNL_SET_ERR_MSG_MOD(extack, \"link not specified\");\n 161:\t\t\treturn -EINVAL;\n 162:\t\t}\n 163:\t\n 164:\t\treal_dev = __dev_get_by_index(link_net, nla_get_u32(tb[IFLA_LINK]));\n 165:\t\tif (!real_dev) {\n 166:\t\t\tNL_SET_ERR_MSG_MOD(extack, \"link does not exist\");\n 167:\t\t\treturn -ENODEV;\n 168:\t\t}\n 169:\t\n 170:\t\tif (data[IFLA_RMNET_FLAGS]) {\n 171:\t\t\tstruct ifla_rmnet_flags *flags;\n 172:\t\n 173:\t\t\tflags = nla_data(data[IFLA_RMNET_FLAGS]);\n 174:\t\t\tdata_format \u0026= ~flags-\u003emask;\n 175:\t\t\tdata_format |= flags-\u003eflags \u0026 flags-\u003emask;\n 176:\t\t}\n 177:\t\n 178:\t\tif (!rmnet_config_data_format_valid(data_format)) {\n 179:\t\t\tNL_SET_ERR_MSG_MOD(extack,\n"
}

73/3 2026/10/01 02:27 llm kmsan-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 44726
							output: 550
							thoughts: 4665
						

Thoughts:
**Analysis of Memory Safety and KMSAN Applicability**

Okay, let's break this down. My initial focus was on the function `__rmnet_map_segment_coal_skb` and the related data structures to ensure there are no potential uninitialized memory reads or writes introduced. The `data_format` variable is initialized correctly, and the code meticulously reconstructs SKBs. Looking at `rmnet_map_partial_csum` and `rmnet_deliver_skb_list`, I've verified that checksum calculations and packet delivery also handle data appropriately. I went through the entire logic path through `rmnet_map_ingress_handler` and `rmnet_map_process_next_hdr_packet`. The use of `alloc_skb`, `skb_reserve`, and `skb_put_data` appears safe, with careful management of buffer offsets and data copies. I then checked the GRO fast path and `rmnet_map_v5_csum_fixup` to ensure nothing was missed. I've also done a thorough analysis of the new packet parsing routines, and the numerous bounds checks confirm that any out-of-bounds access is an issue for KASAN.

I've examined the key elements that could possibly introduce uninitialized memory issues. There's an initialization of the `coal_meta` structure with `memset`, initialization of local variables, and the initialization of packet lists. The new statistics and user-space interface also appear safe, and the fields in `struct rmnet_priv_stats` are all 64-bit integers and the right data is getting copied from the kernel to user space. There's nothing in the code that would leak uninitialized memory to user space.

After this comprehensive review, I'm confident that these changes do not introduce or expose risks of uninitialized memory reads, which would be detected by KMSAN. Since any memory safety issues in the code are expected to manifest as out-of-bounds accesses or buffer management errors, they would be reliably caught by KASAN. Therefore, `NeedsKMSAN=false` is the correct setting.



74/3 2026/10/01 02:27 tool set-results
0m Args:
{
  "KMSANReasoning": "The patch series introduces hardware coalescing (MAPv5 downlink coalescing) support in the Qualcomm RMNET driver. This involves parsing MAPv5 coalescing headers, validating bounds, de-coalescing packets into individual or GSO-stamped SKBs, and exposing coalescing statistics via ethtool.\n\nAnalysis of potential uninitialized memory risks:\n1. Local structs and variables:\n   - `struct rmnet_map_coal_metadata` is explicitly zero-initialized using `memset` before use.\n   - `struct sk_buff_head list` is initialized with `__skb_queue_head_init`.\n   - `nlo_err_mask` is initialized upon successful return from `rmnet_map_data_check_coal_header` and not used on error paths.\n   - In `rmnet_config.c`, `data_format` and `old_data_format` in `rmnet_changelink` are initialized and accessed strictly within the `if (data[IFLA_RMNET_FLAGS])` block.\n2. Kernel-to-userspace data (ethtool \u0026 netlink):\n   - The new counters in `struct rmnet_priv_stats` consist entirely of 64-bit integers (`u64`) with no padding holes.\n   - Device private data `rmnet_priv` is allocated with zero-initialization via `alloc_netdev` / `rtnl_link_ops`.\n   - The count of strings in `rmnet_gstrings_stats` exactly matches the number of `u64` fields in `struct rmnet_priv_stats`, so `rmnet_get_ethtool_stats` copies only initialized counter values without uninitialized data leaks.\n3. SKB payload reconstruction:\n   - For carved SKBs in `__rmnet_map_segment_coal_skb`, the packet buffer is fully populated via `skb_put_data` and header `memcpy` operations without leaving uninitialized gaps in the packet buffer.\n   - Any boundary issues when parsing incoming frame headers or slicing payloads would constitute out-of-bounds memory accesses or length calculation bugs, which are detected by standard KASAN.\n\nBecause there are no uninitialized memory usages or kernel-to-user info-leak risks, and any potential memory corruption or out-of-bounds accesses are covered by KASAN, a dedicated KMSAN fuzzing session is not warranted.",
  "NeedsKMSAN": false
}

Results:
{
  "KMSANReasoning": "The patch series introduces hardware coalescing (MAPv5 downlink coalescing) support in the Qualcomm RMNET driver. This involves parsing MAPv5 coalescing headers, validating bounds, de-coalescing packets into individual or GSO-stamped SKBs, and exposing coalescing statistics via ethtool.\n\nAnalysis of potential uninitialized memory risks:\n1. Local structs and variables:\n   - `struct rmnet_map_coal_metadata` is explicitly zero-initialized using `memset` before use.\n   - `struct sk_buff_head list` is initialized with `__skb_queue_head_init`.\n   - `nlo_err_mask` is initialized upon successful return from `rmnet_map_data_check_coal_header` and not used on error paths.\n   - In `rmnet_config.c`, `data_format` and `old_data_format` in `rmnet_changelink` are initialized and accessed strictly within the `if (data[IFLA_RMNET_FLAGS])` block.\n2. Kernel-to-userspace data (ethtool \u0026 netlink):\n   - The new counters in `struct rmnet_priv_stats` consist entirely of 64-bit integers (`u64`) with no padding holes.\n   - Device private data `rmnet_priv` is allocated with zero-initialization via `alloc_netdev` / `rtnl_link_ops`.\n   - The count of strings in `rmnet_gstrings_stats` exactly matches the number of `u64` fields in `struct rmnet_priv_stats`, so `rmnet_get_ethtool_stats` copies only initialized counter values without uninitialized data leaks.\n3. SKB payload reconstruction:\n   - For carved SKBs in `__rmnet_map_segment_coal_skb`, the packet buffer is fully populated via `skb_put_data` and header `memcpy` operations without leaving uninitialized gaps in the packet buffer.\n   - Any boundary issues when parsing incoming frame headers or slicing payloads would constitute out-of-bounds memory accesses or length calculation bugs, which are detected by standard KASAN.\n\nBecause there are no uninitialized memory usages or kernel-to-user info-leak risks, and any potential memory corruption or out-of-bounds accesses are covered by KASAN, 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)