lkml.org 
[lkml]   [2019]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] page_poison: plays nicely with KASAN
From
Date


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);
> }
>

\
 
 \ /
  Last update: 2019-01-11 19:45    [W:1.638 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site