← Back to CVE Explorer

CVE-2025-40201

Full vulnerability record from the local CVENow database.

Description

In the Linux kernel, the following vulnerability has been resolved: kernel/sys.c: fix the racy usage of task_lock(tsk->group_leader) in sys_prlimit64() paths The usage of task_lock(tsk->group_leader) in sys_prlimit64()->do_prlimit() path is very broken. sys_prlimit64() does get_task_struct(tsk) but this only protects task_struct itself. If tsk != current and tsk is not a leader, this process can exit/exec and task_lock(tsk->group_leader) may use the already freed task_struct. Another problem is that sys_prlimit64() can race with mt-exec which changes ->group_leader. In this case do_prlimit() may take the wrong lock, or (worse) ->group_leader may change between task_lock() and task_unlock(). Change sys_prlimit64() to take tasklist_lock when necessary. This is not nice, but I don't see a better fix for -stable.

Severity
HIGH
CVSS score
7.8 (v3.1)
Vulnerability status
Deferred
Source identifier
416baaa9-dc9f-4396-8d5f-8c081fb06d67
Published
2025-11-12 22:15:47.283000
Last modified
2026-10-19 21:10:00.160000
View original CVE JSON
{
  "id": "CVE-2025-40201",
  "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
  "published": "2025-11-12T22:15:47.283",
  "lastModified": "2026-10-19T21:10:00.160",
  "vulnStatus": "Deferred",
  "cveTags": [],
  "descriptions": [
    {
      "lang": "en",
      "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nkernel/sys.c: fix the racy usage of task_lock(tsk->group_leader) in sys_prlimit64() paths\n\nThe usage of task_lock(tsk->group_leader) in sys_prlimit64()->do_prlimit()\npath is very broken.\n\nsys_prlimit64() does get_task_struct(tsk) but this only protects task_struct\nitself. If tsk != current and tsk is not a leader, this process can exit/exec\nand task_lock(tsk->group_leader) may use the already freed task_struct.\n\nAnother problem is that sys_prlimit64() can race with mt-exec which changes\n->group_leader. In this case do_prlimit() may take the wrong lock, or (worse)\n->group_leader may change between task_lock() and task_unlock().\n\nChange sys_prlimit64() to take tasklist_lock when necessary. This is not\nnice, but I don't see a better fix for -stable."
    },
    {
      "lang": "es",
      "value": "En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nkernel/sys.c: corregir el uso propenso a condiciones de carrera de task_lock(tsk->group_leader) en las rutas de sys_prlimit64()\n\nEl uso de task_lock(tsk->group_leader) en la ruta sys_prlimit64()->do_prlimit() está muy defectuoso.\n\nsys_prlimit64() realiza get_task_struct(tsk) pero esto solo protege la propia task_struct. Si tsk != current y tsk no es un líder, este proceso puede salir/ejecutar y task_lock(tsk->group_leader) puede usar la task_struct ya liberada.\n\nOtro problema es que sys_prlimit64() puede entrar en condición de carrera con mt-exec, que cambia ->group_leader. En este caso, do_prlimit() puede tomar el bloqueo incorrecto, o (peor aún) ->group_leader puede cambiar entre task_lock() y task_unlock().\n\nModificar sys_prlimit64() para tomar tasklist_lock cuando sea necesario. Esto no es ideal, pero no veo una mejor solución para -stable."
    }
  ],
  "affected": [
    {
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
      "affectedData": [
        {
          "vendor": "Linux",
          "product": "Linux",
          "defaultStatus": "unaffected",
          "programFiles": [
            "kernel/sys.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "versions": [
            {
              "version": "18c91bb2d87268d23868bf13508f5bc9cf04e89a",
              "lessThan": "1bc0d9315ef5296abb2c9fd840336255850ded18",
              "versionType": "git",
              "status": "affected"
            },
            {
              "version": "18c91bb2d87268d23868bf13508f5bc9cf04e89a",
              "lessThan": "132f827e7bac7373e1522e89709d70b43cae5342",
              "versionType": "git",
              "status": "affected"
            },
            {
              "version": "18c91bb2d87268d23868bf13508f5bc9cf04e89a",
              "lessThan": "19b45c84bd9fd42fa97ff80c6350d604cb871c75",
              "versionType": "git",
              "status": "affected"
            },
            {
              "version": "18c91bb2d87268d23868bf13508f5bc9cf04e89a",
              "lessThan": "6796412decd2d8de8ec708213bbc958fab72f143",
              "versionType": "git",
              "status": "affected"
            },
            {
              "version": "18c91bb2d87268d23868bf13508f5bc9cf04e89a",
              "lessThan": "a15f37a40145c986cdf289a4b88390f35efdecc4",
              "versionType": "git",
              "status": "affected"
            }
          ]
        },
        {
          "vendor": "Linux",
          "product": "Linux",
          "defaultStatus": "affected",
          "programFiles": [
            "kernel/sys.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "versions": [
            {
              "version": "5.18",
              "status": "affected"
            },
            {
              "version": "0",
              "lessThan": "5.18",
              "versionType": "semver",
              "status": "unaffected"
            },
            {
              "version": "6.1.157",
              "lessThanOrEqual": "6.1.*",
              "versionType": "semver",
              "status": "unaffected"
            },
            {
              "version": "6.6.113",
              "lessThanOrEqual": "6.6.*",
              "versionType": "semver",
              "status": "unaffected"
            },
            {
              "version": "6.12.54",
              "lessThanOrEqual": "6.12.*",
              "versionType": "semver",
              "status": "unaffected"
            },
            {
              "version": "6.17.4",
              "lessThanOrEqual": "6.17.*",
              "versionType": "semver",
              "status": "unaffected"
            },
            {
              "version": "6.18",
              "lessThanOrEqual": "*",
              "versionType": "original_commit_for_fix",
              "status": "unaffected"
            }
          ]
        }
      ]
    }
  ],
  "metrics": {
    "cvssMetricV31": [
      {
        "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "type": "Secondary",
        "cvssData": {
          "version": "3.1",
          "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
          "baseScore": 7.8,
          "baseSeverity": "HIGH",
          "attackVector": "LOCAL",
          "attackComplexity": "LOW",
          "privilegesRequired": "LOW",
          "userInteraction": "NONE",
          "scope": "UNCHANGED",
          "confidentialityImpact": "HIGH",
          "integrityImpact": "HIGH",
          "availabilityImpact": "HIGH"
        },
        "exploitabilityScore": 1.8,
        "impactScore": 5.9
      }
    ],
    "ssvcV203": [
      {
        "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
        "ssvcData": {
          "timestamp": "2026-10-15T21:58:02.275858Z",
          "id": "CVE-2025-40201",
          "options": [
            {
              "exploitation": "none"
            },
            {
              "automatable": "no"
            },
            {
              "technicalImpact": "total"
            }
          ],
          "role": "CISA Coordinator",
          "version": "2.0.3"
        }
      }
    ]
  },
  "references": [
    {
      "url": "https://git.kernel.org/stable/c/132f827e7bac7373e1522e89709d70b43cae5342",
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
    },
    {
      "url": "https://git.kernel.org/stable/c/19b45c84bd9fd42fa97ff80c6350d604cb871c75",
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
    },
    {
      "url": "https://git.kernel.org/stable/c/1bc0d9315ef5296abb2c9fd840336255850ded18",
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
    },
    {
      "url": "https://git.kernel.org/stable/c/6796412decd2d8de8ec708213bbc958fab72f143",
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
    },
    {
      "url": "https://git.kernel.org/stable/c/a15f37a40145c986cdf289a4b88390f35efdecc4",
      "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
    }
  ]
}