public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Davidlohr Bueso <dave@stgolabs.net>,
	Peter Zijlstra <peterz@infradead.org>
Cc: mingo@redhat.com, dvhart@infradead.org,
	linux-kernel@vger.kernel.org, Davidlohr Bueso <dbueso@suse.de>
Subject: Re: [PATCH 2/2] futex: Leave the pi lock stealer in a consistent state upon successful fault
Date: Tue, 16 Mar 2021 20:48:54 +0100	[thread overview]
Message-ID: <87im5qzxp5.fsf@nanos.tec.linutronix.de> (raw)
In-Reply-To: <20210316180305.sh7nyi4xjskd3e3j@offworld>

On Tue, Mar 16 2021 at 11:03, 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?)
>
> However, as 34b1a1ce145 describes, it was cared enough about users to
> protect them against spurious runaway tasks. And this is why I decided
> to even send the patch; it fixes, without sacrificing performance or
> additional complexity, a potentially user visible issue which could be
> due to programming error. And unlike 34b1a1ce145, where a stealer that
> cannot fault ends up dropping the lock, here the stealer can actually
> amend things and not break semantics because of another task's stupidity.
> But yeah, this could also be considered in the category of inept attempts
> to fix a rotten situation.

It's one of the 'Doctor it hurts when I shoot myself in the foot' cases :)

  reply	other threads:[~2021-03-16 19:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15  5:02 [PATCH -tip 0/2] futex: Two pi fixes Davidlohr Bueso
2021-03-15  5:02 ` [PATCH 1/2] futex: Fix irq mismatch in exit_pi_state_list() Davidlohr Bueso
2021-03-15 13:12   ` Peter Zijlstra
2021-03-15 19:03     ` Davidlohr Bueso
2021-03-15  5:02 ` [PATCH 2/2] futex: Leave the pi lock stealer in a consistent state upon successful fault Davidlohr Bueso
2021-03-16 11:20   ` Peter Zijlstra
2021-03-16 18:03     ` Davidlohr Bueso
2021-03-16 19:48       ` Thomas Gleixner [this message]
2021-03-16 20:12       ` Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87im5qzxp5.fsf@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=dave@stgolabs.net \
    --cc=dbueso@suse.de \
    --cc=dvhart@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox