lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260103103247.9140cb2556280927b09f59d3@linux-foundation.org>
Date: Sat, 3 Jan 2026 10:32:47 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Boudewijn van der Heide <boudewijn@...ta-utec.com>
Cc: "Liam R . Howlett" <Liam.Howlett@...cle.com>, Alice Ryhl
 <aliceryhl@...gle.com>, Andrew Ballance <andrewjballance@...il.com>,
 maple-tree@...ts.infradead.org, linux-mm@...ck.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] maple_tree: Add dead node check in mas_dup_alloc()

On Sat,  3 Jan 2026 17:57:58 +0100 Boudewijn van der Heide <boudewijn@...ta-utec.com> wrote:

> The __mt_dup() function is exported and can be called without internal
> locking, relying on the caller to provide appropriate synchronization.
> If a caller fails to hold proper locks, the source tree may be modified
> concurrently, potentially resulting in dead nodes during traversal.
> 
> The call stack is:
>   __mt_dup()
>     → mas_dup_build()
>       → mas_dup_alloc()  [accesses node->slot[]]
> 
> The mas_dup_alloc() function may access node slots without first
> verifying that the node is still alive. If a dead node is encountered,
> its memory layout may have been switched to the RCU union member, making
> slot array access undefined behavior as we would be reading from the
> rcu_head structure instead.
> 
> Add an explicit dead node check to detect concurrent modification during
> duplication. When a dead node is detected, return -EBUSY to indicate that
> the tree is undergoing concurrent modification.
> 
> Signed-off-by: Boudewijn van der Heide <boudewijn@...ta-utec.com>
> 
> ---
> 
> Build-tested and boot-tested with QEMU with Buildroot on x86_64. The
> kernel booted and basic commandline operations work correctly. The race
> condition this patch addresses is difficult to reproduce in testing, as
> it requires concurrent tree modifications without proper locking.

Thanks.

What are the worst-case userspace-visible runtime effects when this
happens?

If they're bad then presumably we'll want to backport this fix into
earlier kernels with a Cc: <stable@...r.kernel.org> and, very
preferably a Fixes: line.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