# CVE-2023-53401: mm: kmem: fix a NULL pointer dereference in obj\_stock\_flush\_required()

> 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, CNA) `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.20% (percentile 6, 2026-11-26)
- **CWE:** CWE-476
- **Published:** 2025-09-18T13:33:41.076Z
- **Modified:** 2026-06-17T06:45:13.540Z

## Who should check

- Anyone running Linux \>= bf4f059954dcb221384b2f784677e19a13cd4bdb, \< 33d9490b27e5d8da4444aefd714a4f50189db978; \>= bf4f059954dcb221384b2f784677e19a13cd4bdb, \< 33391c7e1a2ad612bf3922cc168cb09a46bbe236; \>= bf4f059954dcb221384b2f784677e19a13cd4bdb, \< 3b8abb3239530c423c0b97e42af7f7e856e1ee96
- Anyone running Linux 5.9

## Description

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

mm: kmem: fix a NULL pointer dereference in obj\_stock\_flush\_required()

KCSAN found an issue in obj\_stock\_flush\_required():
stock-\>cached\_objcg can be reset between the check and dereference:

==================================================================
BUG: KCSAN: data-race in drain\_all\_stock / drain\_obj\_stock

write to 0xffff888237c2a2f8 of 8 bytes by task 19625 on cpu 0:
 drain\_obj\_stock+0x408/0x4e0 mm/memcontrol.c:3306
 refill\_obj\_stock+0x9c/0x1e0 mm/memcontrol.c:3340
 obj\_cgroup\_uncharge+0xe/0x10 mm/memcontrol.c:3408
 memcg\_slab\_free\_hook mm/slab.h:587 \[inline\]
 \_\_cache\_free mm/slab.c:3373 \[inline\]
 \_\_do\_kmem\_cache\_free mm/slab.c:3577 \[inline\]
 kmem\_cache\_free+0x105/0x280 mm/slab.c:3602
 \_\_d\_free fs/dcache.c:298 \[inline\]
 dentry\_free fs/dcache.c:375 \[inline\]
 \_\_dentry\_kill+0x422/0x4a0 fs/dcache.c:621
 dentry\_kill+0x8d/0x1e0
 dput+0x118/0x1f0 fs/dcache.c:913
 \_\_fput+0x3bf/0x570 fs/file\_table.c:329
 \_\_\_\_fput+0x15/0x20 fs/file\_table.c:349
 task\_work\_run+0x123/0x160 kernel/task\_work.c:179
 resume\_user\_mode\_work include/linux/resume\_user\_mode.h:49 \[inline\]
 exit\_to\_user\_mode\_loop+0xcf/0xe0 kernel/entry/common.c:171
 exit\_to\_user\_mode\_prepare+0x6a/0xa0 kernel/entry/common.c:203
 \_\_syscall\_exit\_to\_user\_mode\_work kernel/entry/common.c:285 \[inline\]
 syscall\_exit\_to\_user\_mode+0x26/0x140 kernel/entry/common.c:296
 do\_syscall\_64+0x4d/0xc0 arch/x86/entry/common.c:86
 entry\_SYSCALL\_64\_after\_hwframe+0x63/0xcd

read to 0xffff888237c2a2f8 of 8 bytes by task 19632 on cpu 1:
 obj\_stock\_flush\_required mm/memcontrol.c:3319 \[inline\]
 drain\_all\_stock+0x174/0x2a0 mm/memcontrol.c:2361
 try\_charge\_memcg+0x6d0/0xd10 mm/memcontrol.c:2703
 try\_charge mm/memcontrol.c:2837 \[inline\]
 mem\_cgroup\_charge\_skmem+0x51/0x140 mm/memcontrol.c:7290
 sock\_reserve\_memory+0xb1/0x390 net/core/sock.c:1025
 sk\_setsockopt+0x800/0x1e70 net/core/sock.c:1525
 udp\_lib\_setsockopt+0x99/0x6c0 net/ipv4/udp.c:2692
 udp\_setsockopt+0x73/0xa0 net/ipv4/udp.c:2817
 sock\_common\_setsockopt+0x61/0x70 net/core/sock.c:3668
 \_\_sys\_setsockopt+0x1c3/0x230 net/socket.c:2271
 \_\_do\_sys\_setsockopt net/socket.c:2282 \[inline\]
 \_\_se\_sys\_setsockopt net/socket.c:2279 \[inline\]
 \_\_x64\_sys\_setsockopt+0x66/0x80 net/socket.c:2279
 do\_syscall\_x64 arch/x86/entry/common.c:50 \[inline\]
 do\_syscall\_64+0x41/0xc0 arch/x86/entry/common.c:80
 entry\_SYSCALL\_64\_after\_hwframe+0x63/0xcd

value changed: 0xffff8881382d52c0 -\> 0xffff888138893740

Reported by Kernel Concurrency Sanitizer on:
CPU: 1 PID: 19632 Comm: syz-executor.0 Not tainted 6.3.0-rc2-syzkaller-00387-g534293368afa \#0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023

Fix it by using READ\_ONCE()/WRITE\_ONCE() for all accesses to
stock-\>cached\_objcg.

## Affected and fixed versions

- Linux: \>= bf4f059954dcb221384b2f784677e19a13cd4bdb, \< 33d9490b27e5d8da4444aefd714a4f50189db978; \>= bf4f059954dcb221384b2f784677e19a13cd4bdb, \< 33391c7e1a2ad612bf3922cc168cb09a46bbe236; \>= bf4f059954dcb221384b2f784677e19a13cd4bdb, \< 3b8abb3239530c423c0b97e42af7f7e856e1ee96 (cvelist)
- Linux: 5.9 (cvelist)

## Mitigation

- Upgrade Linux to 3b8abb3239530c423c0b97e42af7f7e856e1ee96 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-53401. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-53401.md
Affected: Linux >= bf4f059954dcb221384b2f784677e19a13cd4bdb, < 33d9490b27e5d8da4444aefd714a4f50189db978; >= bf4f059954dcb221384b2f784677e19a13cd4bdb, < 33391c7e1a2ad612bf3922cc168cb09a46bbe236; >= bf4f059954dcb221384b2f784677e19a13cd4bdb, < 3b8abb3239530c423c0b97e42af7f7e856e1ee96; Linux 5.9
Fixed in: Linux 33d9490b27e5d8da4444aefd714a4f50189db978, Linux 33391c7e1a2ad612bf3922cc168cb09a46bbe236, Linux 3b8abb3239530c423c0b97e42af7f7e856e1ee96

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-53401 being exploited?

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

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

Medium: CVSS 4.7 (v3.1, scored by CNA). 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-2023-53401?

Linux \>= bf4f059954dcb221384b2f784677e19a13cd4bdb, \< 33d9490b27e5d8da4444aefd714a4f50189db978; \>= bf4f059954dcb221384b2f784677e19a13cd4bdb, \< 33391c7e1a2ad612bf3922cc168cb09a46bbe236; \>= bf4f059954dcb221384b2f784677e19a13cd4bdb, \< 3b8abb3239530c423c0b97e42af7f7e856e1ee96; Linux 5.9.

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

Yes. Fixed in Linux 33d9490b27e5d8da4444aefd714a4f50189db978, Linux 33391c7e1a2ad612bf3922cc168cb09a46bbe236, Linux 3b8abb3239530c423c0b97e42af7f7e856e1ee96. Upgrade Linux to 3b8abb3239530c423c0b97e42af7f7e856e1ee96 or later.

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

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/33d9490b27e5d8da4444aefd714a4f50189db978>
- patch: <https://git.kernel.org/stable/c/33391c7e1a2ad612bf3922cc168cb09a46bbe236>
- patch: <https://git.kernel.org/stable/c/3b8abb3239530c423c0b97e42af7f7e856e1ee96>

## 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-53401>

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