From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8999834FF58 for ; Wed, 11 Feb 2026 08:14:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770797675; cv=none; b=pluxJhSjeHRdauDDgszUI/F+NRA/inG/Q1NUtz5eSNMIqT7emNly+RBORrpB+Z1+z4TijSSNMAI/jgxoOq8flAT605riYTlcbnoA2IVDk1COTjzuj6ApcbKLHPnvJCHAcFACmG6/nBvj1XJZ5aavpGQZEDBKF+xgPSr2V6jYRoY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770797675; c=relaxed/simple; bh=dYk9nV+MeZWB2upcis6qOWG8gzDLEsk46W/eGdNVdCQ=; h=From:To:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=dmDAwl9eFH3s5VeATGzC4fpbaqDo1gXADjw3/aNCTrqk1IXBQ1DPcngg9S4fc9rwAtV2HmDMldxb5jRDw1MQwOHjSM+ouGDXulLg6EUJWgTkxgDKaMHJa39az+ABR/APbzX5FmqtOb6ZjROrOfyKOwsPMVnLJzfjXPHCs6KBH3w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vDXKzWn3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="vDXKzWn3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B00A7C4CEF7; Wed, 11 Feb 2026 08:14:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770797675; bh=dYk9nV+MeZWB2upcis6qOWG8gzDLEsk46W/eGdNVdCQ=; h=From:To:Subject:In-Reply-To:References:Date:From; b=vDXKzWn3G46ulIAJfFNIsbzXX2o5ffKMWC7OpXPDgbrvRFiususZP+9IKR/fPdxcY OaIFFWIhQ3nNKvZWd/x1noC4OE9mYRMg5gTdm+KrlYXS0Wg5Z4Ang5+4r2uYZ3j1mw OoVRNV8uPMb30a0ArJydqR9aUvgMhdOcUfou4e1He37WoW6mfG9zld0QDlFNHi4SsQ y9ssedHDThJinylTlEgAQHNzi/SnBA4TkXc/pm9WGpMuqXqyKwn3eo6/FO1MmhPeFc uU8kasPE6yNPPT9ZJDfxiH2DxCUQiTb5yXPQ36Sv8Z9lvuAn2PMjSNGPafB7edNOCl pB/jmatAiGy+g== From: Thomas Gleixner To: syzbot , linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: Forwarded: [PATCH] futex: Fix use-after-free in futex_unqueue() on private hash teardown In-Reply-To: <698bf81c.050a0220.340abe.000a.GAE@google.com> References: <698bf81c.050a0220.340abe.000a.GAE@google.com> Date: Wed, 11 Feb 2026 09:14:31 +0100 Message-ID: <874innae8o.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Tue, Feb 10 2026 at 19:31, syzbot wrote: > Subject: [PATCH] futex: Fix use-after-free in futex_unqueue() on private hash teardown > Author: suunj1331@gmail.com > > futex_hash_free() frees the private hash table with kvfree() in the > __mmput() path. However, a task sharing the same mm via CLONE_VM may > still be in futex_unqueue() which relies on RCU read-side protection > (guard(rcu)) when acquiring the hash bucket spinlock. > > Since kvfree() does not respect RCU grace periods, the hash bucket > memory can be reclaimed while futex_unqueue() is still referencing it, > leading to a use-after-free on the embedded spinlock. > > Use kvfree_rcu() instead, which defers freeing until after an RCU grace > period, matching the protection already assumed by futex_unqueue(). > > The futex_private_hash structure already has an rcu_head field used by > the pivot path (__futex_pivot_hash), so no structural changes are needed. This does not fix anything as I explained already before: https://lore.kernel.org/lkml/87o6lwa0fl.ffs@tglx/ https://lore.kernel.org/all/87qzqsa1br.ffs@tglx/ The futex code has absolutely nothing to do with this and is entirely correct. Thanks, tglx