From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8BD4B3D5250 for ; Mon, 30 Mar 2026 13:46:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774878366; cv=none; b=uxDCZY0oQd/vueRLEINkKMburcxQEBqS61qUkqne+2yoDDRR3MR52K5ZmWivm+b6jY3EKMGjOZV90WxV2RdIrzu9/v/LrFAkBJNtw1TKrKZ5jHVdunC5c0pWNeuXYkGgUptWUwlv4W6uHaepP08IH4QRHUuFkgN+cbikKrFnzNI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774878366; c=relaxed/simple; bh=IyEv87LY3I9DychAFOVMQlv4FpypwyjnGWXmzU1xWOM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NywkZY2w8WvsodUyGDG6WsVcPjBoJwtmUmdme+oj/13anN650OZeXD6JD2qqVNW5vmMu1znZtAccoAeQUrtJcOHM5XdDPCPUgAJFzujUZJPeNma5EiEHS9o9BM5YVopuT9gakIaMNpPWvACMmuSKdFvRQ7PU35pb6EwfAVHPJBY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=vCdMVLQu; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="vCdMVLQu" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E44251713; Mon, 30 Mar 2026 06:45:58 -0700 (PDT) Received: from J2N7QTR9R3 (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2B4CC3F7D8; Mon, 30 Mar 2026 06:46:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1774878364; bh=IyEv87LY3I9DychAFOVMQlv4FpypwyjnGWXmzU1xWOM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vCdMVLQuFnfM/tPhYKc2KdPi9f4rbAkjV1WflXMklkbxpHd8rFRBGfpTdcy968aY+ 1c0t2A1SW9oLhi4cDfJKhrwgR92ojKAua5leGgS4kafh/t+3NHBYAqthHL4bRpkcfh js5QcBpaVsqhDmbQOoeIz1PLMSDGCrvF2BGlOJqg= Date: Mon, 30 Mar 2026 14:45:59 +0100 From: Mark Rutland To: Thomas Gleixner Cc: LKML , Mathieu Desnoyers , =?utf-8?B?QW5kcsOo?= Almeida , Sebastian Andrzej Siewior , Carlos O'Donell , Peter Zijlstra , Florian Weimer , Rich Felker , Torvald Riegel , Darren Hart , Ingo Molnar , Davidlohr Bueso , Arnd Bergmann , "Liam R . Howlett" , Uros Bizjak , Thomas =?utf-8?Q?Wei=C3=9Fschuh?= Subject: Re: [patch V3 00/14] futex: Address the robust futex unlock race for real Message-ID: References: <20260330114212.927686587@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260330114212.927686587@kernel.org> On Mon, Mar 30, 2026 at 02:01:58PM +0200, Thomas Gleixner wrote: > This is a follow up to v2 which can be found here: > > https://lore.kernel.org/20260319225224.853416463@kernel.org > > The v1 cover letter contains a detailed analysis of the underlying > problem: > > https://lore.kernel.org/20260316162316.356674433@kernel.org > > TLDR: > > The robust futex unlock mechanism is racy in respect to the clearing of the > robust_list_head::list_op_pending pointer because unlock and clearing the > pointer are not atomic. The race window is between the unlock and clearing > the pending op pointer. If the task is forced to exit in this window, exit > will access a potentially invalid pending op pointer when cleaning up the > robust list. That happens if another task manages to unmap the object > containing the lock before the cleanup, which results in an UAF. In the > worst case this UAF can lead to memory corruption when unrelated content > has been mapped to the same address by the time the access happens. > > User space can't solve this problem without help from the kernel. This > series provides the kernel side infrastructure to help it along: > > 1) Combined unlock, pointer clearing, wake-up for the contended case > > 2) VDSO based unlock and pointer clearing helpers with a fix-up function > in the kernel when user space was interrupted within the critical > section. I see the vdso bits in this series are specific to x86. Do other architectures need something here? I might be missing some context; I'm not sure whether that's not necessary or just not implemented by this series, and so I'm not sure whether arm64 folk and other need to go dig into this. [...] > Changes since v2: > - Rename ARCH_STORE_IMPLIES_RELEASE to ARCH_MEMORY_ORDER_TOS - Peter I believe that should be s/TOS/TSO/, since the standard terminology is Total Store Order (TSO). Mark.