From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751685AbcDZBDL (ORCPT ); Mon, 25 Apr 2016 21:03:11 -0400 Received: from 216-12-86-13.cv.mvl.ntelos.net ([216.12.86.13]:57653 "EHLO brightrain.aerifal.cx" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750749AbcDZBDJ (ORCPT ); Mon, 25 Apr 2016 21:03:09 -0400 Date: Mon, 25 Apr 2016 21:03:03 -0400 From: Rich Felker To: linux-kernel@vger.kernel.org Cc: Thomas Gleixner , Davidlohr Bueso , Ingo Molnar , Andrew Morton , Darren Hart , Mel Gorman , Sebastian Andrzej Siewior , "Kirill A. Shutemov" , Greg Ungerer , Geert Uytterhoeven , Yoshinori Sato Subject: [PATCH] futex: fix shared futex operations on nommu Message-ID: <20160426010303.GA3706@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- kernel/futex.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/futex.c b/kernel/futex.c index a5d2e74..ed6f475 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -3131,8 +3131,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; -- 2.8.1