CVE-2021-46939: tracing: Restructure trace_clock_global() to never block

Published Feb 27, 2024
·
Updated

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

tracing: Restructure traceclockglobal() to never block

It was reported that a fix to the ring buffer recursion detection would cause a hung machine when performing suspend / resume testing. The following backtrace was extracted from debugging that case:

Call Trace: traceclockglobal+0x91/0xa0 rbreservenext+0x237/0x460 ringbufferlockreserve+0x12a/0x3f0 tracebufferlockreserve+0x10/0x50 tracegraphreturn+0x1f/0x80 tracegraphreturn+0xb7/0xf0 ? traceclockglobal+0x91/0xa0 ftracereturntohandler+0x8b/0xf0 ? pvhash+0xa0/0xa0 returntohandler+0x15/0x30 ? ftracegraphcaller+0xa0/0xa0 ? traceclockglobal+0x91/0xa0 ? rbreservenext+0x237/0x460 ? ringbufferlockreserve+0x12a/0x3f0 ? traceeventbufferlockreserve+0x3c/0x120 ? traceeventbufferreserve+0x6b/0xc0 ? traceeventraweventdevicepmcallbackstart+0x125/0x2d0 ? dpmruncallback+0x3b/0xc0 ? pmopsisempty+0x50/0x50 ? platformgetirqbynameoptional+0x90/0x90 ? tracedevicepmcallbackstart+0x82/0xd0 ? dpmruncallback+0x49/0xc0

With the following RIP:

RIP: 0010:nativequeuedspinlockslowpath+0x69/0x200

Since the fix to the recursion detection would allow a single recursion to happen while tracing, this lead to the traceclockglobal() taking a spin lock and then trying to take it again:

ringbufferlockreserve() { traceclockglobal() { archspinlock() { queuedspinlockslowpath() { / lock taken / (something else gets traced by function graph tracer) ringbufferlockreserve() { traceclockglobal() { archspinlock() { queuedspinlockslowpath() { / DEAD LOCK! /

Tracing should never block, as it can lead to strange lockups like the above.

Restructure the traceclockglobal() code to instead of simply taking a lock to update the recorded "prevtime" simply use it, as two events happening on two different CPUs that calls this at the same time, really doesn't matter which one goes first. Use a trylock to grab the lock for updating the prevtime, and if it fails, simply try again the next time. If it failed to be taken, that means something else is already updating it.

Bugzilla: https://bugzilla.kernel.org/showbug.cgi?id=212761

Other sources

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

tracing: Restructure traceclockglobal() to never block

The Linux kernel CVE team has assigned CVE-2021-46939 to this issue.

Upstream advisory: https://lore.kernel.org/linux-cve-announce/20240227184057.2368370-4-gregkh@linuxfoundation.org/T/#u

Red Hat

Linux Kernel is vulnerable to a denial of service, caused by a flaw in the ring buffer recursion detection. By sending a specially crafted request, a local authenticated attacker could exploit this vulnerability to cause a denial of service condition.

IBM

Affected Software

13 affected componentsFixes available
IBM Security Verify Governance<=ISVG 10.0.2
IBM Security Verify Governance, Identity Manager Software Stack<=ISVG 10.0.2
IBM Security Verify Governance, Identity Manager Virtual Appliance<=ISVG 10.0.2
IBM Security Verify Governance Identity Manager Container<=ISVG 10.0.2
Linux Linux kernel>=2.6.30<4.4.269
Linux Linux kernel>=4.5.0<4.9.269
Linux Linux kernel>=4.10.0<4.14.233
Linux Linux kernel>=4.15.0<4.19.191
Linux Linux kernel>=4.20.0<5.4.118
Linux Linux kernel>=5.5.0<5.10.36
Linux Linux kernel>=5.11.0<5.11.20
Linux Linux kernel>=5.12.0<5.12.3
debian/linux
5.10.223-15.10.234-16.1.129-16.1.135-16.12.25-16.12.27-1

Event History

Feb 27, 2024
CVE Published
via MITRE·06:40 PM
Data Sourced
via MITRE·06:40 PM
Description
Data Sourced
via Red Hat·11:39 PM
DescriptionSeverityAffected Software
May 21, 2024
Data Sourced
via Launchpad·08:17 AM
Description
Apr 26, 2025
Data Sourced
via Ubuntu·11:46 PM
RemedyDescriptionSeverityAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2021-46939?

CVE-2021-46939 is classified as a high-severity vulnerability due to its potential to cause system hangs during suspend and resume operations.

2

How do I fix CVE-2021-46939?

To fix CVE-2021-46939, upgrade to one of the patched Linux kernel versions such as 5.10.223-1, 5.10.226-1, or later.

3

Which versions of the Linux kernel are affected by CVE-2021-46939?

CVE-2021-46939 affects various Linux kernel versions between 2.6.30 to 5.12.3.

4

What types of systems are impacted by CVE-2021-46939?

CVE-2021-46939 impacts systems running affected versions of the Linux kernel, particularly those using ring buffer recursion detection.

5

Is there a specific package I need to install to resolve CVE-2021-46939?

You should install the specific Linux packages such as 'linux' version 5.10.223-1 or later to address CVE-2021-46939.

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