{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2025-38107",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2025-38107"
  ],
  "published": "2025-07-03T08:36:23Z",
  "summary": "net_sched: ets: fix a race in ets_qdisc_change()",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nnet_sched: ets: fix a race in ets_qdisc_change()\n\nGerrard Tai reported a race condition in ETS, whenever SFQ perturb timer\nfires at the wrong time.\n\nThe race is as follows:\n\nCPU 0                                 CPU 1\n[1]: lock root\n[2]: qdisc_tree_flush_backlog()\n[3]: unlock root\n |\n |                                    [5]: lock root\n |                                    [6]: rehash\n |                                    [7]: qdisc_tree_reduce_backlog()\n |\n[4]: qdisc_put()\n\nThis can be abused to underflow a parent's qlen.\n\nCalling qdisc_purge_queue() instead of qdisc_tree_flush_backlog()\nshould fix the race, because all packets will be purged from the qdisc\nbefore releasing the lock.",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
    }
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:12",
        "name": "linux"
      },
      "versions": [
        "1:6.1.47-1+rpt4"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-2712",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v6",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7l",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v8",
            "binary_version": "1:6.1.47-1+rpt4"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.1.47-1+rpt4": {
            "linux_commit": "655fc658a15ae7a6f37103754adb39ba52a9a14e",
            "upstream_version": "6.1.47",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.1.142",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2025-38107"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/eb7b74e9754e1ba2088f914ad1f57a778b11894b"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/0b479d0aa488cb478eb2e1d8868be946ac8afb4f"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/347867cb424edae5fec1622712c8dd0a2c42918f"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/0383b25488a545be168744336847549d4a2d3d6c"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/073f64c03516bcfaf790f8edc772e0cfb8a84ec3"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/fed94bd51d62d2e0e006aa61480e94e5cd0582b0"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/d92adacdd8c2960be856e0b82acc5b7c5395fddb"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T12:19:11Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 7.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - The vulnerable code is reached only through `RTM_NEWQDISC` netlink messages (`tc qdisc change ... ets bands N`) plus locally enqueued packets, requiring local system access. No remote peer input reaches `ets_qdisc_change()`.\nAC:L - The attacker controls both sides of the race \u2014 they configure the SFQ child's `perturb` period, choose when to issue the band-shrinking `tc` change, and can retry the sequence unboundedly until the timer lands in the unlocked window between `sch_tree_unlock()` and `qdisc_put()`.\nPR:L - The tc/qdisc netlink path is gated only by `netlink_net_capable(skb, CAP_NET_ADMIN)` against the netns' own user namespace, so an unprivileged user obtains it via `unshare -Urn` and can also autoload `sch_ets`/`sch_sfq` from that context.\nUI:N - The attacker performs every step \u2014 creating the qdisc hierarchy, generating traffic, and triggering the change \u2014 entirely on their own. No victim action is involved.\nS:U - The corrupted `qlen`/`backlog` accounting and any resulting memory corruption are confined to the kernel's own security authority; this is standard local kernel privilege escalation with no VM, IOMMU, or sandbox boundary crossed.\nC:H - The double-subtraction underflows an unsigned `q.qlen`, desynchronizing the qdisc tree so classes remain on active lists after their child qdiscs are freed, yielding a use-after-free on `struct Qdisc`/class objects that can be groomed into an arbitrary kernel-memory read.\nI:H - The same qlen-desync-to-UAF primitive gives control over reallocated heap objects and their function pointers/list heads, enabling arbitrary write and control-flow hijacking \u2014 the well-known net/sched local privilege escalation pattern.\nA:H - Even unweaponized, the underflowed `qlen` makes an empty qdisc appear to hold ~4 billion packets, causing dequeue-from-empty warnings, stuck transmit paths, and use-after-free oopses that panic the kernel."
    }
  }
}
