# CVE-2023-53231: erofs: Fix detection of atomic context

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

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; 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.23% (percentile 8, 2026-11-26)
- **Published:** 2025-09-15T14:22:03.599Z
- **Modified:** 2026-10-03T11:17:27.190Z

## Who should check

- Anyone running Linux \>= aea1286dcbbb87cf33595c2ac8b153c29a4611cb, \< c3446e50fb4dc39e2dfb5951a57bc175d38f68be; \>= aea1286dcbbb87cf33595c2ac8b153c29a4611cb, \< 96bcd9650e15901201d964eef5f79d18a81daac8; \>= aea1286dcbbb87cf33595c2ac8b153c29a4611cb, \< 597fb60c75132719687e173b75cab8f6eb1ca657; \>= aea1286dcbbb87cf33595c2ac8b153c29a4611cb, \< 12d0a24afd9ea58e581ea64d64e066f2027b28d9
- Anyone running Linux 4.19

## Description

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

erofs: Fix detection of atomic context

Current check for atomic context is not sufficient as
z\_erofs\_decompressqueue\_endio can be called under rcu lock
from blk\_mq\_flush\_plug\_list(). See the stacktrace \[1\]

In such case we should hand off the decompression work for async
processing rather than trying to do sync decompression in current
context. Patch fixes the detection by checking for
rcu\_read\_lock\_any\_held() and while at it use more appropriate
!in\_task() check than in\_atomic().

Background: Historically erofs would always schedule a kworker for
decompression which would incur the scheduling cost regardless of
the context. But z\_erofs\_decompressqueue\_endio() may not always
be in atomic context and we could actually benefit from doing the
decompression in z\_erofs\_decompressqueue\_endio() if we are in
thread context, for example when running with dm-verity.
This optimization was later added in patch \[2\] which has shown
improvement in performance benchmarks.

==============================================
\[1\] Problem stacktrace
\[name:core&\]BUG: sleeping function called from invalid context at kernel/locking/mutex.c:291
\[name:core&\]in\_atomic(): 0, irqs\_disabled(): 0, non\_block: 0, pid: 1615, name: CpuMonitorServi
\[name:core&\]preempt\_count: 0, expected: 0
\[name:core&\]RCU nest depth: 1, expected: 0
CPU: 7 PID: 1615 Comm: CpuMonitorServi Tainted: G S      W  OE      6.1.25-android14-5-maybe-dirty-mainline \#1
Hardware name: MT6897 (DT)
Call trace:
 dump\_backtrace+0x108/0x15c
 show\_stack+0x20/0x30
 dump\_stack\_lvl+0x6c/0x8c
 dump\_stack+0x20/0x48
 \_\_might\_resched+0x1fc/0x308
 \_\_might\_sleep+0x50/0x88
 mutex\_lock+0x2c/0x110
 z\_erofs\_decompress\_queue+0x11c/0xc10
 z\_erofs\_decompress\_kickoff+0x110/0x1a4
 z\_erofs\_decompressqueue\_endio+0x154/0x180
 bio\_endio+0x1b0/0x1d8
 \_\_dm\_io\_complete+0x22c/0x280
 clone\_endio+0xe4/0x280
 bio\_endio+0x1b0/0x1d8
 blk\_update\_request+0x138/0x3a4
 blk\_mq\_plug\_issue\_direct+0xd4/0x19c
 blk\_mq\_flush\_plug\_list+0x2b0/0x354
 \_\_blk\_flush\_plug+0x110/0x160
 blk\_finish\_plug+0x30/0x4c
 read\_pages+0x2fc/0x370
 page\_cache\_ra\_unbounded+0xa4/0x23c
 page\_cache\_ra\_order+0x290/0x320
 do\_sync\_mmap\_readahead+0x108/0x2c0
 filemap\_fault+0x19c/0x52c
 \_\_do\_fault+0xc4/0x114
 handle\_mm\_fault+0x5b4/0x1168
 do\_page\_fault+0x338/0x4b4
 do\_translation\_fault+0x40/0x60
 do\_mem\_abort+0x60/0xc8
 el0\_da+0x4c/0xe0
 el0t\_64\_sync\_handler+0xd4/0xfc
 el0t\_64\_sync+0x1a0/0x1a4

\[2\] Link: https://lore.kernel.org/all/20210317035448.13921-1-huangjianan@oppo.com/

## Affected and fixed versions

- Linux: \>= aea1286dcbbb87cf33595c2ac8b153c29a4611cb, \< c3446e50fb4dc39e2dfb5951a57bc175d38f68be; \>= aea1286dcbbb87cf33595c2ac8b153c29a4611cb, \< 96bcd9650e15901201d964eef5f79d18a81daac8; \>= aea1286dcbbb87cf33595c2ac8b153c29a4611cb, \< 597fb60c75132719687e173b75cab8f6eb1ca657; \>= aea1286dcbbb87cf33595c2ac8b153c29a4611cb, \< 12d0a24afd9ea58e581ea64d64e066f2027b28d9 (cvelist)
- Linux: 4.19 (cvelist)

## Mitigation

- Upgrade Linux to 12d0a24afd9ea58e581ea64d64e066f2027b28d9 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2023-53231.md
Affected: Linux >= aea1286dcbbb87cf33595c2ac8b153c29a4611cb, < c3446e50fb4dc39e2dfb5951a57bc175d38f68be; >= aea1286dcbbb87cf33595c2ac8b153c29a4611cb, < 96bcd9650e15901201d964eef5f79d18a81daac8; >= aea1286dcbbb87cf33595c2ac8b153c29a4611cb, < 597fb60c75132719687e173b75cab8f6eb1ca657; >= aea1286dcbbb87cf33595c2…
Fixed in: Linux 96bcd9650e15901201d964eef5f79d18a81daac8, Linux 597fb60c75132719687e173b75cab8f6eb1ca657, Linux 12d0a24afd9ea58e581ea64d64e066f2027b28d9

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-2023-53231 being exploited?

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

### How serious is CVE-2023-53231?

Medium: CVSS 5.5 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2023-53231?

Linux \>= aea1286dcbbb87cf33595c2ac8b153c29a4611cb, \< c3446e50fb4dc39e2dfb5951a57bc175d38f68be; \>= aea1286dcbbb87cf33595c2ac8b153c29a4611cb, \< 96bcd9650e15901201d964eef5f79d18a81daac8; \>= aea1286dcbbb87cf33595c2ac8b153c29a4611cb, \< 597fb60c75132719687e173b75cab8f6eb1ca657; \>= aea1286dcbbb87cf33595c2ac8b153c29a4611cb, \< 12d0a24afd9ea58e581ea64d64e066f2027b28d9; Linux 4.19.

### Is there a fix for CVE-2023-53231?

Yes. Fixed in Linux 96bcd9650e15901201d964eef5f79d18a81daac8, Linux 597fb60c75132719687e173b75cab8f6eb1ca657, Linux 12d0a24afd9ea58e581ea64d64e066f2027b28d9. Upgrade Linux to 12d0a24afd9ea58e581ea64d64e066f2027b28d9 or later.

### How do I check if I'm affected by CVE-2023-53231?

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/597fb60c75132719687e173b75cab8f6eb1ca657>
- patch: <https://git.kernel.org/stable/c/12d0a24afd9ea58e581ea64d64e066f2027b28d9>
- other: <https://git.kernel.org/stable/c/c3446e50fb4dc39e2dfb5951a57bc175d38f68be>
- other: <https://git.kernel.org/stable/c/96bcd9650e15901201d964eef5f79d18a81daac8>

## 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-2023-53231>

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