From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968207AbaLLQec (ORCPT ); Fri, 12 Dec 2014 11:34:32 -0500 Received: from smtpsal1.cc.upv.es ([158.42.249.61]:47486 "EHLO smtpsalv.upv.es" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S968139AbaLLQeb (ORCPT ); Fri, 12 Dec 2014 11:34:31 -0500 Message-ID: <548B18AC.9@upv.es> Date: Fri, 12 Dec 2014 17:32:44 +0100 From: Hector Marco User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Kees Cook CC: linux-kernel@vger.kernel.org, Andy Lutomirski , David Daney , Jiri Kosina , Arun Chandran , =?ISO-8859-1?Q?Hanno_B=F6ck?= , Andrew Morton , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Russell King - ARM Linux , Catalin Marinas , Will Deacon , Oleg Nesterov , Heiko Carstens , Martin Schwidefsky , Anton Blanchard , Benjamin Herrenschmidt , Christian Borntraeger , Reno Robert , Ismael Ripoll Subject: Re: [PATCH] ASLRv3: randomize_va_space=3 preventing offset2lib attack References: <5489E6D2.2060200@upv.es> <5489FAAD.7000606@upv.es> <20141211221158.GS18807@outflux.net> In-Reply-To: <20141211221158.GS18807@outflux.net> X-Enigmail-Version: 1.5.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, I agree. I don't think a new randomization mode will be needed, just fix the current randomize_va_space=2. Said other way: fixing the offset2lib will not break any current program and so, no need to add additional configuration options. May be we shall wait for some inputs from the list (may be we are missing something). Regarding to VDSO, definitively, is not randomized enough in 64bits. Brute force attacks would be pretty fast even from the network. I have identified the bug and seems quite easy to fix it. On 32bit systems, this is not a issue because it is mapped in the mmap area. In order to fix the VDSO on 64bit, the following considerations shall be discussed: Performance: It seems (reading the kernel comments) that the random allocation algorithm tries to place the VDSO in the same PTE than the stack. But since the permissions of the stack and the VDSO are different it seems that are getting right the opposite. Effectively VDSO shall be correctly randomized because it contains enough useful exploitable stuff. I think that the possible solution is follow the x86_32 approach which consist on map the VDSO in the mmap area. It would be better fix VDSO in a different patch ? I can send a patch which fixes the VDSO on 64 bit. Regards, Hector Marco.