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/
Metrics
Affected Vendors & Products
| Source | ID | Title |
|---|---|---|
Debian DLA |
DLA-4008-1 | linux-6.1 security update |
Debian DSA |
DSA-5730-1 | linux security update |
Debian DSA |
DSA-5731-1 | linux security update |
Ubuntu USN |
USN-6999-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-6999-2 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7003-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7003-2 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7003-3 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7003-4 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7003-5 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7004-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7005-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7005-2 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7006-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7007-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7007-2 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7007-3 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7008-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7009-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7009-2 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7019-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7029-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7069-1 | Linux kernel vulnerabilities |
Ubuntu USN |
USN-7069-2 | Linux kernel (Azure) vulnerabilities |
Solution
No solution given by the vendor.
Workaround
No workaround given by the vendor.
Mon, 03 Nov 2025 22:30:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| First Time appeared |
Linux
Linux linux Kernel |
|
| Weaknesses | CWE-787 | |
| CPEs | cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.10:rc1:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.10:rc2:*:*:*:*:*:* cpe:2.3:o:linux:linux_kernel:6.10:rc3:*:*:*:*:*:* |
|
| Vendors & Products |
Linux
Linux linux Kernel |
|
| References |
| |
| Metrics |
cvssV3_1
|
cvssV3_1
|
Sat, 16 Nov 2024 02:45:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| First Time appeared |
Redhat rhel Eus
|
|
| CPEs | cpe:/a:redhat:rhel_eus:9.4 | |
| Vendors & Products |
Redhat rhel Eus
|
Wed, 13 Nov 2024 02:30:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| CPEs | cpe:/a:redhat:enterprise_linux:9 cpe:/o:redhat:enterprise_linux:9 |
Tue, 24 Sep 2024 11:00:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| CPEs | cpe:/o:redhat:enterprise_linux:8 |
Tue, 24 Sep 2024 06:30:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| First Time appeared |
Redhat
Redhat enterprise Linux |
|
| CPEs | cpe:/a:redhat:enterprise_linux:8::nfv | |
| Vendors & Products |
Redhat
Redhat enterprise Linux |
Wed, 11 Sep 2024 13:30:00 +0000
| Type | Values Removed | Values Added |
|---|---|---|
| Metrics |
ssvc
|
Status: PUBLISHED
Assigner: Linux
Published:
Updated: 2025-11-03T21:57:28.834Z
Reserved: 2024-07-12T12:17:45.579Z
Link: CVE-2024-40901
Updated: 2024-08-02T04:39:54.924Z
Status : Modified
Published: 2024-07-12T13:15:13.500
Modified: 2025-11-03T22:17:11.790
Link: CVE-2024-40901
OpenCVE Enrichment
No data.
Debian DLA
Debian DSA
Ubuntu USN