mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Yin, Fengwei" <fengwei.yin@intel.com>
To: Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"kernel test robot" <yujie.liu@intel.com>
Cc: Seth Jenkins <sethjenkins@google.com>,
	Kees Cook <keescook@chromium.org>, <linux-kernel@vger.kernel.org>,
	<x86@kernel.org>, Alexander Potapenko <glider@google.com>,
	Andrey Konovalov <andreyknvl@gmail.com>,
	Dmitry Vyukov <dvyukov@google.com>,
	Vincenzo Frascino <vincenzo.frascino@arm.com>,
	<kasan-dev@googlegroups.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"Ingo Molnar" <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Andy Lutomirski <luto@kernel.org>
Subject: Re: [PATCH] x86/kasan: map shadow for percpu pages on demand
Date: Mon, 31 Oct 2022 08:15:40 +0800	[thread overview]
Message-ID: <7afa3099-cc62-b439-24ea-4d04f03ab402@intel.com> (raw)
In-Reply-To: <c6fbc75a-4e8c-05f4-c1d9-53693a7c604f@gmail.com>



On 10/28/2022 10:20 PM, Andrey Ryabinin wrote:
> 
> 
> On 10/28/22 05:51, Yin, Fengwei wrote:
>> Hi Andrey,
>>
> 
>>>  void __init kasan_init(void)
>>>  {
>>>  	int i;
>>> @@ -393,9 +405,6 @@ void __init kasan_init(void)
>>>  		kasan_mem_to_shadow((void *)VMALLOC_END + 1),
>>>  		shadow_cpu_entry_begin);
>>>  
>>> -	kasan_populate_shadow((unsigned long)shadow_cpu_entry_begin,
>>> -			      (unsigned long)shadow_cpu_entry_end, 0);
>>> -
>> There will be address in the range (shadow_cpu_entry_begin, shadow_cpu_entry_end)
>> which has no KASAN shadow mapping populated after the patch. Not sure whether
>> it could be a problem. Thanks.
>>
> 
> 
> This shouldn't be a problem. It's vital to have shadow *only* for addresses with mapped memory.
> Shadow address accessed only if the address itself accessed. So the difference between not having shadow
> for address with no mapping vs having it, is whether we crash on access to KASAN shadow or crash few
> instructions later on access to the address itself.

Thanks for clarification.

Regards
Yin, Fengwei


  reply	other threads:[~2022-10-31  0:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-25  4:54 [tip:x86/mm] [x86/mm] 1248fb6a82: Kernel_panic-not_syncing:kasan_populate_pmd:Failed_to_allocate_page kernel test robot
2022-10-25 10:33 ` Peter Zijlstra
2022-10-25 14:14   ` Yin, Fengwei
2022-10-25 15:39   ` Andrey Ryabinin
2022-10-27 10:02     ` Yujie Liu
2022-10-27 10:13       ` Peter Zijlstra
2022-10-27 15:12     ` Dave Hansen
2022-10-27 21:31       ` [PATCH] x86/kasan: map shadow for percpu pages on demand Andrey Ryabinin
2022-10-28  2:51         ` Yin, Fengwei
2022-10-28 14:20           ` Andrey Ryabinin
2022-10-31  0:15             ` Yin, Fengwei [this message]
2022-10-27 21:35       ` [tip:x86/mm] [x86/mm] 1248fb6a82: Kernel_panic-not_syncing:kasan_populate_pmd:Failed_to_allocate_page Andrey Ryabinin
2022-10-28  6:43 ` [tip: x86/mm] x86/kasan: Map shadow for percpu pages on demand tip-bot2 for Andrey Ryabinin
2022-12-17 18:55 ` tip-bot2 for 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=7afa3099-cc62-b439-24ea-4d04f03ab402@intel.com \
    --to=fengwei.yin@intel.com \
    --cc=andreyknvl@gmail.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=hpa@zytor.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=ryabinin.a.a@gmail.com \
    --cc=sethjenkins@google.com \
    --cc=tglx@linutronix.de \
    --cc=vincenzo.frascino@arm.com \
    --cc=x86@kernel.org \
    --cc=yujie.liu@intel.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

all inboxes | Powered by JetHome®