From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cantor2.suse.de ([195.135.220.15]:47586 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751182AbbCAUat (ORCPT ); Sun, 1 Mar 2015 15:30:49 -0500 Date: Sun, 1 Mar 2015 21:29:38 +0100 From: Borislav Petkov To: Yinghai Lu Cc: Ingo Molnar , Jiri Kosina , Kees Cook , Matt Fleming , Thomas Gleixner , "H. Peter Anvin" , Ingo Molnar , Bjorn Helgaas , Linus Torvalds , Linux Kernel Mailing List , "linux-efi@vger.kernel.org" , "linux-pci@vger.kernel.org" Subject: Re: [PATCH 1/8] x86, kaslr: get kaslr_enabled back correctly Message-ID: <20150301202938.GD7748@pd.tnic> References: <1425176259-30087-1-git-send-email-yinghai@kernel.org> <1425176259-30087-2-git-send-email-yinghai@kernel.org> <20150301094557.GA7748@pd.tnic> <20150301152351.GA17391@gmail.com> <20150301194904.GC7748@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 In-Reply-To: Sender: linux-pci-owner@vger.kernel.org List-ID: On Sun, Mar 01, 2015 at 12:24:08PM -0800, Yinghai Lu wrote: > static allocation in misc.c can not be used to kernel/head_64.S stage safely. Correct. One possibility that works is sticking it right below LOAD_PHYSICAL_ADDR: +static void add_kaslr_setup_data(struct boot_params *params, + u8 *output, __u8 enabled) { + /* + * Stick it right under LOAD_PHYSICAL_ADDR + */ + ksd = (struct setup_data *)(output - 2 * sizeof(struct setup_data)); output is LOAD_PHYSICAL_ADDR AFAICT and is the minimum kASLR considers so right below it should work: https://lkml.kernel.org/r/20150228105049.GA11038@pd.tnic -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. --