# CVE-2024-53222: zram: fix NULL pointer in comp\_algorithm\_show()

> 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, NVD) `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.30% (percentile 15, 2026-11-26)
- **CWE:** CWE-476
- **Published:** 2024-12-27T13:50:12.652Z
- **Modified:** 2026-06-17T08:08:37.960Z

## Who should check

- Anyone running Linux \>= 7ac07a26dea79c3892436bce41cce03dcbd3c4c7, \< c7ee791e538537b281f60945298796f0a3971bbd; \>= 7ac07a26dea79c3892436bce41cce03dcbd3c4c7, \< 843d366ff19708668d95cda16bb8aba109a93dba; \>= 7ac07a26dea79c3892436bce41cce03dcbd3c4c7, \< f364cdeb38938f9d03061682b8ff3779dd1730e5
- Anyone running Linux 6.2

## Description

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

zram: fix NULL pointer in comp\_algorithm\_show()

LTP reported a NULL pointer dereference as followed:

 CPU: 7 UID: 0 PID: 5995 Comm: cat Kdump: loaded Not tainted 6.12.0-rc6+ \#3
 Hardware name: QEMU KVM Virtual Machine, BIOS 0.0.0 02/06/2015
 pstate: 40400005 (nZcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
 pc : \_\_pi\_strcmp+0x24/0x140
 lr : zcomp\_available\_show+0x60/0x100 \[zram\]
 sp : ffff800088b93b90
 x29: ffff800088b93b90 x28: 0000000000000001 x27: 0000000000400cc0
 x26: 0000000000000ffe x25: ffff80007b3e2388 x24: 0000000000000000
 x23: ffff80007b3e2390 x22: ffff0004041a9000 x21: ffff80007b3e2900
 x20: 0000000000000000 x19: 0000000000000000 x18: 0000000000000000
 x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
 x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000
 x11: 0000000000000000 x10: ffff80007b3e2900 x9 : ffff80007b3cb280
 x8 : 0101010101010101 x7 : 0000000000000000 x6 : 0000000000000000
 x5 : 0000000000000040 x4 : 0000000000000000 x3 : 00656c722d6f7a6c
 x2 : 0000000000000000 x1 : ffff80007b3e2900 x0 : 0000000000000000
 Call trace:
  \_\_pi\_strcmp+0x24/0x140
  comp\_algorithm\_show+0x40/0x70 \[zram\]
  dev\_attr\_show+0x28/0x80
  sysfs\_kf\_seq\_show+0x90/0x140
  kernfs\_seq\_show+0x34/0x48
  seq\_read\_iter+0x1d4/0x4e8
  kernfs\_fop\_read\_iter+0x40/0x58
  new\_sync\_read+0x9c/0x168
  vfs\_read+0x1a8/0x1f8
  ksys\_read+0x74/0x108
  \_\_arm64\_sys\_read+0x24/0x38
  invoke\_syscall+0x50/0x120
  el0\_svc\_common.constprop.0+0xc8/0xf0
  do\_el0\_svc+0x24/0x38
  el0\_svc+0x38/0x138
  el0t\_64\_sync\_handler+0xc0/0xc8
  el0t\_64\_sync+0x188/0x190

The zram-\>comp\_algs\[ZRAM\_PRIMARY\_COMP\] can be NULL in zram\_add() if
comp\_algorithm\_set() has not been called.  User can access the zram device
by sysfs after device\_add\_disk(), so there is a time window to trigger the
NULL pointer dereference.  Move it ahead device\_add\_disk() to make sure
when user can access the zram device, it is ready.  comp\_algorithm\_set()
is protected by zram-\>init\_lock in other places and no such problem.

## Affected and fixed versions

- Linux: \>= 7ac07a26dea79c3892436bce41cce03dcbd3c4c7, \< c7ee791e538537b281f60945298796f0a3971bbd; \>= 7ac07a26dea79c3892436bce41cce03dcbd3c4c7, \< 843d366ff19708668d95cda16bb8aba109a93dba; \>= 7ac07a26dea79c3892436bce41cce03dcbd3c4c7, \< f364cdeb38938f9d03061682b8ff3779dd1730e5 (cvelist)
- Linux: 6.2 (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-2024-53222. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-53222.md
Affected: Linux >= 7ac07a26dea79c3892436bce41cce03dcbd3c4c7, < c7ee791e538537b281f60945298796f0a3971bbd; >= 7ac07a26dea79c3892436bce41cce03dcbd3c4c7, < 843d366ff19708668d95cda16bb8aba109a93dba; >= 7ac07a26dea79c3892436bce41cce03dcbd3c4c7, < f364cdeb38938f9d03061682b8ff3779dd1730e5; Linux 6.2
Fixed in: Linux 843d366ff19708668d95cda16bb8aba109a93dba

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-2024-53222 being exploited?

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

### How serious is CVE-2024-53222?

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

### Which versions are affected by CVE-2024-53222?

Linux \>= 7ac07a26dea79c3892436bce41cce03dcbd3c4c7, \< c7ee791e538537b281f60945298796f0a3971bbd; \>= 7ac07a26dea79c3892436bce41cce03dcbd3c4c7, \< 843d366ff19708668d95cda16bb8aba109a93dba; \>= 7ac07a26dea79c3892436bce41cce03dcbd3c4c7, \< f364cdeb38938f9d03061682b8ff3779dd1730e5; Linux 6.2.

### Is there a fix for CVE-2024-53222?

Yes. Fixed in Linux 843d366ff19708668d95cda16bb8aba109a93dba. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2024-53222?

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/843d366ff19708668d95cda16bb8aba109a93dba>
- patch: <https://git.kernel.org/stable/c/f364cdeb38938f9d03061682b8ff3779dd1730e5>
- other: <https://git.kernel.org/stable/c/c7ee791e538537b281f60945298796f0a3971bbd>

## 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-2024-53222>

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