]> git.hungrycats.org Git - linux/commit
[PATCH] Fix futex hashing bugs
authorHugh Dickins <hugh@veritas.com>
Sat, 6 Sep 2003 05:28:20 +0000 (22:28 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Sat, 6 Sep 2003 05:28:20 +0000 (22:28 -0700)
commitf5ecfe8f690037ce631b2289f7f02ed699d2b230
tree35807376f1322023d67099f21c2a85d7a9c9c907
parentfaff7e92c34815dbd7e90f86f9259ad18b01f181
[PATCH] Fix futex hashing bugs

This fixes two buts that the glibc NPTL verification tests found, one
new and one old.

The new bug is that "offset" has been declared as an alternative in
the union, instead of as an element in the structures comprising it,
effectively eliminating it from the key: keys match which should not.

The old bug is that if futex_requeue were called with identical
key1 and key2 (sensible? tended to happen given the first bug),
it was liable to loop for a long time holding futex_lock: guard
against that, still respecting the semantics of futex_requeue.

While here, please let's also fix the get_futex_key VM_NONLINEAR
case, which was returning the 1 from get_user_pages, taken as an
error by its callers.  And save a few bytes and improve debuggability
by uninlining the top-level futex_wake, futex_requeue, futex_wait.
kernel/futex.c