From: Jamie Lokier <jamie@shareable.org>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>,
Hugh Dickins <hugh@veritas.com>,
Ulrich Drepper <drepper@redhat.com>,
Andrew Morton <akpm@osdl.org>,
Stephen Hemminger <shemminger@osdl.org>,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] Make futex waiters take an mm or inode reference
Date: Mon, 8 Sep 2003 19:20:21 +0100 [thread overview]
Message-ID: <20030908182021.GD27097@mail.jlokier.co.uk> (raw)
Rusty Russell wrote:
> But why not solve the problem by just holding an mm reference, too?
Rusty also wrote:
> Why not make the code a *whole* lot more readable (and only marginally
> slower, if at all) by doing it in two passes: pull them off onto a
> (on-stack) list in one pass, then requeue them all in another.
This patch makes each futex waiter hold a reference to the mm or inode
that a futex is keyed on.
This is very important, because otherwise a malicious or erroneous
program can use FUTEX_FD to create futexes on mms or inodes which are
recycled, and steal wakeups from other, unrelated programs.
It isn't entirely trivial, because we can't call mmdrop() or iput()
while holding the spinlock, I think. (Does someone know to the
contrary?) Rusty, you will be glad to see that I have reimplemented
futex_requeue() exactly as you suggest: in two passes.
Ulrich will be glad to hear tst-cond2 runs just fine :)
Linus, please apply unless there are objections.
Thanks,
-- Jamie
next reply other threads:[~2003-09-08 18:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-08 18:20 Jamie Lokier [this message]
2003-09-08 18:34 ` Jamie Lokier
2003-09-08 18:52 ` Linus Torvalds
2003-09-08 20:00 ` Jamie Lokier
2003-09-09 4:02 ` Rusty Russell
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=20030908182021.GD27097@mail.jlokier.co.uk \
--to=jamie@shareable.org \
--cc=akpm@osdl.org \
--cc=drepper@redhat.com \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=shemminger@osdl.org \
--cc=torvalds@transmeta.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
all inboxes | Powered by JetHome®