CVE-2021-46927

Source
https://cve.org/CVERecord?id=CVE-2021-46927
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2021-46927.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2021-46927
Downstream
Related
Published
2024-02-27T10:15:07.410Z
Modified
2026-03-13T05:19:21.327190Z
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] ? finish_wait+0x41/0x80 [ 62.626748] ? __kmalloc+0x178/0x2f0 [ 62.629768] nesetusermemoryregionioctl.isra.0+0x225/0x6a0 [nitroenclaves] [ 62.635776] neenclaveioctl+0x1cf/0x6d7 [nitro_enclaves] [ 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

Git /

Affected ranges

Database specific

unresolved_ranges
[
    {
        "events": [
            {
                "introduced": "5.15.0"
            },
            {
                "fixed": "5.15.13"
            }
        ]
    }
]
source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2021-46927.json"