mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joseph Qi <joseph.qi@linux.alibaba.com>
To: hexlabsecurity@proton.me, Mark Fasheh <mark@fasheh.com>,
	Joel Becker <jlbec@evilplan.org>
Cc: linux-kernel@vger.kernel.org, ocfs2-devel@lists.linux.dev,
	Andrew Morton <akpm@linux-foundation.org>,
	Kurt Hackel <kurt.hackel@oracle.com>
Subject: Re: [PATCH 0/2] ocfs2/dlm: bound peer-controlled lengths in the o2dlm receive path
Date: Thu, 2 Jul 2026 13:56:00 +0800	[thread overview]
Message-ID: <18449469-291f-4f39-be62-faec1513645a@linux.alibaba.com> (raw)
In-Reply-To: <20260629-b4-disp-94fb6521-v1-0-6953bcc0421f@proton.me>

Ocfs2 is always deployed in trusted network, so how to trigger this
issue in real environment?

In a properly administered ocfs2 cluster with trusted nodes and no
compromised machines, this looks essentially unreachable.

IMO, the patches are reasonable as a belt hardening against future bugs
or operational accidents, but not overstate the risk by framing it as a
security vulnerability.

Thanks,
Joseph

On 6/29/26 1:01 PM, Bryam Vargas via B4 Relay wrote:
> The o2dlm receive handlers trust u8 length and count fields from the wire
> without bounding them, so a node in a DLM domain can corrupt or panic any
> other node with a malformed message. Three defects:
> 
>   - dlm_migrate_request_handler() passes migrate->namelen unchecked to
>     dlm_init_mle(), which memcpy()s it into the 32-byte mname[] of an
>     o2dlm_mle slab object: a heap out-of-bounds write of up to ~215
>     attacker-controlled bytes.
> 
>   - dlm_mig_lockres_handler() passes mres->lockname_len unchecked to
>     dlm_init_lockres(), which memcpy()s it into the 32-byte o2dlm_lockname
>     slab object: a heap out-of-bounds write of up to ~223 bytes.
> 
>   - the same handler trusts mres->num_locks without checking that the
>     message is large enough to hold that many entries, so
>     dlm_process_recovery_data() walks mres->ml[] past the kmalloc(data_len)
>     copy and trips a BUG_ON (an out-of-bounds read ending in a panic).
> 
> The other o2dlm receive handlers already reject an oversized name; the
> migration and recovery handlers have omitted it since the DLM was added (see
> the Fixes tags). Patch 1 bounds namelen; patch 2 validates lockname_len,
> num_locks, and the payload size. Conforming recovery and migration traffic is
> unaffected.
> 
> o2net authenticates peers only by the DLM domain key, so any node that has
> joined the domain -- including a compromised or malicious member -- can send
> these messages. There is no local trigger; the attacker must already be a
> member of the cluster.
> 
> Each sink was confirmed under KASAN with an out-of-tree module mirroring it
> exactly -- a kmem_cache/kmalloc of the real destination size, then the same
> unclamped memcpy/loop: slab-out-of-bounds Write for the two writes, Read for
> the recovery walk, and a panic. A userspace AddressSanitizer build faults
> identically under -m32 and -m64. Scrubbed logs are available on request.
> 
> I reported this privately to security@kernel.org and the ocfs2 maintainers on
> 2026-06-20; with no response after the standard embargo period I am posting
> the fix publicly. I have no embargo requirement.
> 
> Bryam Vargas (2):
>   ocfs2: bound namelen in dlm_migrate_request_handler
>   ocfs2: validate lengths in dlm_mig_lockres_handler
> 
> fs/ocfs2/dlm/dlmmaster.c   | 6 ++++++
>  fs/ocfs2/dlm/dlmrecovery.c | 9 +++++++++
>  2 files changed, 15 insertions(+)
> 
> ---
> Bryam Vargas (2):
>       ocfs2: bound namelen in dlm_migrate_request_handler
>       ocfs2: validate lengths in dlm_mig_lockres_handler
> 
>  fs/ocfs2/dlm/dlmmaster.c   | 6 ++++++
>  fs/ocfs2/dlm/dlmrecovery.c | 9 +++++++++
>  2 files changed, 15 insertions(+)
> ---
> base-commit: 4549871118cf616eecdd2d939f78e3b9e1dddc48
> change-id: 20260629-b4-disp-94fb6521-0afa227d464c
> 
> Best regards,


  parent reply	other threads:[~2026-07-02  5:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-29  5:01 Bryam Vargas via B4 Relay
2026-06-29  5:01 ` [PATCH 1/2] ocfs2: bound namelen in dlm_migrate_request_handler Bryam Vargas via B4 Relay
2026-07-02 11:03   ` Joseph Qi
2026-06-29  5:01 ` [PATCH 2/2] ocfs2: validate lengths in dlm_mig_lockres_handler Bryam Vargas via B4 Relay
2026-07-02 11:05   ` Joseph Qi
2026-07-02  5:56 ` Joseph Qi [this message]
2026-07-02  9:27   ` [PATCH 0/2] ocfs2/dlm: bound peer-controlled lengths in the o2dlm receive path Bryam Vargas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18449469-291f-4f39-be62-faec1513645a@linux.alibaba.com \
    --to=joseph.qi@linux.alibaba.com \
    --cc=akpm@linux-foundation.org \
    --cc=hexlabsecurity@proton.me \
    --cc=jlbec@evilplan.org \
    --cc=kurt.hackel@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark@fasheh.com \
    --cc=ocfs2-devel@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®