# CVE-2024-40901: scsi: mpt3sas: Avoid test/set\_bit() operating in non-allocated memory

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

- **Severity:** HIGH 7.3
- **CVSS:** 7.3 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: Low; Integrity impact: High; 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.35% (percentile 21, 2026-11-26)
- **CWE:** CWE-787
- **Published:** 2024-07-12T12:20:42.859Z
- **Modified:** 2026-10-15T01:18:36.557Z

## Who should check

- Anyone running Linux \>= c696f7b83edeac804e898952058089143f49ca0a, \< e9bce7c751f6d6c7be88c0bc081a66aaf61a23ee; \>= c696f7b83edeac804e898952058089143f49ca0a, \< 19649e49a6df07cd2e03e0a11396fd3a99485ec2; \>= c696f7b83edeac804e898952058089143f49ca0a, \< 0081d2b3ae0a17a86b8cc0fa3c8bdc54e233ba16; \>= c696f7b83edeac804e898952058089143f49ca0a, \< 521f333e644c4246ca04a4fc4772edc53dd2a801; \>= c696f7b83edeac804e898952058089143f49ca0a, \< 46bab2bcd771e725ff5ca3a68ba68cfeac45676c; \>= c696f7b83edeac804e898952058089143f49ca0a, \< 9079338c5a0d1f1fee34fb1c9e99b754efe414c5; \>= c696f7b83edeac804e898952058089143f49ca0a, \< 18abb5db0aa9b2d48f7037a88b41af2eef821674; \>= c696f7b83edeac804e898952058089143f49ca0a, \< 4254dfeda82f20844299dca6c38cbffcfd499f41
- Anyone running Linux 4.10

## Description

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

scsi: mpt3sas: Avoid test/set\_bit() operating in non-allocated memory

There is a potential out-of-bounds access when using test\_bit() on a single
word. The test\_bit() and set\_bit() functions operate on long values, and
when testing or setting a single word, they can exceed the word
boundary. KASAN detects this issue and produces a dump:

	 BUG: KASAN: slab-out-of-bounds in \_scsih\_add\_device.constprop.0 (./arch/x86/include/asm/bitops.h:60 ./include/asm-generic/bitops/instrumented-atomic.h:29 drivers/scsi/mpt3sas/mpt3sas\_scsih.c:7331) mpt3sas

	 Write of size 8 at addr ffff8881d26e3c60 by task kworker/u1536:2/2965

For full log, please look at \[1\].

Make the allocation at least the size of sizeof(unsigned long) so that
set\_bit() and test\_bit() have sufficient room for read/write operations
without overwriting unallocated memory.

\[1\] Link: https://lore.kernel.org/all/ZkNcALr3W3KGYYJG@gmail.com/

## Affected and fixed versions

- Linux: \>= c696f7b83edeac804e898952058089143f49ca0a, \< e9bce7c751f6d6c7be88c0bc081a66aaf61a23ee; \>= c696f7b83edeac804e898952058089143f49ca0a, \< 19649e49a6df07cd2e03e0a11396fd3a99485ec2; \>= c696f7b83edeac804e898952058089143f49ca0a, \< 0081d2b3ae0a17a86b8cc0fa3c8bdc54e233ba16; \>= c696f7b83edeac804e898952058089143f49ca0a, \< 521f333e644c4246ca04a4fc4772edc53dd2a801; \>= c696f7b83edeac804e898952058089143f49ca0a, \< 46bab2bcd771e725ff5ca3a68ba68cfeac45676c; \>= c696f7b83edeac804e898952058089143f49ca0a, \< 9079338c5a0d1f1fee34fb1c9e99b754efe414c5; \>= c696f7b83edeac804e898952058089143f49ca0a, \< 18abb5db0aa9b2d48f7037a88b41af2eef821674; \>= c696f7b83edeac804e898952058089143f49ca0a, \< 4254dfeda82f20844299dca6c38cbffcfd499f41 (cvelist)
- Linux: 4.10 (cvelist)

## Mitigation

