summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@libc.org>2016-04-25 03:01:18 +0000
committerRich Felker <dalias@libc.org>2016-08-02 03:52:28 +0000
commit31692abfe50f2db1faed9cb5e0e446a12716eddb (patch)
tree1ea4090df1da26fe9d59c08a44a667024b5cbc0e
parent7466cb7588e0451ab02e03bc8a7cbbfe90235350 (diff)
downloadlinux-sh-devel-20160801.tar.gz
futex: fix shared futex operations on nommudevel-20160801
The shared get_futex_key code does not work on nommu, but is not needed anyway because it's impossible for a given backing to have multiple distinct virtual addresses on nommu. Simply disable these code paths by refraining from setting FLAG_SHARED when CONFIG_MMU is not enabled. Signed-off-by: Rich Felker <dalias@libc.org>
-rw-r--r--kernel/futex.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/futex.c b/kernel/futex.c
index 33664f70e2d2..b384f312a65a 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -3158,8 +3158,10 @@ long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout,
int cmd = op & FUTEX_CMD_MASK;
unsigned int flags = 0;
+#ifdef CONFIG_MMU
if (!(op & FUTEX_PRIVATE_FLAG))
flags |= FLAGS_SHARED;
+#endif
if (op & FUTEX_CLOCK_REALTIME) {
flags |= FLAGS_CLOCKRT;