# CVE-2025-68340: team: Move team device type change at the end of team_port_add

> A logic error in the Linux kernel team driver causes a null pointer dereference and system crash when adding an already-up GRE device as a port.

- **Severity:** High 7.8 (`CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 23 Dec 2025
- **Updated:** 16 Oct 2026
- **Also known as:** AZL-78404, BELL-CVE-2025-68340, DEBIAN-CVE-2025-68340, GHSA-jmpj-vqww-cqc8, ROOT-OS-DEBIAN-11-CVE-2025-68340, ROOT-OS-DEBIAN-12-CVE-2025-68340, ROOT-OS-DEBIAN-13-CVE-2025-68340, ROOT-OS-UBUNTU-2204-CVE-2025-68340, ROOT-OS-UBUNTU-2404-CVE-2025-68340, UBUNTU-CVE-2025-68340

## What is CVE-2025-68340?

CVE-2025-68340 is a high-severity vulnerability in Linux kernel, published on 23 Dec 2025. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

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

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

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
header_ops->create of team0 is changed from eth_header to ipgre_header
in the call to team_dev_type_check_change.

Later when we end up in ipgre_header() struct ip_tunnel* 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 team_dev_type_check_change 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 port_dev is not the same type as dev, dev takes mtu from port_dev
  - If port_dev is the same type as dev, port_dev takes mtu from dev

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

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

## Which versions are affected by CVE-2025-68340?

It affects 1 product.


Products: Linux kernel.

## How do I fix CVE-2025-68340?

Apply the vendor's patch.

## Is CVE-2025-68340 being exploited?

There is no known exploitation of CVE-2025-68340 in the wild and no public exploit code.

## Other vulnerabilities in Linux kernel

- [CVE-2026-53266](https://insights.sbomify.com/CVE-2026-53266/): Linux Kernel Out-of-Bounds Write (high 8.8, exploited in the wild)
- [CVE-2013-6282](https://insights.sbomify.com/CVE-2013-6282/): Linux Kernel Improper Input Validation (high 8.8, exploited in the wild)
- [CVE-2022-0185](https://insights.sbomify.com/CVE-2022-0185/): Linux Kernel Heap-Based Buffer Overflow (high 8.4, exploited in the wild)
- [CVE-2013-2094](https://insights.sbomify.com/CVE-2013-2094/): Linux Kernel Privilege Escalation (high 8.4, exploited in the wild)
- [CVE-2026-53362](https://insights.sbomify.com/CVE-2026-53362/): Linux Kernel Unspecified (high 7.8, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-68340 and fix it if it is affected.

What it is: CVE-2025-68340 is a high-severity vulnerability in Linux kernel, published on 23 Dec 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2025-68340 in the wild and no public exploit code.

Affected product: Linux kernel. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-68340/ (Markdown: https://insights.sbomify.com/CVE-2025-68340/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-68340
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-68340
- OSV: https://osv.dev/vulnerability/CVE-2025-68340

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-68340/
Summaries are generated and may contain mistakes; the official description above is the record.
