{"id":"CVE-2022-50417","state":"PUBLISHED","title":"drm/panfrost: Fix GEM handle creation ref-counting","description":"In the Linux kernel, the following vulnerability has been resolved:\n\ndrm/panfrost: Fix GEM handle creation ref-counting\n\npanfrost_gem_create_with_handle() previously returned a BO but with the\nonly reference being from the handle, which user space could in theory\nguess and release, causing a use-after-free. Additionally if the call to\npanfrost_gem_mapping_get() in panfrost_ioctl_create_bo() failed then\na(nother) reference on the BO was dropped.\n\nThe _create_with_handle() is a problematic pattern, so ditch it and\ninstead create the handle in panfrost_ioctl_create_bo(). If the call to\npanfrost_gem_mapping_get() fails then this means that user space has\nindeed gone behind our back and freed the handle. In which case just\nreturn an error code.","publishedAt":"2025-09-18T16:04:00.512Z","updatedAt":"2026-08-05T08:58:42.522Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"f3ba91228e8e917e5bd6c4b72bfe846933d17370","status":"affected","lessThan":"0b70f6ea4d4f2b4d4b291d86ab76b4d07394932c","versionType":"git"},{"version":"f3ba91228e8e917e5bd6c4b72bfe846933d17370","status":"affected","lessThan":"4f1105ee72d8c7c35d90e3491b31b2d9d6b7e33a","versionType":"git"},{"version":"f3ba91228e8e917e5bd6c4b72bfe846933d17370","status":"affected","lessThan":"3f9feffa8a5ab08b4e298a27b1aa7204a7d42ca2","versionType":"git"},{"version":"f3ba91228e8e917e5bd6c4b72bfe846933d17370","status":"affected","lessThan":"ba3d2c2380e7129b525a787489c0b7e819a3b898","versionType":"git"},{"version":"f3ba91228e8e917e5bd6c4b72bfe846933d17370","status":"affected","lessThan":"4217c6ac817451d5116687f3cc6286220dc43d49","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpu/drm/panfrost/panfrost_drv.c","drivers/gpu/drm/panfrost/panfrost_gem.c","drivers/gpu/drm/panfrost/panfrost_gem.h"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.2","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.2","versionType":"semver"},{"version":"5.10.163","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.87","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.0.19","status":"unaffected","lessThanOrEqual":"6.0.*","versionType":"semver"},{"version":"6.1.5","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpu/drm/panfrost/panfrost_drv.c","drivers/gpu/drm/panfrost/panfrost_gem.c","drivers/gpu/drm/panfrost/panfrost_gem.h"]}],"references":["https://git.kernel.org/stable/c/0b70f6ea4d4f2b4d4b291d86ab76b4d07394932c","https://git.kernel.org/stable/c/4f1105ee72d8c7c35d90e3491b31b2d9d6b7e33a","https://git.kernel.org/stable/c/3f9feffa8a5ab08b4e298a27b1aa7204a7d42ca2","https://git.kernel.org/stable/c/ba3d2c2380e7129b525a787489c0b7e819a3b898","https://git.kernel.org/stable/c/4217c6ac817451d5116687f3cc6286220dc43d49"],"weaknesses":["CWE-416"],"ingestedAt":"2026-10-29T20:05:26.763Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2022/50xxx/CVE-2022-50417.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2022-50417","state":"PUBLISHED","datePublished":"2025-09-18T16:04:00.512Z","dateUpdated":"2026-08-05T08:58:42.522Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-09-17T14:53:07.003Z"},"containers":{"cna":{"title":"drm/panfrost: Fix GEM handle creation ref-counting","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ndrm/panfrost: Fix GEM handle creation ref-counting\n\npanfrost_gem_create_with_handle() previously returned a BO but with the\nonly reference being from the handle, which user space could in theory\nguess and release, causing a use-after-free. Additionally if the call to\npanfrost_gem_mapping_get() in panfrost_ioctl_create_bo() failed then\na(nother) reference on the BO was dropped.\n\nThe _create_with_handle() is a problematic pattern, so ditch it and\ninstead create the handle in panfrost_ioctl_create_bo(). If the call to\npanfrost_gem_mapping_get() fails then this means that user space has\nindeed gone behind our back and freed the handle. In which case just\nreturn an error code."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"f3ba91228e8e917e5bd6c4b72bfe846933d17370","status":"affected","lessThan":"0b70f6ea4d4f2b4d4b291d86ab76b4d07394932c","versionType":"git"},{"version":"f3ba91228e8e917e5bd6c4b72bfe846933d17370","status":"affected","lessThan":"4f1105ee72d8c7c35d90e3491b31b2d9d6b7e33a","versionType":"git"},{"version":"f3ba91228e8e917e5bd6c4b72bfe846933d17370","status":"affected","lessThan":"3f9feffa8a5ab08b4e298a27b1aa7204a7d42ca2","versionType":"git"},{"version":"f3ba91228e8e917e5bd6c4b72bfe846933d17370","status":"affected","lessThan":"ba3d2c2380e7129b525a787489c0b7e819a3b898","versionType":"git"},{"version":"f3ba91228e8e917e5bd6c4b72bfe846933d17370","status":"affected","lessThan":"4217c6ac817451d5116687f3cc6286220dc43d49","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpu/drm/panfrost/panfrost_drv.c","drivers/gpu/drm/panfrost/panfrost_gem.c","drivers/gpu/drm/panfrost/panfrost_gem.h"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.2","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.2","versionType":"semver"},{"version":"5.10.163","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.87","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.0.19","status":"unaffected","lessThanOrEqual":"6.0.*","versionType":"semver"},{"version":"6.1.5","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpu/drm/panfrost/panfrost_drv.c","drivers/gpu/drm/panfrost/panfrost_gem.c","drivers/gpu/drm/panfrost/panfrost_gem.h"]}],"references":[{"url":"https://git.kernel.org/stable/c/0b70f6ea4d4f2b4d4b291d86ab76b4d07394932c"},{"url":"https://git.kernel.org/stable/c/4f1105ee72d8c7c35d90e3491b31b2d9d6b7e33a"},{"url":"https://git.kernel.org/stable/c/3f9feffa8a5ab08b4e298a27b1aa7204a7d42ca2"},{"url":"https://git.kernel.org/stable/c/ba3d2c2380e7129b525a787489c0b7e819a3b898"},{"url":"https://git.kernel.org/stable/c/4217c6ac817451d5116687f3cc6286220dc43d49"}],"metrics":[{"cvssV3_1":{"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"},"scenarios":[{"lang":"en","value":"AV:L - The bug is reached only via local DRM ioctls on the Panfrost render node (/dev/dri/renderD*): DRM_IOCTL_PANFROST_CREATE_BO and concurrent DRM_IOCTL_GEM_CLOSE. It is not reachable from network packet processing or adjacent-network protocols.\nAC:L - The attacker controls both sides of the race by issuing CREATE_BO on one thread while closing the predictable sequential IDR handle from another; GEM handles allocate from 1 upward so the next handle is trivial to guess. No conditions outside the attacker’s influence are required.\nPR:L - CREATE_BO is marked DRM_RENDER_ALLOW and needs only an open render-node FD, which unprivileged users routinely have on Mali devices (Android phones, ARM SBCs). No CAP_SYS_ADMIN or init-namespace root is required.\nUI:N - The attacker triggers the UAF entirely with their own ioctls; no other user action such as mounting a filesystem or opening a malicious file is needed.\nS:U - This is a kernel heap use-after-free enabling privilege escalation within the same OS security authority. It does not cross a VM, IOMMU isolation, or other Changed-scope boundary.\nC:H - The dangling panfrost_gem_object pointer after GEM_CLOSE is a classic use-after-free; reclaiming the freed object via heap spray can yield arbitrary kernel memory reads.\nI:H - The same UAF/refcount corruption allows reallocation of the freed GEM object and adjacent structures, enabling arbitrary kernel writes and control-flow hijacking.\nA:H - Use of the freed BO (e.g., locking bo->mappings.lock in panfrost_gem_mapping_get) or the erroneous extra drm_gem_object_put causes kernel oops/panic, so availability impact is High."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T08:58:42.522Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.2","versionEndExcluding":"5.10.163"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.2","versionEndExcluding":"5.15.87"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.2","versionEndExcluding":"6.0.19"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.2","versionEndExcluding":"6.1.5"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.2","versionEndExcluding":"6.2"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":7.8,"attackVector":"LOCAL","baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","integrityImpact":"HIGH","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"LOW","confidentialityImpact":"HIGH"}},{"other":{"type":"ssvc","content":{"id":"CVE-2022-50417","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2026-01-14T19:10:45.262200Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-416","lang":"en","type":"CWE","description":"CWE-416 Use After Free"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-01-14T19:13:09.937Z"}}]}}}