HIGH
team HeaderOps Type Confusion
CVE-2026-31502
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
KernelScan AI7.8HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: team: fix header_ops type confusion with non-Ethernet ports Similar to commit 950803f72547 ("bonding: fix type confusion in bond_setup_by_slave()") team has the same class of header_ops type confusion. For non-Ethernet ports, team_setup_by_port() copies port_dev->header_ops directly. When the team device later calls dev_hard_header() or dev_parse_header(), these callbacks can run with the team net_device instead of the real lower device, so netdev_priv(dev) is interpreted as the wrong private type and can crash. The syzbot report shows a crash in bond_header_create(), but the root cause is in team: the topology is gre -> bond -> team, and team calls the inherited header_ops with its own net_device instead of the lower device, so bond_header_create() receives a team device and interprets netdev_priv() as bonding private data, causing a type confusion crash. Fix this by introducing team header_ops wrappers for create/parse, selecting a team port under RCU, and calling the lower device callbacks with port->dev, so each callback always sees the correct net_device context. Also pass the selected lower device to the lower parse callback, so recursion is bounded in stacked non-Ethernet topologies and parse callbacks always run with the correct device context.
02KernelScan AI Analysis
Risk summary
A type confusion vulnerability in the Linux kernel's team network driver can cause system crashes when non-Ethernet devices are used as team ports. The issue occurs when the driver incorrectly passes device context to header operation callbacks, causing memory corruption. This primarily affects systems with complex network configurations involving stacked non-Ethernet network devices.
Vulnerability analysis
Root Cause: The team driver directly copies header_ops from non-Ethernet port devices without proper context handling. When team_setup_by_port() copies port_dev->header_ops directly for non-Ethernet ports, subsequent calls to dev_hard_header() or dev_parse_header() execute with the team net_device context instead of the original lower device context. This causes netdev_priv(dev) to be interpreted as the wrong private data structure type, leading to type confusion crashes.
Attack Surface: This vulnerability affects local network stack operations when team devices are configured with non-Ethernet ports in stacked network topologies (e.g., gre -> bond -> team). The vulnerability is triggered through normal network operations that invoke header creation or parsing functions, requiring local access to configure such network topologies.
Fix Mechanism: The patch introduces wrapper functions team_header_create() and team_header_parse() that properly handle device context. These wrappers select an appropriate team port under RCU protection and call the lower device's header_ops callbacks with the correct port->dev context instead of the team device. This ensures that netdev_priv() always returns the expected private data structure type for the actual device being operated on.
03Fix Versions
| Branch | Fixed in | Patch commit |
|---|---|---|
| 6.12 | 6.12.80 | 6d3161fa3eee |
| 6.18 | 6.18.21 | 0a7468ed49a6 |
| 6.19 | 6.19.11 | 20491d384d97 |
| mainline | 7.0 | 425000dbf173 |