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

- Priority: **Routine**
- Reason: Not severe (CVSS 7.3, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2024-07-12 · Modified: 2026-10-15
- Aliases: UBUNTU-CVE-2024-40901, DEBIAN-CVE-2024-40901
- Record: https://cvemate.com/vulnerability/CVE-2024-40901 · JSON: https://cvemate.com/vulnerability/CVE-2024-40901/json

## Description

```text
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/
```

## Signals

- CVSS: 7.8 high (v3.1, NVD) CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- EPSS: 0.316%, percentile 26.444%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 131)

- debian linux (Debian): \< 6.1.99-1 \| \< 6.9.7-1
- ubuntu linux (Ubuntu): \< 4.15.0-230.242 \| \< 5.4.0-195.215 \| \< 5.15.0-121.131 \| \< 6.8.0-44.44
- ubuntu linux-allwinner-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws (Ubuntu): \< 4.15.0-1174.187 \| \< 5.4.0-1132.142 \| \< 5.15.0-1069.75 \| \< 6.8.0-1015.16
- ubuntu linux-aws-5.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.15 (Ubuntu): \< 5.15.0-1069.75~20.04.1
- ubuntu linux-aws-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.3 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.4 (Ubuntu): \< 5.4.0-1132.142~18.04.1
- ubuntu linux-aws-5.8 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.2 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.5 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.8 (Ubuntu): \< 6.8.0-1015.16~22.04.1
- ubuntu linux-aws-fips (Ubuntu): \< 4.15.0-2112.118 \| All versions (No fix recorded) \| \< 5.4.0-1132.142+fips1 \| \< 5.15.0-1069.75+fips1
- ubuntu linux-aws-hwe (Ubuntu): \< 4.15.0-1174.187~16.04.1
- ubuntu linux-azure (Ubuntu): \< 4.15.0-1182.197~14.04.1 \| \< 4.15.0-1182.197~16.04.1 \| All versions (No fix recorded) \| \< 5.4.0-1137.144 \| \< 5.15.0-1072.81 \| \< 6.8.0-1014.16
- ubuntu linux-azure-4.15 (Ubuntu): \< 4.15.0-1182.197
- ubuntu linux-azure-5.11 (Ubuntu): All versions (No fix recorded)

## References (first 20 of 36)

- <https://git.kernel.org/stable/c/e9bce7c751f6d6c7be88c0bc081a66aaf61a23ee>
- <https://git.kernel.org/stable/c/19649e49a6df07cd2e03e0a11396fd3a99485ec2>
- <https://git.kernel.org/stable/c/0081d2b3ae0a17a86b8cc0fa3c8bdc54e233ba16>
- <https://git.kernel.org/stable/c/521f333e644c4246ca04a4fc4772edc53dd2a801>
- <https://git.kernel.org/stable/c/46bab2bcd771e725ff5ca3a68ba68cfeac45676c>
- <https://git.kernel.org/stable/c/9079338c5a0d1f1fee34fb1c9e99b754efe414c5>
- <https://git.kernel.org/stable/c/18abb5db0aa9b2d48f7037a88b41af2eef821674>
- <https://git.kernel.org/stable/c/4254dfeda82f20844299dca6c38cbffcfd499f41>
- <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html>
- <https://ubuntu.com/security/CVE-2024-40901>
- <https://www.cve.org/CVERecord?id=CVE-2024-40901>
- <https://git.kernel.org/linus/4254dfeda82f20844299dca6c38cbffcfd499f41>
- <https://ubuntu.com/security/notices/USN-6999-1>
- <https://ubuntu.com/security/notices/USN-7003-1>
- <https://ubuntu.com/security/notices/USN-7003-2>
- <https://ubuntu.com/security/notices/USN-7004-1>
- <https://ubuntu.com/security/notices/USN-7005-1>
- <https://ubuntu.com/security/notices/USN-7006-1>
- <https://ubuntu.com/security/notices/USN-7003-3>
- <https://ubuntu.com/security/notices/USN-7007-1>

---

Data as of 2026-12-05T03:43:56.299Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
