From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753000AbdHNQUK (ORCPT ); Mon, 14 Aug 2017 12:20:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60988 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752314AbdHNQUI (ORCPT ); Mon, 14 Aug 2017 12:20:08 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 15F2B77921 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=oleg@redhat.com Date: Mon, 14 Aug 2017 18:20:02 +0200 From: Oleg Nesterov To: Cyrill Gorcunov Cc: "Kirill A. Shutemov" , Linus Torvalds , x86@kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Andrew Morton , Andy Lutomirski , Dmitry Safonov , Borislav Petkov , linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable Subject: Re: [PATCH] x86/mm: Fix personality(ADDR_NO_RANDOMIZE) Message-ID: <20170814162002.GA9559@redhat.com> References: <20170814155719.74839-1-kirill.shutemov@linux.intel.com> <20170814161347.GO2005@uranus.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170814161347.GO2005@uranus.lan> User-Agent: Mutt/1.5.24 (2015-08-30) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 14 Aug 2017 16:20:08 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/14, Cyrill Gorcunov wrote: > > On Mon, Aug 14, 2017 at 06:57:19PM +0300, Kirill A. Shutemov wrote: > > In v4.12, during rework of infrastructure around mmap_base, disable-ASLR > > personality flag got accidentally broken. > > > > Let's make it work again. > > > > Signed-off-by: Kirill A. Shutemov > > Fixes: 1b028f784e8c ("x86/mm: Introduce mmap_compat_base() for 32-bit mmap()") > > Cc: stable [4.12+] > > --- > > arch/x86/mm/mmap.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c > > index 229d04a83f85..779bdbe5e424 100644 > > --- a/arch/x86/mm/mmap.c > > +++ b/arch/x86/mm/mmap.c > > @@ -127,6 +127,8 @@ static unsigned long mmap_legacy_base(unsigned long rnd, > > static void arch_pick_mmap_base(unsigned long *base, unsigned long *legacy_base, > > unsigned long random_factor, unsigned long task_size) > > { > > + if (!(current->flags & PF_RANDOMIZE)) > > + random_factor = 0; > > *legacy_base = mmap_legacy_base(random_factor, task_size); > > if (mmap_is_legacy()) > > *base = *legacy_base; > > Didn't Oleg's patch does the same? > > https://patchwork.kernel.org/patch/9832697/ at first glance yes, thanks Cyrill. And note that we do not need another PF_RANDOMIZE check. > for some reason it's not yet merged. because nobody cares ;) Oleg.