Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756440AbcCaMiQ (ORCPT ); Thu, 31 Mar 2016 08:38:16 -0400 Received: from mail-lb0-f181.google.com ([209.85.217.181]:36675 "EHLO mail-lb0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751038AbcCaMiO (ORCPT ); Thu, 31 Mar 2016 08:38:14 -0400 Subject: Re: [PATCH v2 11/11] MIPS: KASLR: Print relocation Information on boot To: Matt Redfearn , Ralf Baechle References: <1459415142-3412-1-git-send-email-matt.redfearn@imgtec.com> <1459415142-3412-12-git-send-email-matt.redfearn@imgtec.com> Cc: linux-mips@linux-mips.org, kernel-hardening@lists.openwall.com, Aaro Koskinen , Masahiro Yamada , Alexander Sverdlin , linux-kernel@vger.kernel.org, Jaedon Shin , Jonas Gorski , Paul Burton From: Sergei Shtylyov Message-ID: <56FD1A32.10204@cogentembedded.com> Date: Thu, 31 Mar 2016 15:38:10 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <1459415142-3412-12-git-send-email-matt.redfearn@imgtec.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1214 Lines: 39 Hello. On 3/31/2016 12:05 PM, Matt Redfearn wrote: > When debugging a relocated kernel, the addresses of the relocated > symbols and the offset applied is essential information. If the kernel > is compiled with debugging information, then print this information > during bootup using the same function as the panic notifer. Notifier. > Signed-off-by: Matt Redfearn > --- > > Changes in v2: None > > arch/mips/kernel/setup.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c > index d8376d7b3345..ae71f8d9b555 100644 > --- a/arch/mips/kernel/setup.c > +++ b/arch/mips/kernel/setup.c > @@ -477,9 +477,18 @@ static void __init bootmem_init(void) > */ > if (__pa_symbol(_text) > __pa_symbol(VMLINUX_LOAD_ADDRESS)) { > unsigned long offset; > + extern void show_kernel_relocation(const char *level); > > offset = __pa_symbol(_text) - __pa_symbol(VMLINUX_LOAD_ADDRESS); > free_bootmem(__pa_symbol(VMLINUX_LOAD_ADDRESS), offset); > + > +#if (defined CONFIG_DEBUG_KERNEL) && (defined CONFIG_DEBUG_INFO) Not #if defined(CONFIG_DEBUG_KERNEL) && defined(CONFIG_DEBUG_INFO)? [...] MBR, Sergei