{"id":"CVE-2026-72138","state":"PUBLISHED","title":"xen/gntdev: fix error handling in ioctl","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nxen/gntdev: fix error handling in ioctl\n\nWhen gntdev_ioctl_map_grant_ref() fails to copy the operation result\nback to userspace after successfully adding the mapping to the list,\nthe error path returns -EFAULT without releasing the reference\nacquired by gntdev_alloc_map(). The mapping remains in priv->maps\nwith a refcount of 1, causing a memory leak and a dangling list\nentry.\n\nAdditionally, gntdev_add_map() may modify map->index to avoid overlap\nwith existing mappings. Therefore, the index returned to userspace\nmust be obtained after gntdev_add_map() completes.\n\nFix this by holding the mutex across gntdev_add_map(), retrieving\nthe correct index, and copy_to_user(). If copy_to_user() fails,\nremove the mapping from the list and release the reference while\nstill holding the lock.\n\n\nFix these issues by properly handling all error cases.","publishedAt":"2026-08-15T05:53:12.549Z","updatedAt":"2026-08-17T05:08:56.108Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"68b025c813c2eb41ff25628e3d4952d5185eb1a4","status":"affected","lessThan":"52dc40ef0cfee6ae89b7524967e73f0ba37906d7","versionType":"git"},{"version":"68b025c813c2eb41ff25628e3d4952d5185eb1a4","status":"affected","lessThan":"1dd9cb98fe228e017fff9efb33862ff38c741b65","versionType":"git"},{"version":"68b025c813c2eb41ff25628e3d4952d5185eb1a4","status":"affected","lessThan":"6df926130aee6cab9b5d2e5b7862e49ccac348dc","versionType":"git"},{"version":"68b025c813c2eb41ff25628e3d4952d5185eb1a4","status":"affected","lessThan":"311011f8cc206c5af2877b03e3f627ee1b8fe024","versionType":"git"},{"version":"68b025c813c2eb41ff25628e3d4952d5185eb1a4","status":"affected","lessThan":"18a693733f7ad004e1ab0466693121ca70cd95dd","versionType":"git"},{"version":"68b025c813c2eb41ff25628e3d4952d5185eb1a4","status":"affected","lessThan":"16d3ccdabb8dee9be2cdcd6d3f9a125572ec0454","versionType":"git"},{"version":"68b025c813c2eb41ff25628e3d4952d5185eb1a4","status":"affected","lessThan":"6883269a323609f68f6faa903f8f8ff3d191cec8","versionType":"git"},{"version":"68b025c813c2eb41ff25628e3d4952d5185eb1a4","status":"affected","lessThan":"45ca1afe2fd14c04e37227e79d3f8455831d8408","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/xen/gntdev.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.39","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.39","versionType":"semver"},{"version":"5.10.261","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.212","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.178","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.145","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.97","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.40","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.1.5","status":"unaffected","lessThanOrEqual":"7.1.*","versionType":"semver"},{"version":"7.2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/xen/gntdev.c"]}],"references":["https://git.kernel.org/stable/c/52dc40ef0cfee6ae89b7524967e73f0ba37906d7","https://git.kernel.org/stable/c/1dd9cb98fe228e017fff9efb33862ff38c741b65","https://git.kernel.org/stable/c/6df926130aee6cab9b5d2e5b7862e49ccac348dc","https://git.kernel.org/stable/c/311011f8cc206c5af2877b03e3f627ee1b8fe024","https://git.kernel.org/stable/c/18a693733f7ad004e1ab0466693121ca70cd95dd","https://git.kernel.org/stable/c/16d3ccdabb8dee9be2cdcd6d3f9a125572ec0454","https://git.kernel.org/stable/c/6883269a323609f68f6faa903f8f8ff3d191cec8","https://git.kernel.org/stable/c/45ca1afe2fd14c04e37227e79d3f8455831d8408"],"weaknesses":[],"ingestedAt":"2026-10-29T20:12:58.252Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/72xxx/CVE-2026-72138.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-72138","state":"PUBLISHED","datePublished":"2026-08-15T05:53:12.549Z","dateUpdated":"2026-08-17T05:08:56.108Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-08-09T03:40:39.908Z"},"containers":{"cna":{"title":"xen/gntdev: fix error handling in ioctl","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nxen/gntdev: fix error handling in ioctl\n\nWhen gntdev_ioctl_map_grant_ref() fails to copy the operation result\nback to userspace after successfully adding the mapping to the list,\nthe error path returns -EFAULT without releasing the reference\nacquired by gntdev_alloc_map(). The mapping remains in priv->maps\nwith a refcount of 1, causing a memory leak and a dangling list\nentry.\n\nAdditionally, gntdev_add_map() may modify map->index to avoid overlap\nwith existing mappings. Therefore, the index returned to userspace\nmust be obtained after gntdev_add_map() completes.\n\nFix this by holding the mutex across gntdev_add_map(), retrieving\nthe correct index, and copy_to_user(). If copy_to_user() fails,\nremove the mapping from the list and release the reference while\nstill holding the lock.\n\n\nFix these issues by properly handling all error cases."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"68b025c813c2eb41ff25628e3d4952d5185eb1a4","status":"affected","lessThan":"52dc40ef0cfee6ae89b7524967e73f0ba37906d7","versionType":"git"},{"version":"68b025c813c2eb41ff25628e3d4952d5185eb1a4","status":"affected","lessThan":"1dd9cb98fe228e017fff9efb33862ff38c741b65","versionType":"git"},{"version":"68b025c813c2eb41ff25628e3d4952d5185eb1a4","status":"affected","lessThan":"6df926130aee6cab9b5d2e5b7862e49ccac348dc","versionType":"git"},{"version":"68b025c813c2eb41ff25628e3d4952d5185eb1a4","status":"affected","lessThan":"311011f8cc206c5af2877b03e3f627ee1b8fe024","versionType":"git"},{"version":"68b025c813c2eb41ff25628e3d4952d5185eb1a4","status":"affected","lessThan":"18a693733f7ad004e1ab0466693121ca70cd95dd","versionType":"git"},{"version":"68b025c813c2eb41ff25628e3d4952d5185eb1a4","status":"affected","lessThan":"16d3ccdabb8dee9be2cdcd6d3f9a125572ec0454","versionType":"git"},{"version":"68b025c813c2eb41ff25628e3d4952d5185eb1a4","status":"affected","lessThan":"6883269a323609f68f6faa903f8f8ff3d191cec8","versionType":"git"},{"version":"68b025c813c2eb41ff25628e3d4952d5185eb1a4","status":"affected","lessThan":"45ca1afe2fd14c04e37227e79d3f8455831d8408","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/xen/gntdev.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.39","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.39","versionType":"semver"},{"version":"5.10.261","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.212","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.178","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.145","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.97","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.40","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.1.5","status":"unaffected","lessThanOrEqual":"7.1.*","versionType":"semver"},{"version":"7.2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/xen/gntdev.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/52dc40ef0cfee6ae89b7524967e73f0ba37906d7"},{"url":"https://git.kernel.org/stable/c/1dd9cb98fe228e017fff9efb33862ff38c741b65"},{"url":"https://git.kernel.org/stable/c/6df926130aee6cab9b5d2e5b7862e49ccac348dc"},{"url":"https://git.kernel.org/stable/c/311011f8cc206c5af2877b03e3f627ee1b8fe024"},{"url":"https://git.kernel.org/stable/c/18a693733f7ad004e1ab0466693121ca70cd95dd"},{"url":"https://git.kernel.org/stable/c/16d3ccdabb8dee9be2cdcd6d3f9a125572ec0454"},{"url":"https://git.kernel.org/stable/c/6883269a323609f68f6faa903f8f8ff3d191cec8"},{"url":"https://git.kernel.org/stable/c/45ca1afe2fd14c04e37227e79d3f8455831d8408"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-17T05:08:56.108Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.39","versionEndExcluding":"5.10.261"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.39","versionEndExcluding":"5.15.212"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.39","versionEndExcluding":"6.1.178"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.39","versionEndExcluding":"6.6.145"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.39","versionEndExcluding":"6.12.97"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.39","versionEndExcluding":"6.18.40"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.39","versionEndExcluding":"7.1.5"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.39","versionEndExcluding":"7.2"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}