From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 483C8C433DB for ; Tue, 16 Mar 2021 20:13:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F091364EBD for ; Tue, 16 Mar 2021 20:13:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229845AbhCPUNQ (ORCPT ); Tue, 16 Mar 2021 16:13:16 -0400 Received: from casper.infradead.org ([90.155.50.34]:34002 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229549AbhCPUM6 (ORCPT ); Tue, 16 Mar 2021 16:12:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=rTDrt6R4KroMdKMf+HF0nCxGja3tnnOqB93Y69bQc8A=; b=SqFM4nBmd8DMru5yIZ1oGwoJYi VQSxS5qUoNr2R7caNJKcWQHOKeScP+wzL487DwKsWnqMQcEA6VI6lTAUm6kTtimHeQTrdl7F638ah OO0Vrb1pnGFhumMnQftv/52wi2ZWqdVb1OL8mcHYA1XdVMCoWMJAKMop/UJOYGvml04rW4uu1cA/a UrvMrOPRGPKo6WPatCVXVL3eL71V8aYlg0qoTb/za+FOWbGz7wkR/ifdqtfRpzCc5TD3DQXQSof7n Fpqoc0ZrQYDlXjW/26la1NZgxypdZhelg1DQHjqaQXeP6bCqK0iYdeRn5aZhwo23diShWUMiiYSrL MQWt7wWg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lMG3N-000Z6d-15; Tue, 16 Mar 2021 20:12:36 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 8B37F304D58; Tue, 16 Mar 2021 21:12:32 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 77D7A2C950467; Tue, 16 Mar 2021 21:12:32 +0100 (CET) Date: Tue, 16 Mar 2021 21:12:32 +0100 From: Peter Zijlstra To: Davidlohr Bueso Cc: tglx@linutronix.de, mingo@redhat.com, dvhart@infradead.org, linux-kernel@vger.kernel.org, Davidlohr Bueso Subject: Re: [PATCH 2/2] futex: Leave the pi lock stealer in a consistent state upon successful fault Message-ID: References: <20210315050224.107056-1-dave@stgolabs.net> <20210315050224.107056-3-dave@stgolabs.net> <20210316180305.sh7nyi4xjskd3e3j@offworld> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210316180305.sh7nyi4xjskd3e3j@offworld> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 16, 2021 at 11:03:05AM -0700, Davidlohr Bueso wrote: > On Tue, 16 Mar 2021, Peter Zijlstra wrote: > > > > IIRC we made the explicit choice to never loop here. That saves having > > to worry about getting stuck in in-kernel loops. > > > > Userspace triggering the case where the futex goes corrupt is UB, after > > that we have no obligation for anything to still work. It's on them, > > they get to deal with the bits remaining. > > I was kind of expecting this answer, honestly. After all, we are warned > about violations to the 10th: > > * [10] There is no transient state which leaves owner and user space > * TID out of sync. Except one error case where the kernel is denied > * write access to the user address, see fixup_pi_state_owner(). > > (btw, should we actually WARN_ON_ONCE this case such that the user is > well aware things are screwed up?) I'm not sure WARN is appropriate, it is something unpriv userspace can trigger at will.