CVE-2021-46927

Source
https://nvd.nist.gov/vuln/detail/CVE-2021-46927
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2021-46927.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2021-46927
Related
Published
2024-02-27T10:15:07Z
Modified
2024-09-11T02:00:05Z
Severity
  • 5.5 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
[none]
Details

In the Linux kernel, the following vulnerability has been resolved:

nitroenclaves: Use getuserpagesunlocked() call to handle mmap assert

After commit 5b78ed24e8ec ("mm/pagemap: add mmapassertlocked() annotations to findvma*()"), the call to getuser_pages() will trigger the mmap assert.

static inline void mmapassertlocked(struct mmstruct *mm) { lockdepassertheld(&mm->mmaplock); VMBUGONMM(!rwsemislocked(&mm->mmaplock), mm); }

[ 62.521410] kernel BUG at include/linux/mmaplock.h:156! ........................................................... [ 62.538938] RIP: 0010:findvma+0x32/0x80 ........................................................... [ 62.605889] Call Trace: [ 62.608502] <TASK> [ 62.610956] ? locktimerbase+0x61/0x80 [ 62.614106] findextendvma+0x19/0x80 [ 62.617195] _getuserpages+0x9b/0x6a0 [ 62.620356] _guplongtermlocked+0x42d/0x450 [ 62.623721] ? finishwait+0x41/0x80 [ 62.626748] ? _kmalloc+0x178/0x2f0 [ 62.629768] nesetusermemoryregionioctl.isra.0+0x225/0x6a0 [nitroenclaves] [ 62.635776] neenclaveioctl+0x1cf/0x6d7 [nitroenclaves] [ 62.639541] _x64sysioctl+0x82/0xb0 [ 62.642620] dosyscall64+0x3b/0x90 [ 62.645642] entrySYSCALL64afterhwframe+0x44/0xae

Use getuserpagesunlocked() when setting the enclave memory regions. That's a similar pattern as mmapreadlock() used together with getuser_pages().

References

Affected packages

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
5.15.15-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
5.15.15-1

Ecosystem specific

{
    "urgency": "not yet assigned"
}