CVE-2025-21889: perf/core: Add RCU read lock protection to perf_iterate_ctx()
In the Linux kernel, the following vulnerability has been resolved:
perf/core: Add RCU read lock protection to perfiteratectx()
The perfiteratectx() function performs RCU list traversal but currently lacks RCU read lock protection. This causes lockdep warnings when running perf probe with unshare(1) under CONFIGPROVERCULIST=y:
WARNING: suspicious RCU usage kernel/events/core.c:8168 RCU-list traversed in non-reader section!!
Call Trace: lockdeprcususpicious ? perfeventaddrfiltersapply perfiteratectx perfeventexec beginnewexec ? loadelfphdrs loadelfbinary ? lockacquire ? findheldlock ? bprmexecve bprmexecve doexecveatcommon.isra.0 x64sysexecve dosyscall64 entrySYSCALL64afterhwframe
This protection was previously present but was removed in commit bd2756811766 ("perf: Rewrite core context handling"). Add back the necessary rcureadlock()/rcureadunlock() pair around perfiteratectx() call in perfeventexec().
[ mingo: Use scopedguard() as suggested by Peter ]
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Linux kernelto a version that resolves this vulnerability.Patch bd2756811766 - Configuration
When CONFIG_PROVE_RCU_LIST=y, ensure the fix is present that adds the necessary rcu_read_lock()/rcu_read_unlock() pair around perf_iterate_ctx() ("perf/core: Add RCU read lock protection to perf_iterate_ctx()"), resolving the lockdep warning "RCU-list traversed in non-reader section".
Linux kernel CONFIG_PROVE_RCU_LIST = y
Event History
Frequently Asked Questions
What is the severity of CVE-2025-21889?
CVE-2025-21889 has a moderate severity level due to its potential to cause lockdep warnings without proper RCU read lock protection.
How do I fix CVE-2025-21889?
To fix CVE-2025-21889, users should update their Linux Kernel to the latest version that includes the patch for the vulnerability.
What impact does CVE-2025-21889 have on system stability?
CVE-2025-21889 can lead to lockdep warnings, which may affect the overall stability of the Linux Kernel during performance operations.
Which versions of Linux Kernel are affected by CVE-2025-21889?
CVE-2025-21889 affects all versions of the Linux Kernel that have not implemented the necessary RCU read lock protection in the perf_iterate_ctx() function.
Is CVE-2025-21889 publicly known?
Yes, CVE-2025-21889 is a publicly disclosed vulnerability, making it crucial for users to address it promptly.