linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: Matt Redfearn <matt.redfearn@imgtec.com>,
	linux-mips@linux-mips.org, kernel-hardening@lists.openwall.com,
	Aaro Koskinen <aaro.koskinen@nokia.com>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Alexander Sverdlin <alexander.sverdlin@gmail.com>,
	linux-kernel@vger.kernel.org, Jaedon Shin <jaedon.shin@gmail.com>,
	Jonas Gorski <jogo@openwrt.org>,
	Paul Burton <paul.burton@imgtec.com>
Subject: Re: [PATCH v2 11/11] MIPS: KASLR: Print relocation Information on boot
Date: Fri, 1 Apr 2016 10:44:04 +0200	[thread overview]
Message-ID: <20160401084403.GA28123@linux-mips.org> (raw)
In-Reply-To: <56FD1A32.10204@cogentembedded.com>

On Thu, Mar 31, 2016 at 03:38:10PM +0300, Sergei Shtylyov 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.

Fixed when merging.

> >Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
> >---
> >
> >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)?
> 
> [...]

CPP syntax is not what most people seem to believe that is the parenthesis
around the argument of defined are not required so above line is unusual
but perfectly ok.  However following boring standards is good so I changed
this, too.

  Ralf

  reply	other threads:[~2016-04-01  8:44 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-31  9:05 [PATCH v2 00/11] MIPS relocatable kernel & KASLR Matt Redfearn
2016-03-31  9:05 ` [PATCH v2 01/11] MIPS: tools: Add relocs tool Matt Redfearn
2016-03-31  9:05 ` [PATCH v2 02/11] MIPS: tools: Build " Matt Redfearn
2016-03-31  9:05 ` [PATCH v2 03/11] MIPS: Reserve space for relocation table Matt Redfearn
2016-03-31  9:05 ` [PATCH v2 04/11] MIPS: Generate relocation table when CONFIG_RELOCATABLE Matt Redfearn
2016-03-31  9:05 ` [PATCH v2 05/11] MIPS: Kernel: Add relocate.c Matt Redfearn
2016-03-31  9:05 ` [PATCH v2 06/11] MIPS: Call relocate_kernel if CONFIG_RELOCATABLE=y Matt Redfearn
2016-03-31  9:05 ` [PATCH v2 07/11] MIPS: bootmem: When relocatable, free memory below kernel Matt Redfearn
2016-03-31  9:05 ` [PATCH v2 08/11] MIPS: Add CONFIG_RELOCATABLE Kconfig option Matt Redfearn
2016-03-31  9:05 ` [PATCH v2 09/11] MIPS: Introduce plat_get_fdt a platform API to retrieve the FDT Matt Redfearn
2016-03-31  9:05 ` [PATCH v2 10/11] MIPS: Kernel: Implement KASLR using CONFIG_RELOCATABLE Matt Redfearn
2016-03-31  9:05 ` [PATCH v2 11/11] MIPS: KASLR: Print relocation Information on boot Matt Redfearn
2016-03-31 12:38   ` Sergei Shtylyov
2016-04-01  8:44     ` Ralf Baechle [this message]
2016-04-01  9:07       ` Matt Redfearn
2016-04-04 19:46 ` [kernel-hardening] [PATCH v2 00/11] MIPS relocatable kernel & KASLR Kees Cook
2016-04-04 23:37   ` Ralf Baechle
2016-04-04 23:56     ` Kees Cook
2016-04-05  9:09       ` James Hogan
2016-04-05 18:10         ` Kees Cook
2016-04-05 21:00           ` James Hogan
2016-04-05 12:14     ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160401084403.GA28123@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=aaro.koskinen@nokia.com \
    --cc=alexander.sverdlin@gmail.com \
    --cc=jaedon.shin@gmail.com \
    --cc=jogo@openwrt.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=matt.redfearn@imgtec.com \
    --cc=paul.burton@imgtec.com \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).