Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965410AbcCKIv0 (ORCPT ); Fri, 11 Mar 2016 03:51:26 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35797 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964775AbcCKIvN (ORCPT ); Fri, 11 Mar 2016 03:51:13 -0500 Date: Fri, 11 Mar 2016 09:51:08 +0100 From: Ingo Molnar To: Hector Marco-Gisbert Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, kees Cook , Ismael Ripoll Ripoll Subject: Re: [PATCH] x86: Enable full randomization on i386 and X86_32. Message-ID: <20160311085108.GA29750@gmail.com> References: <1457639460-5242-1-git-send-email-hecmargi@upv.es> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1457639460-5242-1-git-send-email-hecmargi@upv.es> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1844 Lines: 41 * Hector Marco-Gisbert wrote: > Currently on i386 and on X86_64 when emulating X86_32 in legacy mode, only > the stack and the executable are randomized but not other mmapped files > (libraries, vDSO, etc.). This patch enables randomization for the > libraries, vDSO and mmap requests on i386 and in X86_32 in legacy mode. > > By default on i386 there are 8 bits for the randomization of the libraries, > vDSO and mmaps which only uses 1MB of VA. > > This patch preserves the original randomness, using 1MB of VA out of 3GB or > 4GB. We think that 1MB out of 3GB is not a big cost for having the ASLR. > > The first obvious security benefit is that all objects are randomized (not > only the stack and the executable) in legacy mode which highly increases > the ASLR effectiveness, otherwise the attackers may use these > non-randomized areas. But also sensitive setuid/setgid applications are > more secure because currently, attackers can disable the randomization of > these applications by setting the ulimit stack to "unlimited". This is a > very old and widely known trick to disable the ASLR in i386 which has been > allowed for too long. > > Another trick used to disable the ASLR was to set the ADDR_NO_RANDOMIZE > personality flag, but fortunately this doesn't work on setuid/setgid > applications because there is security checks which clear Security-relevant > flags. > > This patch always randomizes the mmap_legacy_base address, removing the > possibility to disable the ASLR by setting the stack to "unlimited". > > > Signed-off-by: Hector Marco-Gisbert > Signed-off-by: Ismael Ripoll Ripoll This signoff line is not valid (primary author is first SOB line, patch submitted is last SOB line), I've changed the second Signed-off-by to an Acked-by. Thanks, Ingo