CVE-2025-68340

Source
https://cve.org/CVERecord?id=CVE-2025-68340
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-68340.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2025-68340
Downstream
Published
2025-12-23T13:58:25.841Z
Modified
2026-03-13T04:04:10.361726Z
Summary
team: Move team device type change at the end of team_port_add
Details

In the Linux kernel, the following vulnerability has been resolved:

team: Move team device type change at the end of teamportadd

Attempting to add a port device that is already up will expectedly fail, but not before modifying the team device header_ops.

In the case of the syzbot reproducer the gre0 device is already in state UP when it attempts to add it as a port device of team0, this fails but before that headerops->create of team0 is changed from ethheader to ipgreheader in the call to teamdevtypecheck_change.

Later when we end up in ipgreheader() struct iptunnel* points to nonsense as the private data of the device still holds a struct team.

Example sequence of iproute2 commands to reproduce the hang/BUG(): ip link add dev team0 type team ip link add dev gre0 type gre ip link set dev gre0 up ip link set dev gre0 master team0 ip link set dev team0 up ping -I team0 1.1.1.1

Move teamdevtypecheckchange down where all other checks have passed as it changes the dev type with no way to restore it in case one of the checks that follow it fail.

Also make sure to preserve the origial mtu assignment: - If portdev is not the same type as dev, dev takes mtu from portdev - If portdev is the same type as dev, portdev takes mtu from dev

This is done by adding a conditional before the call to devsetmtu to prevent it from assigning portdev->mtu = dev->mtu and instead letting teamdevtypecheckchange assign dev->mtu = portdev->mtu. The conditional is needed because the patch moves the call to teamdevtypecheckchange past devsetmtu.

Testing: - team device driver in-tree selftests - Add/remove various devices as slaves of team device - syzbot

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/68xxx/CVE-2025-68340.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
1d76efe1577b4323609b1bcbfafa8b731eda071a
Fixed
c8b15b0d2eec3b5c7f585e5a53dfc8d36c818283
Fixed
a74ab1b532ecc5f9106621a8f75b4c3d04466b35
Fixed
e26235840fd961e4ebe5568f11a2a078cf726663
Fixed
4040b5e8963982a00aa821300cb746efc9f2947e
Fixed
e3eed4f038214494af62c7d2d64749e5108ce6ca
Fixed
0ae9cfc454ea5ead5f3ddbdfe2e70270d8e2c8ef

Database specific

source
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-68340.json"