HIGH
libceph MonMap Overflow
CVE-2026-43405
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
KernelScan AI5.3MEDIUM
01Description
In the Linux kernel, the following vulnerability has been resolved: libceph: Use u32 for non-negative values in ceph_monmap_decode() This patch fixes unnecessary implicit conversions that change signedness of blob_len and num_mon in ceph_monmap_decode(). Currently blob_len and num_mon are (signed) int variables. They are used to hold values that are always non-negative and get assigned in ceph_decode_32_safe(), which is meant to assign u32 values. Both variables are subsequently used as unsigned values, and the value of num_mon is further assigned to monmap->num_mon, which is of type u32. Therefore, both variables should be of type u32. This is especially relevant for num_mon. If the value read from the incoming message is very large, it is interpreted as a negative value, and the check for num_mon > CEPH_MAX_MON does not catch it. This leads to the attempt to allocate a very large chunk of memory for monmap, which will most likely fail. In this case, an unnecessary attempt to allocate memory is performed, and -ENOMEM is returned instead of -EINVAL.
02KernelScan AI Analysis
Risk summary
Remote attackers can cause the Ceph client to attempt excessive memory allocation and return an incorrect error code by sending crafted Ceph monitor map messages with large monitor counts. The signedness conversion bypasses validation checks, leading to unnecessary allocation attempts.
Vulnerability analysis
The vulnerability occurs in ceph_monmap_decode() where num_mon is declared as signed int but receives unsigned 32-bit values from network messages. Values greater than or equal to 2^31 are interpreted as negative numbers, bypassing the num_mon > CEPH_MAX_MON validation. This causes kzalloc to attempt allocation of an impractically large size, which fails and returns -ENOMEM instead of the intended -EINVAL. The fix changes the variable types to u32 to prevent signedness confusion.
03Fix Versions
| Branch | Fixed in | Patch commit |
|---|---|---|
| 5.15 | 5.15.203 | ee5588e2bc41 |
| 6.1 | 6.1.167 | 86f7060cd638 |
| 6.12 | 6.12.78 | b268984ae88c |
| 6.18 | 6.18.19 | ba0a4df8c563 |
| 6.19 | 6.19.9 | 08bc6173fd61 |
| 6.6 | 6.6.130 | 5f2806684b05 |
| mainline | 7.0 | 770444611f04 |