{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2025-21726",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2025-21726"
  ],
  "published": "2025-02-27T02:06:37Z",
  "summary": "padata: avoid UAF for reorder_work",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\npadata: avoid UAF for reorder_work\n\nAlthough the previous patch can avoid ps and ps UAF for _do_serial, it\ncan not avoid potential UAF issue for reorder_work. This issue can\nhappen just as below:\n\ncrypto_request\t\t\tcrypto_request\t\tcrypto_del_alg\npadata_do_serial\n  ...\n  padata_reorder\n    // processes all remaining\n    // requests then breaks\n    while (1) {\n      if (!padata)\n        break;\n      ...\n    }\n\n\t\t\t\tpadata_do_serial\n\t\t\t\t  // new request added\n\t\t\t\t  list_add\n    // sees the new request\n    queue_work(reorder_work)\n\t\t\t\t  padata_reorder\n\t\t\t\t    queue_work_on(squeue->work)\n...\n\n\t\t\t\t<kworker context>\n\t\t\t\tpadata_serial_worker\n\t\t\t\t// completes new request,\n\t\t\t\t// no more outstanding\n\t\t\t\t// requests\n\n\t\t\t\t\t\t\tcrypto_del_alg\n\t\t\t\t\t\t\t  // free pd\n\n<kworker context>\ninvoke_padata_reorder\n  // UAF of pd\n\nTo avoid UAF for 'reorder_work', get 'pd' ref before put 'reorder_work'\ninto the 'serial_wq' and put 'pd' ref until the 'serial_wq' finish.",
  "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.129",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2025-21726"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/f4f1b1169fc3694f9bc3e28c6c68dbbf4cc744c0"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/4c6209efea2208597dbd3e52dc87a0d1a8f2dbe1"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/7000507bb0d2ceb545c0a690e0c707c897d102c2"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/6f45ef616775b0ce7889b0f6077fc8d681ab30bc"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/8ca38d0ca8c3d30dd18d311f1a7ec5cb56972cac"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/a54091c24220a4cd847d5b4f36d678edacddbaf0"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/dd7d37ccf6b11f3d95e797ebe4e9e886d0332600"
    }
  ],
  "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 padata reorder machinery is driven through pcrypt, reached locally via AF_ALG (`algif_aead`) socket operations or local xfrm/IPsec setup, and the `pd` free is triggered by local crypto-netlink/CPU-hotplug activity. No remote peer can reach or free the `parallel_data` object, so the attack requires local system access.\nAC:L - The attacker controls both sides of the race \u2014 they submit an unbounded stream of concurrent pcrypt AEAD requests to keep `reorder_work` queued while simultaneously driving the shell/pd teardown, and `serial_wq` is allocated with `max_active=1`, so `reorder_work` is routinely stalled behind serial workers, widening the window. Repeated attempts in a tight loop make the race reliably winnable, as the LTP `pcrypt_aead01` reproducer for the sibling bug demonstrates.\nPR:L - An unprivileged local user can fully drive the parallel/serial request side with no capability check at all via `AF_ALG` `algif_aead` binding `pcrypt(rfc4106(gcm(aes)))`, and the pd-release side is reachable through `padata_replace()` on CPU hotplug (suspend/resume, which logind grants to active unprivileged sessions) as well as through crypto netlink. No root-only gate is required on the path that actually corrupts memory.\nUI:N - The attacker issues both the crypto requests and the teardown that frees `parallel_data` themselves; no victim must mount a filesystem, open a file, or take any other action.\nS:U - The use-after-free corrupts kernel heap memory and is exploited within the same kernel security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - After `pd` is freed and reclaimed by sprayed attacker data, `padata_reorder()` follows `pd->ps->pinst`, `pd->reorder_list`, `pd->squeue` and `pd->cpumask.pcpu` out of the freed object, giving an attacker-directed read primitive over arbitrary kernel memory and disclosure of kernel state.\nI:H - The same freed object yields write primitives \u2014 `spin_trylock_bh(&pd->lock)`, `refcount_inc(&pd->refcnt)`, `++pd->processed`, and especially `list_del_init()`/`list_add_tail()` through attacker-controlled `reorder_list`/`squeue` pointers, plus a controlled `workqueue_struct *` fed to `queue_work_on()` \u2014 which is exploitable for arbitrary write and control-flow hijack leading to privilege escalation.\nA:H - Even without successful heap grooming, dereferencing the freed `parallel_data` reliably produces a KASAN slab-use-after-free splat, spinlock corruption, and kernel oops/panic, taking the whole system down; the crash can be reproduced repeatedly."
    }
  }
}
