Skip to content
Heist/ feed
High

sched/psi: use kernfs polling functions for PSI trigger polling

Type: advisorySource: Official CVE List1 source record

In the Linux kernel, the following vulnerability has been resolved: sched/psi: use kernfs polling functions for PSI trigger polling Destroying psi trigger in cgroup_file_release causes UAF issues when a cgroup is removed from under a polling process. This is happening because cgroup removal causes a call to cgroup_file_release while the actual file is still alive. Destroying the trigger at this point would also destroy its waitqueue head and if there is still a polling process on that file accessing the waitqueue, it will step on the freed pointer: do_select vfs_poll do_rmdir cgroup_rmdir kernfs_drain_open_files cgroup_file_release cgroup_pressure_release psi_trigger_destroy wake_up_pollfree(&t->event_wait) // vfs_poll is unblocked synchronize_rcu kfree(t) poll_freewait -> UAF access to the trigger's waitqueue head Patch [1] fixed this issue for epoll() case using wake_up_pollfree(), however the same issue exists for synchronous poll() case. The root cause of this issue is that the lifecycles of the psi trigger's waitqueue and of the file associated with the trigger are different. Fix this by using kernfs_generic_poll function when polling on cgroup-specific psi triggers. It internally uses kernfs_open_node->poll waitqueue head with its lifecycle tied to the file's lifecycle. This also renders the fix in [1] obsolete, so revert it. [1] commit c2dbe32d5db5 ("sched/psi: Fix use-after-free in ep_remove_wait_queue()")

Announced Group revision 1
Original source ↗

CVE-2023-54019

Primary source · Revision 1

Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.

Security context

Source reference: cve:CVE-2023-54019

Linux

Source reference: /containers/cna/affected/0/product

Affected versions
Not stated in this record
Fixed versions
Not stated in this record
Prerequisites
Not stated in this record

Linux

Source reference: /containers/cna/affected/1/product

Affected versions
Not stated in this record
Fixed versions
Not stated in this record
Prerequisites
Not stated in this record

Structured affected-version data

Original package identities and version rules from this source.

[
  {
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "vendor": "Linux",
    "product": "Linux",
    "versions": [
      {
        "status": "affected",
        "version": "0e94682b73bfa6c44c98af7a26771c9c08c055d5",
        "lessThan": "92cc0153324b6ae8577a39f5bf2cd83c9a34ea6a",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "0e94682b73bfa6c44c98af7a26771c9c08c055d5",
        "lessThan": "d124ab17024cc85a1079b7810a018a497ebc13da",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "0e94682b73bfa6c44c98af7a26771c9c08c055d5",
        "lessThan": "aff037078ecaecf34a7c2afab1341815f90fba5e",
        "versionType": "git"
      }
    ],
    "programFiles": [
      "include/linux/psi.h",
      "include/linux/psi_types.h",
      "kernel/cgroup/cgroup.c",
      "kernel/sched/psi.c"
    ],
    "defaultStatus": "unaffected"
  },
  {
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "vendor": "Linux",
    "product": "Linux",
    "versions": [
      {
        "status": "affected",
        "version": "5.2"
      },
      {
        "status": "unaffected",
        "version": "0",
        "lessThan": "5.2",
        "versionType": "semver"
      },
      {
        "status": "unaffected",
        "version": "6.1.42",
        "versionType": "semver",
        "lessThanOrEqual": "6.1.*"
      },
      {
        "status": "unaffected",
        "version": "6.4.7",
        "versionType": "semver",
        "lessThanOrEqual": "6.4.*"
      },
      {
        "status": "unaffected",
        "version": "6.5",
        "versionType": "original_commit_for_fix",
        "lessThanOrEqual": "*"
      }
    ],
    "programFiles": [
      "include/linux/psi.h",
      "include/linux/psi_types.h",
      "kernel/cgroup/cgroup.c",
      "kernel/sched/psi.c"
    ],
    "defaultStatus": "affected"
  }
]
Related CVEs
CVE-2023-54019

Source reference: /cveMetadata/cveId

Publisher severity

high

Source reference: /containers/cna/metrics

Event
#30334 · Revision 1
Added to Heist Feed
Publisher date
Read the original announcement