Re: [PATCH] page_poison: plays nicely with KASAN

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux