{"id":"CVE-2022-50059","state":"PUBLISHED","title":"ceph: don't leak snap_rwsem in handle_cap_grant","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nceph: don't leak snap_rwsem in handle_cap_grant\n\nWhen handle_cap_grant is called on an IMPORT op, then the snap_rwsem is\nheld and the function is expected to release it before returning. It\ncurrently fails to do that in all cases which could lead to a deadlock.","publishedAt":"2025-06-18T11:02:07.945Z","updatedAt":"2026-10-15T21:31:18.312Z","severity":{"score":7.5,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"6f05b30ea063a2a05dda47a4105a69267ae5270f","status":"affected","lessThan":"aee18421bda6bf12a7cba6a3d7751c0e1cfd0094","versionType":"git"},{"version":"6f05b30ea063a2a05dda47a4105a69267ae5270f","status":"affected","lessThan":"f546faa216d0f53a42ca73ba1fd8c48765b22d77","versionType":"git"},{"version":"6f05b30ea063a2a05dda47a4105a69267ae5270f","status":"affected","lessThan":"a090cc69699ec2d11b5e34cee8c61f0d4b0068cb","versionType":"git"},{"version":"6f05b30ea063a2a05dda47a4105a69267ae5270f","status":"affected","lessThan":"58dd4385577ed7969b80cdc9e2a31575aba6c712","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/ceph/caps.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.8","versionType":"semver"},{"version":"5.10.138","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.63","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"5.19.4","status":"unaffected","lessThanOrEqual":"5.19.*","versionType":"semver"},{"version":"6.0","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/ceph/caps.c"]}],"references":["https://git.kernel.org/stable/c/aee18421bda6bf12a7cba6a3d7751c0e1cfd0094","https://git.kernel.org/stable/c/f546faa216d0f53a42ca73ba1fd8c48765b22d77","https://git.kernel.org/stable/c/a090cc69699ec2d11b5e34cee8c61f0d4b0068cb","https://git.kernel.org/stable/c/58dd4385577ed7969b80cdc9e2a31575aba6c712"],"weaknesses":[],"ingestedAt":"2026-10-29T20:05:26.763Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2022/50xxx/CVE-2022-50059.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2022-50059","state":"PUBLISHED","datePublished":"2025-06-18T11:02:07.945Z","dateUpdated":"2026-10-15T21:31:18.312Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-06-18T10:57:27.404Z"},"containers":{"cna":{"title":"ceph: don't leak snap_rwsem in handle_cap_grant","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nceph: don't leak snap_rwsem in handle_cap_grant\n\nWhen handle_cap_grant is called on an IMPORT op, then the snap_rwsem is\nheld and the function is expected to release it before returning. It\ncurrently fails to do that in all cases which could lead to a deadlock."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"6f05b30ea063a2a05dda47a4105a69267ae5270f","status":"affected","lessThan":"aee18421bda6bf12a7cba6a3d7751c0e1cfd0094","versionType":"git"},{"version":"6f05b30ea063a2a05dda47a4105a69267ae5270f","status":"affected","lessThan":"f546faa216d0f53a42ca73ba1fd8c48765b22d77","versionType":"git"},{"version":"6f05b30ea063a2a05dda47a4105a69267ae5270f","status":"affected","lessThan":"a090cc69699ec2d11b5e34cee8c61f0d4b0068cb","versionType":"git"},{"version":"6f05b30ea063a2a05dda47a4105a69267ae5270f","status":"affected","lessThan":"58dd4385577ed7969b80cdc9e2a31575aba6c712","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/ceph/caps.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.8","versionType":"semver"},{"version":"5.10.138","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.63","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"5.19.4","status":"unaffected","lessThanOrEqual":"5.19.*","versionType":"semver"},{"version":"6.0","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/ceph/caps.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/aee18421bda6bf12a7cba6a3d7751c0e1cfd0094"},{"url":"https://git.kernel.org/stable/c/f546faa216d0f53a42ca73ba1fd8c48765b22d77"},{"url":"https://git.kernel.org/stable/c/a090cc69699ec2d11b5e34cee8c61f0d4b0068cb"},{"url":"https://git.kernel.org/stable/c/58dd4385577ed7969b80cdc9e2a31575aba6c712"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","baseScore":7.5,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:N - The bug is reached while processing CEPH_MSG_CLIENT_CAPS IMPORT messages from a remote Ceph MDS over the TCP messenger into ceph_handle_caps()→handle_cap_grant(); a malicious, compromised, or on-path MDS triggers it purely with network traffic.\nAC:L - A malicious MDS fully controls IMPORT content and migrate-seq values, and can force the i_auth_cap!=cap state that skips up_read(&snap_rwsem); the condition is attacker-driven and reliably repeatable with no uncontrolled race or layout dependency.\nPR:N - Exploitation requires no privileges on the victim client—the attacking MDS peer needs no local account or capability, matching other CephFS client MDS-message bugs scored PR:N.\nUI:N - With CephFS already mounted (normal deployment state), the MDS can unilaterally emit cap IMPORT messages during migration/reconnect without any further victim action at exploit time.\nS:U - The leaked snap_rwsem and resulting hang stay inside the client kernel/CephFS mount authority; there is no VM escape, IOMMU bypass, or other cross-boundary effect.\nC:N - The defect is a missing up_read on snap_rwsem that only deadlocks waiters; it does not corrupt memory, disclose kernel contents, or provide a read primitive.\nI:N - There is no write primitive, type confusion, or other integrity-affecting corruption—only a lock leak that blocks subsequent snap_rwsem writers with no attacker-controlled data modification.\nA:H - Leaking the snap_rwsem read lock causes subsequent down_write paths (snap updates, IMPORT with snaptrace, realm work) and CephFS operations to hang indefinitely, a full denial of service requiring reboot."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T08:57:15.234Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"5.10.138"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"5.15.63"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"5.19.4"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"6.0"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2022-50059","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"yes"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2026-10-15T21:30:09.490540Z"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-10-15T21:31:18.312Z"}}]}}}