Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753293AbbCACSl (ORCPT ); Sat, 28 Feb 2015 21:18:41 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:35366 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753247AbbCACSh (ORCPT ); Sat, 28 Feb 2015 21:18:37 -0500 From: Yinghai Lu To: Matt Fleming , Thomas Gleixner , "H. Peter Anvin" , Ingo Molnar , Jiri Kosina , Borislav Petkov , Bjorn Helgaas Cc: linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, linux-pci@vger.kernel.org, Yinghai Lu Subject: [PATCH 1/8] x86, kaslr: get kaslr_enabled back correctly Date: Sat, 28 Feb 2015 18:17:32 -0800 Message-Id: <1425176259-30087-2-git-send-email-yinghai@kernel.org> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1425176259-30087-1-git-send-email-yinghai@kernel.org> References: <1425176259-30087-1-git-send-email-yinghai@kernel.org> X-Source-IP: ucsinet21.oracle.com [156.151.31.93] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1194 Lines: 37 We should access variable with referrence instead of using physical address as value. Cc: Matt Fleming Cc: Borislav Petkov Signed-off-by: Yinghai Lu --- arch/x86/kernel/setup.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index 98dc931..05d444f 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c @@ -429,7 +429,13 @@ static void __init reserve_initrd(void) static void __init parse_kaslr_setup(u64 pa_data, u32 data_len) { - kaslr_enabled = (bool)(pa_data + sizeof(struct setup_data)); + /* kaslr_setup_data is defined in aslr.c */ + unsigned char *data; + unsigned long offset = sizeof(struct setup_data); + + data = early_memremap(pa_data, offset + 1); + kaslr_enabled = *(data + offset); + early_memunmap(data, offset + 1); } static void __init parse_setup_data(void) -- 1.8.4.5 -- 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/