CRITICAL Introduced in 2.6.37
ocfs2/dlm QueryRegion OOB
CVE-2026-53043
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H
KernelScan AI8.1HIGH
01Description
In the Linux kernel, the following vulnerability has been resolved: ocfs2/dlm: validate qr_numregions in dlm_match_regions() Patch series "ocfs2/dlm: fix two bugs in dlm_match_regions()". In dlm_match_regions(), the qr_numregions field from a DLM_QUERY_REGION network message is used to drive loops over the qr_regions buffer without sufficient validation. This series fixes two issues: - Patch 1 adds a bounds check to reject messages where qr_numregions exceeds O2NM_MAX_REGIONS. The o2net layer only validates message byte length; it does not constrain field values, so a crafted message can set qr_numregions up to 255 and trigger out-of-bounds reads past the 1024-byte qr_regions buffer. - Patch 2 fixes an off-by-one in the local-vs-remote comparison loop, which uses '<=' instead of '<', reading one entry past the valid range even when qr_numregions is within bounds. This patch (of 2): The qr_numregions field from a DLM_QUERY_REGION network message is used directly as loop bounds in dlm_match_regions() without checking against O2NM_MAX_REGIONS. Since qr_regions is sized for at most O2NM_MAX_REGIONS (32) entries, a crafted message with qr_numregions > 32 causes out-of-bounds reads past the qr_regions buffer. Add a bounds check for qr_numregions before entering the loops.
02KernelScan AI Analysis
Risk summary
A remote node in an OCFS2 cluster can send a crafted DLM_QUERY_REGION network message with qr_numregions set up to 255, causing the kernel to read beyond the 1024-byte qr_regions buffer. This out-of-bounds read leaks kernel memory contents to the peer node (C:Low) and, because the over-read is large and unbounded, will hit unmapped pages and cause a kernel panic (A:High). No authentication beyond cluster network reachability is required to trigger the issue.
Vulnerability analysis
The vulnerability is an out-of-bounds read in dlm_match_regions() in fs/ocfs2/dlm/dlmdomain.c. The qr_numregions field from a DLM_QUERY_REGION network message is used directly as the loop bound when iterating over the qr_regions buffer, which is sized for at most O2NM_MAX_REGIONS (32) entries. The o2net layer validates only the total message byte length, not individual field values, so a crafted message can set qr_numregions to any value up to 255 (the field's maximum). With qr_numregions > 32, the loop reads past the end of the qr_regions buffer, accessing adjacent kernel memory. Because the over-read can span many pages, it will typically hit unmapped memory and trigger a kernel panic. The fix adds a bounds check that rejects any message where qr_numregions exceeds O2NM_MAX_REGIONS before entering the loops, returning -EINVAL for invalid messages. The attack surface is any OCFS2 cluster node participating in the domain join handshake; the message is received over the o2net cluster network layer, making it network-reachable from any peer node on the cluster interconnect.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 5.15 | 2.6.37 | 5.15.209 | f69551139caf |
| 6.1 | 2.6.37 | 6.1.175 | 1f8b91275912 |
| 6.12 | 2.6.37 | 6.12.91 | 6c6e8fc3c007 |
| 6.18 | 2.6.37 | 6.18.33 | 3f474c33ebc2 |
| 7.0 | 2.6.37 | 7.0.10 | 3c2d0de23ae4 |
| mainline | 2.6.37 | 7.1 | 7ab3fbb01bc6 |
| 5.10 | 2.6.37 | 5.10.258 | d3d5efade0c7 |
| 6.6 | 2.6.37 | 6.6.141 | f37de46149db |