CVE-2025-71066

Source
https://cve.org/CVERecord?id=CVE-2025-71066
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-71066.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2025-71066
Downstream
Related
Published
2026-01-13T15:31:21.931Z
Modified
2026-03-20T12:46:33.251403Z
Summary
net/sched: ets: Always remove class from active list before deleting in ets_qdisc_change
Details

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

net/sched: ets: Always remove class from active list before deleting in etsqdiscchange

zdi-disclosures@trendmicro.com says:

The vulnerability is a race condition between ets_qdisc_dequeue and ets_qdisc_change. It leads to UAF on struct Qdisc object. Attacker requires the capability to create new user and network namespace in order to trigger the bug. See my additional commentary at the end of the analysis.

Analysis:

static int etsqdiscchange(struct Qdisc *sch, struct nlattr *opt, struct netlinkextack *extack) { ...

  // (1) this lock is preventing .change handler (`ets_qdisc_change`)
  //to race with .dequeue handler (`ets_qdisc_dequeue`)
  sch_tree_lock(sch);

  for (i = nbands; i < oldbands; i++) {
          if (i >= q->nstrict && q->classes[i].qdisc->q.qlen)
                  list_del_init(&q->classes[i].alist);
          qdisc_purge_queue(q->classes[i].qdisc);
  }

  WRITE_ONCE(q->nbands, nbands);
  for (i = nstrict; i < q->nstrict; i++) {
          if (q->classes[i].qdisc->q.qlen) {
          // (2) the class is added to the q->active
                  list_add_tail(&q->classes[i].alist, &q->active);
                  q->classes[i].deficit = quanta[i];
          }
  }
  WRITE_ONCE(q->nstrict, nstrict);
  memcpy(q->prio2band, priomap, sizeof(priomap));

  for (i = 0; i < q->nbands; i++)
          WRITE_ONCE(q->classes[i].quantum, quanta[i]);

  for (i = oldbands; i < q->nbands; i++) {
          q->classes[i].qdisc = queues[i];
          if (q->classes[i].qdisc != &noop_qdisc)
                  qdisc_hash_add(q->classes[i].qdisc, true);
  }

  // (3) the qdisc is unlocked, now dequeue can be called in parallel
  // to the rest of .change handler
  sch_tree_unlock(sch);

  ets_offload_change(sch);
  for (i = q->nbands; i < oldbands; i++) {
      // (4) we're reducing the refcount for our class's qdisc and
      //  freeing it
          qdisc_put(q->classes[i].qdisc);
      // (5) If we call .dequeue between (4) and (5), we will have
      // a strong UAF and we can control RIP
          q->classes[i].qdisc = NULL;
          WRITE_ONCE(q->classes[i].quantum, 0);
          q->classes[i].deficit = 0;
          gnet_stats_basic_sync_init(&q->classes[i].bstats);
          memset(&q->classes[i].qstats, 0, sizeof(q->classes[i].qstats));
  }
  return 0;

}

Comment: This happens because some of the classes have their qdiscs assigned to NULL, but remain in the active list. This commit fixes this issue by always removing the class from the active list before deleting and freeing its associated qdisc

Reproducer Steps (trimmed version of what was sent by zdi-disclosures@trendmicro.com)

``` DEV="${DEV:-lo}" ROOTHANDLE="${ROOTHANDLE:-1:}" BAND2HANDLE="${BAND2HANDLE:-20:}" # child under 1:2 PINGBYTES="${PINGBYTES:-48}" PINGCOUNT="${PINGCOUNT:-200000}" PINGDST="${PINGDST:-127.0.0.1}"

SLOWTBFRATE="${SLOWTBFRATE:-8bit}" SLOWTBFBURST="${SLOWTBFBURST:-100b}" SLOWTBFLAT="${SLOWTBFLAT:-1s}"

cleanup() { tc qdisc del dev "$DEV" root 2>/dev/null } trap cleanup EXIT

ip link set "$DEV" up

tc qdisc del dev "$DEV" root 2>/dev/null || true

tc qdisc add dev "$DEV" root handle "$ROOT_HANDLE" ets bands 2 strict 2

tc qdisc add dev "$DEV" parent 1:2 handle "$BAND2HANDLE" \ tbf rate "$SLOWTBFRATE" burst "$SLOWTBFBURST" latency "$SLOWTBF_LAT"

tc filter add dev "$DEV" parent 1: protocol all prio 1 u32 match u32 0 0 flowid 1:2 tc -s qdisc ls dev $DEV

ping -I "$DEV" -f -c "$PINGCOUNT" -s "$PINGBYTES" -W 0.001 "$PING_DST" \

/dev/null 2>&1 & tc qdisc change dev "$DEV" root handle "$ROOTHANDLE" ets bands 2 strict 0 tc qdisc change dev "$DEV" root handle "$ROOTHANDLE" ets bands 2 strict 2 tc -s qdisc ls dev $DEV tc qdisc del dev "$DEV" parent ---truncated---

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/71xxx/CVE-2025-71066.json"
}
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
ae2659d2c670252759ee9c823c4e039c0e05a6f2
Fixed
062d5d544e564473450d72e6af83077c2b2ff7c3
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
e25bdbc7e951ae5728fee1f4c09485df113d013c
Fixed
c7f6e7cc14df72b997258216e99d897d2df0dbbd
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
de6d25924c2a8c2988c6a385990cafbe742061bf
Fixed
a75d617a4ef08682f5cfaadc01d5141c87e019c9
Fixed
9987cda315c08f63a02423fa2f9a1f6602c861a0
Fixed
06bfb66a7c8b45e3fed01351a4b087410ae5ef39
Fixed
45466141da3c98a0c5fa88be0bc14b4b6a4bd75c
Fixed
ce052b9402e461a9aded599f5b47e76bc727f7de

Database specific

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

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
5.10.248
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.198
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.1.160
Fixed
6.6.120
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.12.64
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.18.3

Database specific

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