From: Thomas Gleixner <tglx@linutronix.de>
To: Hans Zuidam <h.zuidam@computer.org>
Cc: Jaccon Bastiaansen <jaccon.bastiaansen@gmail.com>,
x86@kernel.org, mingo@redhat.com,
"H. Peter Anvin" <hpa@zytor.com>,
Peter Zijlstra <peterz@infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
stable@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [RFC]: Possible race condition in kernel futex code
Date: Fri, 9 Oct 2015 11:25:09 +0100 (IST) [thread overview]
Message-ID: <alpine.DEB.2.11.1510091054230.6097@nanos> (raw)
In-Reply-To: <4387EFE3-55AB-433B-83E1-2AFC413C7B9A@online.nl>
Hans,
On Fri, 9 Oct 2015, Hans Zuidam wrote:
> On 9 okt. 2015, at 11:06, Thomas Gleixner <tglx@linutronix.de> wrote:
> > You cannot use an explicit 32bit read. We need an access which
> > handles the fault gracefully.
>
> The reason for the explicit read suggestion is to avoid the
> _builtin_constant_p() in __copy_from_user_nocheck(). The GCC manual
> says that there may be situations where it returns 0 even though the
> argument is a constant.
That's insane at best.
> Although none of the compiler/kernel combinations we have tried
> showed this happening, we think it is probably better to be safe
> than sorry.
So we would need something like:
futex_copy_from_user()
which can be mapped to __copy_from_user_inatomic() first. Then go
through all architectures and the asm-generic stuff and provide the
specific variants which are guaranteed to use a 32bit access.
I really prefer that we don't have to do that and the compiler people
get their act together and fix that _builtin_constant_p() thingy.
Thanks,
tglx
next prev parent reply other threads:[~2015-10-09 10:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-05 15:11 Jaccon Bastiaansen
2015-10-09 9:06 ` Thomas Gleixner
2015-10-09 9:49 ` Hans Zuidam
2015-10-09 10:25 ` Thomas Gleixner [this message]
2015-10-09 11:35 ` Peter Zijlstra
2015-10-18 0:23 ` Greg KH
2016-05-15 22:34 ` Ben Hutchings
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=alpine.DEB.2.11.1510091054230.6097@nanos \
--to=tglx@linutronix.de \
--cc=h.zuidam@computer.org \
--cc=hpa@zytor.com \
--cc=jaccon.bastiaansen@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.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
all inboxes | Powered by JetHome®