CVE-2022-50771 in Linuxinfo

Summary

by MITRE • 12/24/2025

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

rcu: Fix __this_cpu_read() lockdep warning in rcu_force_quiescent_state()

Running rcutorture with non-zero fqs_duration module parameter in a kernel built with CONFIG_PREEMPTION=y results in the following splat:

BUG: using __this_cpu_read() in preemptible [00000000]
code: rcu_torture_fqs/398 caller is __this_cpu_preempt_check+0x13/0x20 CPU: 3 PID: 398 Comm: rcu_torture_fqs Not tainted 6.0.0-rc1-yoctodev-standard+ Call Trace: <TASK> dump_stack_lvl+0x5b/0x86 dump_stack+0x10/0x16 check_preemption_disabled+0xe5/0xf0 __this_cpu_preempt_check+0x13/0x20 rcu_force_quiescent_state.part.0+0x1c/0x170 rcu_force_quiescent_state+0x1e/0x30 rcu_torture_fqs+0xca/0x160 ? rcu_torture_boost+0x430/0x430 kthread+0x192/0x1d0 ? kthread_complete_and_exit+0x30/0x30 ret_from_fork+0x22/0x30 </TASK>

The problem is that rcu_force_quiescent_state() uses __this_cpu_read() in preemptible code instead of the proper raw_cpu_read(). This commit therefore changes __this_cpu_read() to raw_cpu_read().

If you want to get best quality of vulnerability data, you may have to visit VulDB.

Analysis

by VulDB Data Team • 04/21/2026

The vulnerability identified as CVE-2022-50771 resides within the Linux kernel's RCU (Read-Copy-Update) subsystem, specifically affecting the rcu_force_quiescent_state() function. This issue manifests when running rcutorture stress testing with a non-zero fqs_duration module parameter on kernels compiled with CONFIG_PREEMPTION=y. The problem stems from improper use of CPU-local variable access macros within preemptible code contexts, creating a potential race condition that could compromise system stability and integrity. The vulnerability was discovered during extensive kernel testing and manifests through kernel oops messages indicating inappropriate usage of preemptible code constructs.

The technical flaw involves the incorrect application of __this_cpu_read() macro within the rcu_force_quiescent_state() function, which operates in a preemptible context. This macro is designed for use in non-preemptible contexts and triggers warnings when invoked in preemptible code paths. The function's improper implementation causes kernel lockdep subsystem to detect a violation where __this_cpu_read() is used in a context that allows preemption, violating kernel safety guarantees. The kernel's preemptive nature means that the current thread could be suspended at any moment, making the use of __this_cpu_read() potentially dangerous as it does not properly handle the preemption context. This issue maps directly to CWE-691, which addresses inadequate protection of code from preemption during access to per-CPU variables, and aligns with ATT&CK technique T1490 for system network configuration modification through kernel-level manipulation.

The operational impact of this vulnerability extends beyond simple kernel warnings to potentially destabilizing the entire system during stress testing scenarios. When rcutorture executes with the specified parameters, the kernel generates a BUG message indicating the problematic usage, which can lead to system instability or unexpected behavior during concurrent RCU operations. The vulnerability specifically affects systems running kernel versions with CONFIG_PREEMPTION=y enabled and executing RCU-related stress tests, though the broader implications suggest potential issues in any environment where RCU quiescent state forcing occurs in preemptible contexts. The risk level is elevated in high-concurrency environments where RCU operations are frequent and the system's responsiveness is critical for maintaining service availability.

The mitigation strategy involves replacing the problematic __this_cpu_read() macro with raw_cpu_read() throughout the rcu_force_quiescent_state() function implementation. This change ensures that the function operates correctly in preemptible contexts while maintaining the necessary access to per-CPU variables. The fix addresses the root cause by selecting the appropriate macro for the execution context, ensuring that raw_cpu_read() is used in preemptible code paths where preemption safety is required. System administrators should apply the kernel patch that implements this change, particularly on systems running kernel versions with CONFIG_PREEMPTION=y and those subject to RCU stress testing. The solution maintains backward compatibility while ensuring proper kernel behavior under all execution contexts, aligning with best practices for kernel development and security hardening. This remediation approach prevents the kernel lockdep subsystem from triggering warnings and ensures stable operation during RCU quiescent state operations.

Responsible

Linux

Reservation

12/24/2025

Disclosure

12/24/2025

Moderation

accepted

CPE

ready

EPSS

0.00206

KEV

no

Activities

very low

Sources

Want to stay up to date on a daily basis?

Enable the mail alert feature now!