Skip to content
Heist/ feed
High

drm/amdkfd: Fix double release compute pasid

Type: advisorySource: Official CVE List1 source record

In the Linux kernel, the following vulnerability has been resolved: drm/amdkfd: Fix double release compute pasid If kfd_process_device_init_vm returns failure after vm is converted to compute vm and vm->pasid set to compute pasid, KFD will not take pdd->drm_file reference. As a result, drm close file handler maybe called to release the compute pasid before KFD process destroy worker to release the same pasid and set vm->pasid to zero, this generates below WARNING backtrace and NULL pointer access. Add helper amdgpu_amdkfd_gpuvm_set_vm_pasid and call it at the last step of kfd_process_device_init_vm, to ensure vm pasid is the original pasid if acquiring vm failed or is the compute pasid with pdd->drm_file reference taken to avoid double release same pasid. amdgpu: Failed to create process VM object ida_free called for id=32770 which is not allocated. WARNING: CPU: 57 PID: 72542 at ../lib/idr.c:522 ida_free+0x96/0x140 RIP: 0010:ida_free+0x96/0x140 Call Trace: amdgpu_pasid_free_delayed+0xe1/0x2a0 [amdgpu] amdgpu_driver_postclose_kms+0x2d8/0x340 [amdgpu] drm_file_free.part.13+0x216/0x270 [drm] drm_close_helper.isra.14+0x60/0x70 [drm] drm_release+0x6e/0xf0 [drm] __fput+0xcc/0x280 ____fput+0xe/0x20 task_work_run+0x96/0xc0 do_exit+0x3d0/0xc10 BUG: kernel NULL pointer dereference, address: 0000000000000000 RIP: 0010:ida_free+0x76/0x140 Call Trace: amdgpu_pasid_free_delayed+0xe1/0x2a0 [amdgpu] amdgpu_driver_postclose_kms+0x2d8/0x340 [amdgpu] drm_file_free.part.13+0x216/0x270 [drm] drm

Announced Source revision 1
Original source ↗

CVE-2022-50303

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-2022-50303

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": "1685b01a858872075bc258a350153de0c7e95404",
        "lessThan": "89f0d766c9e3fdeafbed6f855d433c2768cde862",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "1685b01a858872075bc258a350153de0c7e95404",
        "lessThan": "a02c07b619899179384fde06f951530438a3512d",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "1685b01a858872075bc258a350153de0c7e95404",
        "lessThan": "1a799c4c190ea9f0e81028e3eb3037ed0ab17ff5",
        "versionType": "git"
      }
    ],
    "programFiles": [
      "drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h",
      "drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c",
      "drivers/gpu/drm/amd/amdkfd/kfd_process.c"
    ],
    "defaultStatus": "unaffected"
  },
  {
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "vendor": "Linux",
    "product": "Linux",
    "versions": [
      {
        "status": "affected",
        "version": "4.20"
      },
      {
        "status": "unaffected",
        "version": "0",
        "lessThan": "4.20",
        "versionType": "semver"
      },
      {
        "status": "unaffected",
        "version": "6.0.19",
        "versionType": "semver",
        "lessThanOrEqual": "6.0.*"
      },
      {
        "status": "unaffected",
        "version": "6.1.5",
        "versionType": "semver",
        "lessThanOrEqual": "6.1.*"
      },
      {
        "status": "unaffected",
        "version": "6.2",
        "versionType": "original_commit_for_fix",
        "lessThanOrEqual": "*"
      }
    ],
    "programFiles": [
      "drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h",
      "drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c",
      "drivers/gpu/drm/amd/amdkfd/kfd_process.c"
    ],
    "defaultStatus": "affected"
  }
]
Related CVEs
CVE-2022-50303

Source reference: /cveMetadata/cveId

Publisher severity

high

Source reference: /containers/cna/metrics

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