HIGH Introduced in 5.10
nitro_enclaves SlotAlloc UAF
CVE-2026-98775
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: nitro_enclaves: fix use-after-free on SLOT_ALLOC failure When ne_create_vm_ioctl() fails the SLOT_ALLOC request after anon_inode_getfile() has succeeded, the error path calls fput(enclave_file) and then frees ne_enclave. In normal userspace context, fput() defers the final __fput() via task_work. ne_enclave_release() therefore runs after ne_enclave has already been freed and dereferences ne_enclave->slot_uid, causing a use-after-free: KASAN: slab-use-after-free in ne_enclave_release. The enclave has no slot allocated and is not yet linked into the enclaves list on this error path, so ne_enclave_release() is expected to return early when slot_uid is zero. However, reading slot_uid already accesses the freed object. Clear enclave_file->private_data before fput() on the error path. ne_enclave_release() then returns immediately when private_data is NULL, leaving the ioctl error path as the sole owner of ne_enclave. This is safe because the file has not been fd_install()'d yet. Tested on an AWS EC2 m5.2xlarge with CONFIG_KASAN=y. Without the patch, the reproducer triggers a KASAN slab-use-after-free on every SLOT_ALLOC failure. With the patch, no KASAN report is produced and the SLOT_ALLOC error is still returned. Normal enclave creation and teardown are unaffected.
02KernelScan AI Analysis
Risk summary
A local user with access to the nitro_enclaves device can trigger a use-after-free in the kernel by causing a slot allocation failure during enclave creation. This allows privilege escalation to kernel level, potentially leading to full system compromise. The vulnerability affects systems running the nitro_enclaves driver, typically on AWS Nitro-based instances.
Vulnerability analysis
When creating an enclave, if the slot allocation request fails after the enclave file has been successfully created, the error path frees the enclave object while the file's release callback still holds a reference to it. Because fput() defers the final cleanup via task_work, the release callback executes after the enclave object has been freed and dereferences a field in the freed memory, causing a use-after-free. The fix clears the file's private data pointer before dropping the file reference, so the release callback sees a null pointer and returns early without accessing the freed object. Any local user who can open the nitro_enclaves device and issue the create VM ioctl can trigger this vulnerability by forcing a slot allocation failure.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.10 | 5.10 | 5.10.273 | 718965a5fcea |
| 5.15 | 5.10 | 5.15.224 | dac89ed976d9 |
| 6.1 | 5.10 | 6.1.191 | 8024c50b8763 |
| 6.12 | 5.10 | 6.12.113 | 466041d14f26 |
| 6.18 | 5.10 | 6.18.56 | f7fb6c2835ed |
| 6.6 | 5.10 | 6.6.160 | 8bde6f643ab6 |
| 7.2 | 5.10 | 7.2.10 | 43f78b328f39 |
| mainline | 5.10 | 7.3 | 9bc184a2eda8 |
| cip/6.12 | 5.10 | 6.12.114-cip34 | 466041d14f26 |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.114-cip34 |
| cip/6.1 | Affected — no CIP fix yet (latest 6.1.190-cip62) |
| cip/6.1-rt | Affected — no CIP fix yet (latest 6.1.189-cip61-rt32) |
| cip/5.10 | Affected — no CIP fix yet (latest 5.10.272-cip79) |
| cip/5.10-rt | Affected — no CIP fix yet (latest 5.10.272-cip79-rt35) |