linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Ryabinin <aryabinin@virtuozzo.com>
To: Qian Cai <cai@lca.pw>, akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] page_poison: plays nicely with KASAN
Date: Fri, 11 Jan 2019 21:45:25 +0300	[thread overview]
Message-ID: <2e46c139-70d3-dc86-28c9-a9f263651b57@virtuozzo.com> (raw)
In-Reply-To: <20190107223636.80593-1-cai@lca.pw>



On 1/8/19 1:36 AM, Qian Cai wrote:

>  
> diff --git a/mm/page_poison.c b/mm/page_poison.c
> index f0c15e9017c0..e546b70e592a 100644
> --- a/mm/page_poison.c
> +++ b/mm/page_poison.c
> @@ -6,6 +6,7 @@
>  #include <linux/page_ext.h>
>  #include <linux/poison.h>
>  #include <linux/ratelimit.h>
> +#include <linux/kasan.h>
>  
>  static bool want_page_poisoning __read_mostly;
>  
> @@ -40,6 +41,7 @@ static void poison_page(struct page *page)
>  {
>  	void *addr = kmap_atomic(page);
>  
> +	kasan_unpoison_shadow(addr, PAGE_SIZE);
>  	memset(addr, PAGE_POISON, PAGE_SIZE);

kasan_disable/enable_current() should be slightly more efficient for this case.

>  	kunmap_atomic(addr);
>  }
> 

  reply	other threads:[~2019-01-11 18:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-07 22:36 [PATCH] page_poison: plays nicely with KASAN Qian Cai
2019-01-11 18:45 ` Andrey Ryabinin [this message]
2019-01-14 23:34   ` [PATCH v2] page_poison: play " Qian Cai
2019-01-15 17:25     ` 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=2e46c139-70d3-dc86-28c9-a9f263651b57@virtuozzo.com \
    --to=aryabinin@virtuozzo.com \
    --cc=akpm@linux-foundation.org \
    --cc=cai@lca.pw \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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;
as well as URLs for NNTP newsgroup(s).