public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Alexander Popov <alpopov@ptsecurity.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Andrey Ryabinin <a.ryabinin@samsung.com>,
	Andrey Konovalov <adech.fo@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Kees Cook <keescook@chromium.org>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Andy Lutomirski <luto@amacapital.net>,
	Alexander Kuleshov <kuleshovmail@gmail.com>,
	Borislav Petkov <bp@suse.de>,
	Denys Vlasenko <dvlasenk@redhat.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 1/1] x86_64: fix KASan shadow region page tables
Date: Wed, 3 Jun 2015 09:44:28 +0200	[thread overview]
Message-ID: <20150603074427.GA1598@gmail.com> (raw)
In-Reply-To: <1433249837-7096-1-git-send-email-alpopov@ptsecurity.com>


* Alexander Popov <alpopov@ptsecurity.com> wrote:

>  #ifdef CONFIG_KASAN
>  void __init kasan_map_early_shadow(pgd_t *pgd);
> +void __init kasan_early_init(void);
>  void __init kasan_init(void);
>  #else
>  static inline void kasan_map_early_shadow(pgd_t *pgd) { }
> +static inline void kasan_early_init(void) { }
>  static inline void kasan_init(void) { }
>  #endif
>  
> diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
> index 2b55ee6..e9a84a1 100644
> --- a/arch/x86/kernel/head64.c
> +++ b/arch/x86/kernel/head64.c
> @@ -161,11 +161,15 @@ asmlinkage __visible void __init x86_64_start_kernel(char * real_mode_data)
>  	/* Kill off the identity-map trampoline */
>  	reset_early_page_tables();
>  
> -	kasan_map_early_shadow(early_level4_pgt);
> -
> -	/* clear bss before set_intr_gate with early_idt_handler */
> +	/*
> +	 * Clear bss before kasan_early_init and set_intr_gate
> +	 * with early_idt_handler
> +	 */
>  	clear_bss();
>  
> +	kasan_early_init();
> +	kasan_map_early_shadow(early_level4_pgt);

So why isn't kasan_map_early_shadow() called in kasan_early_init()?

High level x86 init code should not be polluted with too many low level details.

Thanks,

	Ingo

  reply	other threads:[~2015-06-03  7:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-02 12:57 [PATCH v4 1/1] x86_64: fix KASan shadow region page tables Alexander Popov
2015-06-03  7:44 ` Ingo Molnar [this message]
2015-06-03  8:37   ` Alexander Popov
2015-06-03  8:44   ` Andrey Ryabinin
2015-06-03 14:10     ` Alexander Popov
2015-06-03 16:33       ` Andrey Ryabinin

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=20150603074427.GA1598@gmail.com \
    --to=mingo@kernel.org \
    --cc=a.ryabinin@samsung.com \
    --cc=adech.fo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alpopov@ptsecurity.com \
    --cc=bp@suse.de \
    --cc=dvlasenk@redhat.com \
    --cc=hpa@zytor.com \
    --cc=keescook@chromium.org \
    --cc=kuleshovmail@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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