Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964820Ab3DOW5L (ORCPT ); Mon, 15 Apr 2013 18:57:11 -0400 Received: from mail-ie0-f177.google.com ([209.85.223.177]:42889 "EHLO mail-ie0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934768Ab3DOW5K (ORCPT ); Mon, 15 Apr 2013 18:57:10 -0400 MIME-Version: 1.0 In-Reply-To: References: <1365797627-20874-1-git-send-email-keescook@chromium.org> <1365797627-20874-7-git-send-email-keescook@chromium.org> <516A1D49.1050100@zytor.com> <516C702C.2030209@zytor.com> <516C751B.4020505@zytor.com> Date: Mon, 15 Apr 2013 15:57:09 -0700 X-Google-Sender-Auth: hQyGhMfQrVWQaa_MCVsijhyN3BM Message-ID: Subject: Re: [PATCH 6/6] x86: kaslr: relocate base offset at boot From: Yinghai Lu To: Kees Cook Cc: "H. Peter Anvin" , Eric Northup , Linux Kernel Mailing List , "kernel-hardening@lists.openwall.com" , Thomas Gleixner , Ingo Molnar , "the arch/x86 maintainers" , Jarkko Sakkinen , Matthew Garrett , Matt Fleming , Dan Rosenberg , Julien Tinnes , Will Drewry Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1146 Lines: 26 On Mon, Apr 15, 2013 at 3:42 PM, Kees Cook wrote: > On Mon, Apr 15, 2013 at 3:38 PM, Yinghai Lu wrote: > >> so the decompressed image is not moved high? > > No, I mean the size of the relocated image is using z_extract_offset > as the end size of the relocated memory. See select_aslr_address. It > takes the chosen aslr offset plus the location of z_extract_offset and > keeps reducing the offset until it's inside the physical end of > memory. My point is: If you move the decompressed high, for example, before aslr uncompressed vmlinx is on [1024g+16M, 1024g+256M). after aslr, it is on [1024g+16M + 32M, 1024g+256M + 32M). You will need to make sure that 32M is still RAM in e820 memmap. also those range should not be with boot_param, command line, and initrd. as bootloader could put boot_param, commandline and initrd in that 32M range. Yinghai -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/