Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753634AbdHNQZE (ORCPT ); Mon, 14 Aug 2017 12:25:04 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:37238 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753610AbdHNQZB (ORCPT ); Mon, 14 Aug 2017 12:25:01 -0400 Date: Mon, 14 Aug 2017 19:24:57 +0300 From: "Kirill A. Shutemov" To: Oleg Nesterov Cc: Dmitry Safonov , Thomas Gleixner , Andy Lutomirski , Borislav Petkov , Cyrill Gorcunov , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] x86: fix norandmaps Message-ID: <20170814162457.w7ddsrmco73cfbai@node.shutemov.name> References: <20170710111429.GA20038@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170710111429.GA20038@redhat.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 722 Lines: 20 On Mon, Jul 10, 2017 at 01:14:29PM +0200, Oleg Nesterov wrote: > Documentation/admin-guide/kernel-parameters.txt says: > > norandmaps Don't use address space randomization. Equivalent > to echo 0 > /proc/sys/kernel/randomize_va_space > > but it doesn't work because arch_rnd() which is used to randomize > mm->mmap_base returns a random value unconditionally. > > Shift the PF_RANDOMIZE check from arch_mmap_rnd() to arch_rnd(). > > Fixes: 1b028f784e8c ("x86/mm: Introduce mmap_compat_base() for 32-bit mmap()") > Signed-off-by: Oleg Nesterov It also fixes personality(ADDR_NO_RANDOMIZE). Acked-by: Kirill A. Shutemov -- Kirill A. Shutemov