- Upgrade Linux to 4254dfeda82f20844299dca6c38cbffcfd499f41 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2024-40901.md
Affected: Linux >= c696f7b83edeac804e898952058089143f49ca0a, < e9bce7c751f6d6c7be88c0bc081a66aaf61a23ee; >= c696f7b83edeac804e898952058089143f49ca0a, < 19649e49a6df07cd2e03e0a11396fd3a99485ec2; >= c696f7b83edeac804e898952058089143f49ca0a, < 0081d2b3ae0a17a86b8cc0fa3c8bdc54e233ba16; >= c696f7b83edeac804e89895…
Fixed in: Linux 19649e49a6df07cd2e03e0a11396fd3a99485ec2, Linux 0081d2b3ae0a17a86b8cc0fa3c8bdc54e233ba16, Linux 521f333e644c4246ca04a4fc4772edc53dd2a801, Linux 46bab2bcd771e725ff5ca3a68ba68cfeac45676c, Linux 9079338c5a0d1f1fee34fb1c9e99b754efe414c5, Linux 18abb5db0aa9b2d48f7037a88b41af2eef821674, Linux 4254d…

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

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

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

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

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

Linux \>= c696f7b83edeac804e898952058089143f49ca0a, \< e9bce7c751f6d6c7be88c0bc081a66aaf61a23ee; \>= c696f7b83edeac804e898952058089143f49ca0a, \< 19649e49a6df07cd2e03e0a11396fd3a99485ec2; \>= c696f7b83edeac804e898952058089143f49ca0a, \< 0081d2b3ae0a17a86b8cc0fa3c8bdc54e233ba16; \>= c696f7b83edeac804e898952058089143f49ca0a, \< 521f333e644c4246ca04a4fc4772edc53dd2a801; \>= c696f7b83edeac804e898952058089143f49ca0a, \< 46bab2bcd771e725ff5ca3a68ba68cfeac45676c; \>= c696f7b83edeac804e898952058089143f49ca0a, \< 9079338c5a0d1f1fee34fb1c9e99b754efe414c5; \>= c696f7b83edeac804e898952058089143f49ca0a, \< 18abb5db0aa9b2d48f7037a88b41af2eef821674; \>= c696f7b83edeac804e898952058089143f49ca0a, \< 4254dfeda82f20844299dca6c38cbffcfd499f41; Linux 4.10.

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

Yes. Fixed in Linux 19649e49a6df07cd2e03e0a11396fd3a99485ec2, Linux 0081d2b3ae0a17a86b8cc0fa3c8bdc54e233ba16, Linux 521f333e644c4246ca04a4fc4772edc53dd2a801, Linux 46bab2bcd771e725ff5ca3a68ba68cfeac45676c, Linux 9079338c5a0d1f1fee34fb1c9e99b754efe414c5, Linux 18abb5db0aa9b2d48f7037a88b41af2eef821674, Linux 4254dfeda82f20844299dca6c38cbffcfd499f41. Upgrade Linux to 4254dfeda82f20844299dca6c38cbffcfd499f41 or later.

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

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/e9bce7c751f6d6c7be88c0bc081a66aaf61a23ee>
- patch: <https://git.kernel.org/stable/c/19649e49a6df07cd2e03e0a11396fd3a99485ec2>
- patch: <https://git.kernel.org/stable/c/0081d2b3ae0a17a86b8cc0fa3c8bdc54e233ba16>
- patch: <https://git.kernel.org/stable/c/521f333e644c4246ca04a4fc4772edc53dd2a801>
- patch: <https://git.kernel.org/stable/c/46bab2bcd771e725ff5ca3a68ba68cfeac45676c>
- patch: <https://git.kernel.org/stable/c/9079338c5a0d1f1fee34fb1c9e99b754efe414c5>
- patch: <https://git.kernel.org/stable/c/18abb5db0aa9b2d48f7037a88b41af2eef821674>
- patch: <https://git.kernel.org/stable/c/4254dfeda82f20844299dca6c38cbffcfd499f41>
- other: <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-398330.html>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-355557.html>

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

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