DEBIAN-CVE-2022-50471

Source
https://security-tracker.debian.org/tracker/CVE-2022-50471
Import Source
https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2022-50471.json
JSON Data
https://api.osv.dev/v1/vulns/DEBIAN-CVE-2022-50471
Upstream
Published
2025-10-04T16:15:43.540Z
Modified
2025-11-20T10:16:26.654616Z
Summary
[none]
Details

In the Linux kernel, the following vulnerability has been resolved: xen/gntdev: Accommodate VMA splitting Prior to this commit, the gntdev driver code did not handle the following scenario correctly with paravirtualized (PV) Xen domains: * User process sets up a gntdev mapping composed of two grant mappings (i.e., two pages shared by another Xen domain). * User process munmap()s one of the pages. * User process munmap()s the remaining page. * User process exits. In the scenario above, the user process would cause the kernel to log the following messages in dmesg for the first munmap(), and the second munmap() call would result in similar log messages: BUG: Bad page map in process doublemap.test pte:... pmd:... page:0000000057c97bff refcount:1 mapcount:-1 \ mapping:0000000000000000 index:0x0 pfn:... ... page dumped because: bad pte ... file:gntdev fault:0x0 mmap:gntdevmmap [xengntdev] readpage:0x0 ... Call Trace: <TASK> dumpstacklvl+0x46/0x5e printbadpte.cold+0x66/0xb6 unmappagerange+0x7e5/0xdc0 unmapvmas+0x78/0xf0 unmapregion+0xa8/0x110 _domunmap+0x1ea/0x4e0 _vmmunmap+0x75/0x120 _x64sysmunmap+0x28/0x40 dosyscall64+0x38/0x90 entrySYSCALL64afterhwframe+0x61/0xcb ... For each munmap() call, the Xen hypervisor (if built with CONFIGDEBUG) would print out the following and trigger a general protection fault in the affected Xen PV domain: (XEN) d0v... Attempt to implicitly unmap d0's grant PTE ... (XEN) d0v... Attempt to implicitly unmap d0's grant PTE ... As of this writing, gntdevgrantmap structure's vma field (referred to as map->vma below) is mainly used for checking the start and end addresses of mappings. However, with split VMAs, these may change, and there could be more than one VMA associated with a gntdev mapping. Hence, remove the use of map->vma and rely on map->pagesvmstart for the original start address and on (map->count << PAGESHIFT) for the original mapping size. Let the invalidate() and findspecialpage() hooks use these. Also, given that there can be multiple VMAs associated with a gntdev mapping, move the "mmuintervalnotifierremove(&map->notifier)" call to the end of gntdevputmap, so that the MMU notifier is only removed after the closing of the last remaining VMA. Finally, use an atomic to prevent inadvertent gntdev mapping re-use, instead of using the map->livegrants atomic counter and/or the map->vma pointer (the latter of which is now removed). This prevents the userspace from mmap()'ing (with MAPFIXED) a gntdev mapping over the same address range as a previously set up gntdev mapping. This scenario can be summarized with the following call-trace, which was valid prior to this commit: mmap gntdevmmap mmap (repeat mmap with MAPFIXED over the same address range) gntdevinvalidate unmapgrantpages (sets 'beingremoved' entries to true) gnttabunmaprefsasync unmapsinglevma gntdevmmap (maps the shared pages again) munmap gntdevinvalidate unmapgrantpages (no-op because 'beingremoved' entries are true) unmapsinglevma (For PV domains, Xen reports that a granted page is being unmapped and triggers a general protection fault in the affected domain, if Xen was built with CONFIGDEBUG) The fix for this last scenario could be worth its own commit, but we opted for a single commit, because removing the gntdevgrantmap structure's vma field requires guarding the entry to gntdevmmap(), and the live_grants atomic counter is not sufficient on its own to prevent the mmap() over a pre-existing mapping.

References

Affected packages

Debian:11 / linux

Package

Name
linux
Purl
pkg:deb/debian/linux?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
5.10.158-1

Affected versions

5.*

5.10.46-4
5.10.46-5
5.10.70-1~bpo10+1
5.10.70-1
5.10.84-1
5.10.92-1~bpo10+1
5.10.92-1
5.10.92-2
5.10.103-1~bpo10+1
5.10.103-1
5.10.106-1
5.10.113-1
5.10.120-1~bpo10+1
5.10.120-1
5.10.127-1
5.10.127-2~bpo10+1
5.10.127-2
5.10.136-1
5.10.140-1
5.10.148-1
5.10.149-1
5.10.149-2

Ecosystem specific

{
    "urgency": "not yet assigned"
}

Debian:12 / linux

Package

Name
linux
Purl
pkg:deb/debian/linux?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
6.0.3-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}

Debian:13 / linux

Package

Name
linux
Purl
pkg:deb/debian/linux?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
6.0.3-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}

Debian:14 / linux

Package

Name
linux
Purl
pkg:deb/debian/linux?arch=source

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
6.0.3-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}