From nobody Thu Apr 2 20:22:05 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 B88E239183E; Thu, 26 Mar 2026 15:16:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774538189; cv=none; b=ESVGKR2xxAJXtadaU9npqe3ZroqpEedE1TbT8Gn1eY2YEEzlHD5hpe2UPSJTK0nS/dfT6p/SfdMTfn4Vmgo1KxwHlNd5yNphQIcnAh4sL1G4VrIFiseKlk+ZJnqKc4WSy/FfWlLdgRrb+1G+pF+cCHi3obc7e9kHQH22W42eeis= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774538189; c=relaxed/simple; bh=e5yVXOOy7NoEZKBuXscen3uM2WOS6O+HA82QqPhfRo0=; h=Date:From:To:Subject:Cc:MIME-Version:Message-ID:Content-Type; b=MQnv793SIA37Ukmmq7LkgtCTYYhZ+2qNyDf4HW0LZliouLS1C6wdb71Ufbmm1yykfGDYWY2Y9kviK6kiwgw4rAtJ8qtPYUiDKmgb5Oh7JXz2eNZE098HYFcAcw3zyfMVh4U4kkQ99ZlWqm+DHZUp+jOo/ZqPOH7mjvpDTmkJwSQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=wmldKR2L; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=q+gbwB/r; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="wmldKR2L"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="q+gbwB/r" Date: Thu, 26 Mar 2026 15:16:25 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1774538186; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4c7FePf8HpRJoOrnagrGwKj+2s07fy7hpqm+nO5+0eU=; b=wmldKR2LaHTxNZ6NaVx8VaZpZXmwaV2ejs/ymZHAsZM/R5oc4EzF+XDJJQm7OuOE9q5p5h b78vPHaMimVE4Q1mbvUQYIe77uMxHiuSgAretlTt27+uguPnu7FydOWuhHQaKAIYG/qsIQ x0O01dFG7OnqJK+RHXRWAtA6xivJZVDvx407Kh96AIucPS7kMTM2B6QXuG1ClCZw86+Gxs 33UE1c8r/LmIqbYuGmA6LgHCO0HfwX9uu061BpLb4/THo+a91RmRi8sJL2U++ZWWg1g3gE UHGw+AHCUvnk0RJehuvv6WAg8BKQppuz/bGFUJ0KZzTXE2MBDP67Yr2m5AFGjA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1774538186; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4c7FePf8HpRJoOrnagrGwKj+2s07fy7hpqm+nO5+0eU=; b=q+gbwB/rCdqJHCOEvBmYXoTMMmcdgzRIvADJOLrGOFSyxmLFpreXwJFLbBlP11y1BoeFBN EZMPWpUmvKQPDbBA== From: "tip-bot2 for Peter Zijlstra" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/urgent] futex: Require sys_futex_requeue() to have identical flags Cc: Nicholas Carlini , "Peter Zijlstra (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177453818509.1647592.9732270562073435523.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the locking/urgent branch of tip: Commit-ID: 19f94b39058681dec64a10ebeb6f23fe7fc3f77a Gitweb: https://git.kernel.org/tip/19f94b39058681dec64a10ebeb6f23fe7= fc3f77a Author: Peter Zijlstra AuthorDate: Thu, 26 Mar 2026 13:35:53 +01:00 Committer: Peter Zijlstra CommitterDate: Thu, 26 Mar 2026 16:13:48 +01:00 futex: Require sys_futex_requeue() to have identical flags Nicholas reported that his LLM found it was possible to create a UaF when sys_futex_requeue() is used with different flags. The initial motivation for allowing different flags was the variable sized futex, but since that hasn't been merged (yet), simply mandate the flags are identical, as is the case for the old style sys_futex() requeue operations. Fixes: 0f4b5f972216 ("futex: Add sys_futex_requeue()") Reported-by: Nicholas Carlini Signed-off-by: Peter Zijlstra (Intel) --- kernel/futex/syscalls.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kernel/futex/syscalls.c b/kernel/futex/syscalls.c index 743c7a7..77ad969 100644 --- a/kernel/futex/syscalls.c +++ b/kernel/futex/syscalls.c @@ -459,6 +459,14 @@ SYSCALL_DEFINE4(futex_requeue, if (ret) return ret; =20 + /* + * For now mandate both flags are identical, like the sys_futex() + * interface has. If/when we merge the variable sized futex support, + * that patch can modify this test to allow a difference in size. + */ + if (futexes[0].w.flags !=3D futexes[1].w.flags) + return -EINVAL; + cmpval =3D futexes[0].w.val; =20 return futex_requeue(u64_to_user_ptr(futexes[0].w.uaddr), futexes[0].w.fl= ags,