# CVE-2022-49540: rcu-tasks: Fix race in schedule and flush work

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 4.7
- **CVSS:** 4.7 (v3.1, NVD) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: High; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.19% (percentile 5, 2026-11-26)
- **CWE:** CWE-362
- **Published:** 2025-02-26T02:13:56.012Z
- **Modified:** 2026-06-17T05:18:23.380Z

## Who should check

- Anyone running Linux \>= c84aad765406c4c7573ce449e8a9977ebb8f4cb9, \< 1c6c3f2336642fb3074593911f5176565f47ec41; \>= c84aad765406c4c7573ce449e8a9977ebb8f4cb9, \< ba722d061bc4b54802d701fc63fc2fd988934603; \>= c84aad765406c4c7573ce449e8a9977ebb8f4cb9, \< 230bf5878af6038dfb63d9184272a58475236580; \>= c84aad765406c4c7573ce449e8a9977ebb8f4cb9, \< 8f49a8758b5cd541bd7aa9a0d0d11c7426141c0e; \>= c84aad765406c4c7573ce449e8a9977ebb8f4cb9, \< f75fd4b9221d93177c50dcfde671b2e907f53e86
- Anyone running Linux 5.8

## Description

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

rcu-tasks: Fix race in schedule and flush work

While booting secondary CPUs, cpus\_read\_\[lock/unlock\] is not keeping
online cpumask stable. The transient online mask results in below
calltrace.

\[    0.324121\] CPU1: Booted secondary processor 0x0000000001 \[0x410fd083\]
\[    0.346652\] Detected PIPT I-cache on CPU2
\[    0.347212\] CPU2: Booted secondary processor 0x0000000002 \[0x410fd083\]
\[    0.377255\] Detected PIPT I-cache on CPU3
\[    0.377823\] CPU3: Booted secondary processor 0x0000000003 \[0x410fd083\]
\[    0.379040\] ------------\[ cut here \]------------
\[    0.383662\] WARNING: CPU: 0 PID: 10 at kernel/workqueue.c:3084 \_\_flush\_work+0x12c/0x138
\[    0.384850\] Modules linked in:
\[    0.385403\] CPU: 0 PID: 10 Comm: rcu\_tasks\_rude\_ Not tainted 5.17.0-rc3-v8+ \#13
\[    0.386473\] Hardware name: Raspberry Pi 4 Model B Rev 1.4 (DT)
\[    0.387289\] pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
\[    0.388308\] pc : \_\_flush\_work+0x12c/0x138
\[    0.388970\] lr : \_\_flush\_work+0x80/0x138
\[    0.389620\] sp : ffffffc00aaf3c60
\[    0.390139\] x29: ffffffc00aaf3d20 x28: ffffffc009c16af0 x27: ffffff80f761df48
\[    0.391316\] x26: 0000000000000004 x25: 0000000000000003 x24: 0000000000000100
\[    0.392493\] x23: ffffffffffffffff x22: ffffffc009c16b10 x21: ffffffc009c16b28
\[    0.393668\] x20: ffffffc009e53861 x19: ffffff80f77fbf40 x18: 00000000d744fcc9
\[    0.394842\] x17: 000000000000000b x16: 00000000000001c2 x15: ffffffc009e57550
\[    0.396016\] x14: 0000000000000000 x13: ffffffffffffffff x12: 0000000100000000
\[    0.397190\] x11: 0000000000000462 x10: ffffff8040258008 x9 : 0000000100000000
\[    0.398364\] x8 : 0000000000000000 x7 : ffffffc0093c8bf4 x6 : 0000000000000000
\[    0.399538\] x5 : 0000000000000000 x4 : ffffffc00a976e40 x3 : ffffffc00810444c
\[    0.400711\] x2 : 0000000000000004 x1 : 0000000000000000 x0 : 0000000000000000
\[    0.401886\] Call trace:
\[    0.402309\]  \_\_flush\_work+0x12c/0x138
\[    0.402941\]  schedule\_on\_each\_cpu+0x228/0x278
\[    0.403693\]  rcu\_tasks\_rude\_wait\_gp+0x130/0x144
\[    0.404502\]  rcu\_tasks\_kthread+0x220/0x254
\[    0.405264\]  kthread+0x174/0x1ac
\[    0.405837\]  ret\_from\_fork+0x10/0x20
\[    0.406456\] irq event stamp: 102
\[    0.406966\] hardirqs last  enabled at (101): \[\<ffffffc0093c8468\>\] \_raw\_spin\_unlock\_irq+0x78/0xb4
\[    0.408304\] hardirqs last disabled at (102): \[\<ffffffc0093b8270\>\] el1\_dbg+0x24/0x5c
\[    0.409410\] softirqs last  enabled at (54): \[\<ffffffc0081b80c8\>\] local\_bh\_enable+0xc/0x2c
\[    0.410645\] softirqs last disabled at (50): \[\<ffffffc0081b809c\>\] local\_bh\_disable+0xc/0x2c
\[    0.411890\] ---\[ end trace 0000000000000000 \]---
\[    0.413000\] smp: Brought up 1 node, 4 CPUs
\[    0.413762\] SMP: Total of 4 processors activated.
\[    0.414566\] CPU features: detected: 32-bit EL0 Support
\[    0.415414\] CPU features: detected: 32-bit EL1 Support
\[    0.416278\] CPU features: detected: CRC32 instructions
\[    0.447021\] Callback from call\_rcu\_tasks\_rude() invoked.
\[    0.506693\] Callback from call\_rcu\_tasks() invoked.

