Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2490311pxj; Mon, 10 May 2021 04:21:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwdcN9Fx8mSVJxTQL4Xu/eKIOh3p1IJuxOQVMGQnl9gAE5/fqDn0A+vPE2fXXBU6Ts65bs X-Received: by 2002:a17:906:768f:: with SMTP id o15mr2688780ejm.455.1620645708843; Mon, 10 May 2021 04:21:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620645708; cv=none; d=google.com; s=arc-20160816; b=wj7s717mcDYbtsF66bg+Ko+BsBNIlYBPrBZANj8Fc3WgG3bQAZ/QPzxZWI9PMXm510 BO2PrePVFCZ/aGXoeSo/bx05rWE8dU51zLv6Dg89qB6i12xwEqpOh9XspbhYYaqcuQV+ stmoHFogE2DCmS5EAAxkSwlXpZEaQAJPnjp8j/gDk14CvZcdC6cmi80iGORD+kaf30Qk opLBzO3U7+a5fBpJblvOKePd8EybOxEUpIp2X8l8OBd4EyZjsnx1g7zm9ww6qUcHhwoi AhEL0GMJIXz4ZA2P7VYXiICCj4Q8ASlISvh++iORdYt7lpjGCZD+mk1C9bsoNTa0f0Vb eyxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PxWG1bHbosuccb4+mWNMAxFx8rpq8hyR2hCG06ozEuk=; b=lOmT3aYqtn0vb9oKhl/MBf28wLGpr8PGJh6Nb17VEFhlr9V4fJBw4otPX9tPOyAbF/ RlvPxIRLK7loT6sjc/9xyIZzOZ8+igVotjBKPgpXAKzKjQ2+iGPdWSqezRsCGaGyD1M+ RKBsVSrzH6cATeTXY++WveSQpRW4Sq+J0v+dDBmOLW/qCbA4j1y7OlPAt1PV5qbBhe+9 WmJJLSNw6LOvL4M1f1FysGnir+PpjgUWtI6zpbeb7YovtFBR8mtsuwANP94Q4gVWjtEi /ZuTSPVM9NygocUpTm+lijRNCb7V6NQsLQkqKUDMb10DcrH+/r2r5/12JAu/aHtCspuN e1Gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=op76y4kX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hp22si13052477ejc.174.2021.05.10.04.21.25; Mon, 10 May 2021 04:21:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=op76y4kX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238393AbhEJLRm (ORCPT + 99 others); Mon, 10 May 2021 07:17:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:41454 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232859AbhEJKyA (ORCPT ); Mon, 10 May 2021 06:54:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C35CD6191B; Mon, 10 May 2021 10:41:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620643302; bh=t9vyVPaU00BquSZf1lFUN3LWYimv8BiZcYOd8GS6HDM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=op76y4kX8/l4goLtQt0TxD/kXKHSbylGEBri1qeXZn8VKIcDefmCXT8UyLV9yCNbj 36R7boRnKtynJrBXESbzgoSsHKbrRC55fz2cR1ayBeIQGXuySk0vL21kKiMcbbpTXX GzNDqjpnQExNV1rZKq9UU8uX3mv3BnNgleeOCweM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Gleixner , "Peter Zijlstra (Intel)" Subject: [PATCH 5.10 260/299] Revert 337f13046ff0 ("futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op") Date: Mon, 10 May 2021 12:20:57 +0200 Message-Id: <20210510102013.541129533@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Gleixner commit 4fbf5d6837bf81fd7a27d771358f4ee6c4f243f8 upstream. The FUTEX_WAIT operand has historically a relative timeout which means that the clock id is irrelevant as relative timeouts on CLOCK_REALTIME are not subject to wall clock changes and therefore are mapped by the kernel to CLOCK_MONOTONIC for simplicity. If a caller would set FUTEX_CLOCK_REALTIME for FUTEX_WAIT the timeout is still treated relative vs. CLOCK_MONOTONIC and then the wait arms that timeout based on CLOCK_REALTIME which is broken and obviously has never been used or even tested. Reject any attempt to use FUTEX_CLOCK_REALTIME with FUTEX_WAIT again. The desired functionality can be achieved with FUTEX_WAIT_BITSET and a FUTEX_BITSET_MATCH_ANY argument. Fixes: 337f13046ff0 ("futex: Allow FUTEX_CLOCK_REALTIME with FUTEX_WAIT op") Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20210422194704.834797921@linutronix.de Signed-off-by: Greg Kroah-Hartman --- kernel/futex.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/kernel/futex.c +++ b/kernel/futex.c @@ -3714,8 +3714,7 @@ long do_futex(u32 __user *uaddr, int op, if (op & FUTEX_CLOCK_REALTIME) { flags |= FLAGS_CLOCKRT; - if (cmd != FUTEX_WAIT && cmd != FUTEX_WAIT_BITSET && \ - cmd != FUTEX_WAIT_REQUEUE_PI) + if (cmd != FUTEX_WAIT_BITSET && cmd != FUTEX_WAIT_REQUEUE_PI) return -ENOSYS; }