CVE-2021-3543: Use After Free

Published Apr 23, 2021
·
Updated

A failing usercopy of the slot uid will lead to a stale entry in the file descriptor table as putunusedfd() won't release it. This enables userland to refer to a dangling 'file' object through that still valid file descriptor, leading to all kinds of use-after-free exploitation scenarios.

Exchanging putunusedfd() for closefd(), ksysclose() or alike won't solve the underlying issue, as the file descriptor might have been replaced in the meantime, e.g. via userland calling close() on it (leading to a NULL pointer dereference in the error handling code as 'fget(enclavefd)' will return a NULL pointer) or by dup2()'ing a completely different file object to that very file descriptor, leading to the same situation: a dangling file descriptor pointing to a freed object -- just in this case to a file object of user's choosing.

Generally speaking, after the call to fdinstall() the file descriptor is live and userland is free to do whatever with it. We cannot rely on it to still refer to our enclave object afterwards. In fact, by abusing userfaultfd() userland can hit the condition without any racing and abuse the error handling in the nitro code as it pleases.

Other sources

A flaw null pointer dereference in the Nitro Enclaves kernel driver was found in the way that Enclaves VMs forces closures on the enclave file descriptor. A local user of a host machine could use this flaw to crash the system or escalate their privileges on the system.

Affected Software

7 affected componentsFixes available
redhat/kernel-rt<0:4.18.0-305.3.1.rt7.75.el8_4
0:4.18.0-305.3.1.rt7.75.el8_4
redhat/kernel<0:4.18.0-305.3.1.el8_4
0:4.18.0-305.3.1.el8_4
redhat/kernel<4.18.0
4.18.0
Nitro Enclaves Project Nitro Enclaves<5.10.0
redhat Enterprise Linux=8.0
Fedoraproject Fedora=34
debian/linux
5.10.223-15.10.234-16.1.129-16.1.135-16.12.25-16.12.27-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade redhat/kernel-rt to a version that resolves this vulnerability.

    Fixed in 0:4.18.0-305.3.1.rt7.75.el8_4
  2. Upgrade

    Upgrade redhat/kernel to a version that resolves this vulnerability.

    Fixed in 0:4.18.0-305.3.1.el8_4
  3. Upgrade

    Upgrade redhat/kernel to a version that resolves this vulnerability.

    Fixed in 4.18.0
  4. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 5.10.223-1Fixed in 5.10.234-1Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.25-1Fixed in 6.12.27-1

Event History

Apr 29, 2021
CVE Published
12:00 AM
Jun 1, 2021
CVE Published
via MITRE·01:20 PM
Data Sourced
via MITRE·01:20 PM
DescriptionWeakness
Data Sourced
via NVD·02:15 PM
DescriptionSeverityWeaknessAffected Software
Jan 11, 2024
Data Sourced
via Launchpad·11:57 PM
Description
Sep 16, 2024
Data Sourced
via Ubuntu·02:33 AM
RemedyDescriptionSeverityAffected Software
Oct 10, 58461
Event
02:22 AM

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is the severity of CVE-2021-3543?

CVE-2021-3543 is considered to have a high severity due to its potential for use-after-free exploitation scenarios.

2

How do I fix CVE-2021-3543?

To fix CVE-2021-3543, users should update to kernel versions 0:4.18.0-305.3.1.rt7.75.el8_4, 0:4.18.0-305.3.1.el8_4, or appropriate patched versions from Red Hat or Debian.

3

Which software is affected by CVE-2021-3543?

CVE-2021-3543 affects multiple versions of the kernel, specifically those prior to certain patched releases from Red Hat and Debian.

4

What type of vulnerability is CVE-2021-3543?

CVE-2021-3543 is a use-after-free vulnerability that can lead to exploitation via dangling file descriptors.

5

Can CVE-2021-3543 be exploited remotely?

Yes, CVE-2021-3543 could potentially be exploited remotely if an attacker has access to affected kernel components.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203