This commit therefore fixes this issue by applying a single-CPU
optimization to the RCU Tasks Rude grace-period process.  The key point
here is that the purpose of this RCU flavor is to force a schedule on
each online CPU since some past event.  But the rcu\_tasks\_rude\_wait\_gp()
function runs in the context of the RCU Tasks Rude's grace-period kthread,
so there must already have been a context switch on the current CPU since
the call to either synchronize\_rcu\_tasks\_rude() or call\_rcu\_tasks\_rude().
So if there is only a single CPU online, RCU Tasks Rude's grace-period
kthread does not need to anything at all.

It turns out that the rcu\_tasks\_rude\_wait\_gp() function's call to
schedule\_on\_each\_cpu() causes problems during early boot.  During that
time, there is only one online CPU, namely the boot CPU.  Therefore,
applying this single-CPU optimization fixes early-boot instances of
this problem.

## Affected and fixed versions

- Linux: \>= c84aad765406c4c7573ce449e8a9977ebb8f4cb9, \< 1c6c3f2336642fb3074593911f5176565f47ec41; \>= c84aad765406c4c7573ce449e8a9977ebb8f4cb9, \< ba722d061bc4b54802d701fc63fc2fd988934603; \>= c84aad765406c4c7573ce449e8a9977ebb8f4cb9, \< 230bf5878af6038dfb63d9184272a58475236580; \>= c84aad765406c4c7573ce449e8a9977ebb8f4cb9, \< 8f49a8758b5cd541bd7aa9a0d0d11c7426141c0e; \>= c84aad765406c4c7573ce449e8a9977ebb8f4cb9, \< f75fd4b9221d93177c50dcfde671b2e907f53e86 (cvelist)
- Linux: 5.8 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-49540. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-49540.md
Affected: Linux >= c84aad765406c4c7573ce449e8a9977ebb8f4cb9, < 1c6c3f2336642fb3074593911f5176565f47ec41; >= c84aad765406c4c7573ce449e8a9977ebb8f4cb9, < ba722d061bc4b54802d701fc63fc2fd988934603; >= c84aad765406c4c7573ce449e8a9977ebb8f4cb9, < 230bf5878af6038dfb63d9184272a58475236580; >= c84aad765406c4c7573ce44…
Fixed in: Linux 1c6c3f2336642fb3074593911f5176565f47ec41, Linux 230bf5878af6038dfb63d9184272a58475236580, Linux 8f49a8758b5cd541bd7aa9a0d0d11c7426141c0e

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-49540 being exploited?

There is no confirmed exploitation: CVE-2022-49540 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.19% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-49540?

Medium: CVSS 4.7 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed). The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2022-49540?

Linux \>= c84aad765406c4c7573ce449e8a9977ebb8f4cb9, \< 1c6c3f2336642fb3074593911f5176565f47ec41; \>= c84aad765406c4c7573ce449e8a9977ebb8f4cb9, \< ba722d061bc4b54802d701fc63fc2fd988934603; \>= c84aad765406c4c7573ce449e8a9977ebb8f4cb9, \< 230bf5878af6038dfb63d9184272a58475236580; \>= c84aad765406c4c7573ce449e8a9977ebb8f4cb9, \< 8f49a8758b5cd541bd7aa9a0d0d11c7426141c0e; \>= c84aad765406c4c7573ce449e8a9977ebb8f4cb9, \< f75fd4b9221d93177c50dcfde671b2e907f53e86; Linux 5.8.

### Is there a fix for CVE-2022-49540?

Yes. Fixed in Linux 1c6c3f2336642fb3074593911f5176565f47ec41, Linux 230bf5878af6038dfb63d9184272a58475236580, Linux 8f49a8758b5cd541bd7aa9a0d0d11c7426141c0e. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2022-49540?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/1c6c3f2336642fb3074593911f5176565f47ec41>
- patch: <https://git.kernel.org/stable/c/ba722d061bc4b54802d701fc63fc2fd988934603>
- patch: <https://git.kernel.org/stable/c/230bf5878af6038dfb63d9184272a58475236580>
- patch: <https://git.kernel.org/stable/c/8f49a8758b5cd541bd7aa9a0d0d11c7426141c0e>
- patch: <https://git.kernel.org/stable/c/f75fd4b9221d93177c50dcfde671b2e907f53e86>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-49540>

HTML: <https://flawdb.com/CVE-2022-49540> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-49540>
