CVE-2026-139768 PUBLISHED

dlm: fix buffer overflow from negative len in dlm_search_rsb_tree

Assigner: Linux
Reserved: 30.11.2026 Published: 30.11.2026 Updated: 01.12.2026

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

dlm: fix buffer overflow from negative len in dlm_search_rsb_tree

commit 080e5563f878c ("dlm: validate length in dlm_search_rsb_tree") only checks for len > DLM_RESNAME_MAXLEN, which does not catch negative values. While the input 'len' can be negative and a negative int passed to memcpy() is implicitly converted to a large size_t, causing a stack buffer overflow on the key[] array.

Fix this by changing the 'len' parameter type from int to unsigned int. This ensures negative values from callers are implicitly converted to large unsigned values that are caught by the existing len > DLM_RESNAME_MAXLEN check.

Metrics

CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
CVSS Score: 9.8

AV:N - A DLM peer sends, over lowcomms TCP 21064 or SCTP, a version-3.1 DLM_RCOM_LOOKUP whose rc_header.h_length is 32-47. dlm_midcomms_receive_buffer_3_1 passes RCOM on without a sizeof(struct dlm_rcom) check, so receive_rcom_lookup computes len = h_length - 48 < 0 and hands it through dlm_dump_rsb_name to dlm_search_rsb_tree. AC:L - The sender sets every input itself: 3.1 framing on its own first message while node->version is unset (first contact, or after its own leave/FIN reset), rc_id 0xFFFFFFFF, and the short h_length. The DLM_RS_NODES/DLM_RS_DIR gate in dlm_receive_rcom stays set once recovery finishes, so any steady-state lockspace accepts the message with no race. PR:N - accept_from_sock admits a connection only by addr_to_nodeid on the peer IP and ignores the source port. Neither midcomms nor dlm_receive_rcom authenticates the sender before receive_rcom_lookup, so no credential on the target is needed. This matches CVE-2026-43125, which reaches the same function through the same path. UI:N - The overflow happens in the dlm_recv worker while it processes the received RCOM_LOOKUP for an active lockspace (GFS2, OCFS2, lvmlockd). No local user action is involved. S:U - The corruption or BUG is confined to the kernel that parses the message. No hypervisor, IOMMU or other authority boundary is crossed. C:H - On kernels without FORTIFY_SOURCE (the Kconfig default), memcpy(key, name, (size_t)-16) in dlm_search_rsb_tree runs away over the dlm_recv kworker stack, starting with peer-supplied rc_buf and receive-buffer bytes. Following the runaway-memcpy precedent, this corruption is treated as usable for disclosure. I:H - The same runaway copy overwrites saved frames above the 64-byte stack array key[] with attacker-supplied bytes from the DLM receive buffer. That is an out-of-bounds kernel stack write of attacker-controlled data. A:H - With FORTIFY_SOURCE, the fixed 64-byte key[] makes fortify_panic BUG(). Without it, the copy faults at the stack guard. Either way the dlm_recv worker dies holding rcu_read_lock and ls_recv_active, crashing or hanging the cluster node, and a peer can repeat it on every reconnect.

Product Status

Vendor Linux
Product Linux
Versions Default: unaffected
  • affected from 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 to 08cb20cf07a8c5324b49442421da1556fd2d7cff (excl.)
  • affected from 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 to 35d6a8cf1b8865f4f1646f98683925e3cd070a1c (excl.)
  • affected from 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 to 69beb43cd143f63078e569d9d90c6c401c866695 (excl.)
  • affected from 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 to d785f7d92f197b72d496bbcf54a160cd54f00263 (excl.)
  • affected from 0 to 6.12.119 (excl.)
  • affected from 0 to 6.18.65 (excl.)
  • affected from 0 to 7.3.6 (excl.)
Vendor Linux
Product Linux
Versions Default: affected
  • unaffected from 6.12.119 to 6.12.* (incl.)
  • unaffected from 6.18.65 to 6.18.* (incl.)
  • unaffected from 7.3.6 to 7.3.* (incl.)
  • unaffected from 7.4-rc1 to * (incl.)

References