From: Greg KH <gregkh@linuxfoundation.org>
To: Sharan Turlapati <sturlapati@vmware.com>
Cc: stable@vger.kernel.org, lee.jones@linaro.org,
srivatsab@vmware.com, srivatsa@csail.mit.edu,
amakhalov@vmware.com, srinidhir@vmware.com, bvikas@vmware.com,
anishs@vmware.com, vsirnapalli@vmware.com, akaher@vmware.com
Subject: Re: [PATCH v4.4.y] futex: Ensure the correct return value from futex_lock_pi()
Date: Thu, 4 Mar 2021 14:11:15 +0100 [thread overview]
Message-ID: <YEDccyrqhM5gGy7d@kroah.com> (raw)
In-Reply-To: <20210302194749.82945-1-sturlapati@vmware.com>
On Tue, Mar 02, 2021 at 11:47:49AM -0800, Sharan Turlapati wrote:
> From: Thomas Gleixner <tglx@linutronix.de>
>
> commit 12bb3f7f1b03d5913b3f9d4236a488aa7774dfe9 upstream
>
> In case that futex_lock_pi() was aborted by a signal or a timeout and the
> task returned without acquiring the rtmutex, but is the designated owner of
> the futex due to a concurrent futex_unlock_pi() fixup_owner() is invoked to
> establish consistent state. In that case it invokes fixup_pi_state_owner()
> which in turn tries to acquire the rtmutex again. If that succeeds then it
> does not propagate this success to fixup_owner() and futex_lock_pi()
> returns -EINTR or -ETIMEOUT despite having the futex locked.
>
> Return success from fixup_pi_state_owner() in all cases where the current
> task owns the rtmutex and therefore the futex and propagate it correctly
> through fixup_owner(). Fixup the other callsite which does not expect a
> positive return value.
>
> Fixes: c1e2f0eaf015 ("futex: Avoid violating the 10th rule of futex")
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> Cc: stable@vger.kernel.org
> [Sharan: Backported patch for kernel 4.4.y. Also folded in is a part
> of the cleanup patch d7c5ed73b19c("futex: Remove needless goto's")]
> Signed-off-by: Sharan Turlapati <sturlapati@vmware.com>
> ---
> kernel/futex.c | 24 ++++++++++++------------
> 1 file changed, 12 insertions(+), 12 deletions(-)
Now queued up, thanks.
greg k-h
prev parent reply other threads:[~2021-03-04 13:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-02 19:47 [PATCH v4.4.y] futex: Ensure the correct return value from futex_lock_pi() Sharan Turlapati
2021-03-04 13:11 ` Greg KH [this message]
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=YEDccyrqhM5gGy7d@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=akaher@vmware.com \
--cc=amakhalov@vmware.com \
--cc=anishs@vmware.com \
--cc=bvikas@vmware.com \
--cc=lee.jones@linaro.org \
--cc=srinidhir@vmware.com \
--cc=srivatsa@csail.mit.edu \
--cc=srivatsab@vmware.com \
--cc=stable@vger.kernel.org \
--cc=sturlapati@vmware.com \
--cc=vsirnapalli@vmware.com \
/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