Re: [PATCH v2 1/6] mm/balloon_compaction: ignore anonymous pages

2014-09-02 Thread Rafael Aquini
On Sat, Aug 30, 2014 at 08:41:09PM +0400, Konstantin Khlebnikov wrote:
> From: Konstantin Khlebnikov 
> 
> Sasha Levin reported KASAN splash inside isolate_migratepages_range().
> Problem is in function __is_movable_balloon_page() which tests AS_BALLOON_MAP
> in page->mapping->flags. This function has no protection against anonymous
> pages. As result it tried to check address space flags in inside anon-vma.
> 
> Signed-off-by: Konstantin Khlebnikov 
> Reported-by: Sasha Levin 
> Link: http://lkml.kernel.org/p/53e6ceaa.9020...@oracle.com
> Cc: stable  # v3.8
> ---
>  include/linux/balloon_compaction.h |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/linux/balloon_compaction.h 
> b/include/linux/balloon_compaction.h
> index 089743a..53d482e 100644
> --- a/include/linux/balloon_compaction.h
> +++ b/include/linux/balloon_compaction.h
> @@ -128,7 +128,7 @@ static inline bool page_flags_cleared(struct page *page)
>  static inline bool __is_movable_balloon_page(struct page *page)
>  {
>   struct address_space *mapping = page->mapping;
> - return mapping_balloon(mapping);
> + return !PageAnon(page) && mapping_balloon(mapping);
>  }
>  
>  /*
> 
Acked-by: Rafael Aquini 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 1/6] mm/balloon_compaction: ignore anonymous pages

2014-09-02 Thread Rafael Aquini
On Sat, Aug 30, 2014 at 08:41:09PM +0400, Konstantin Khlebnikov wrote:
 From: Konstantin Khlebnikov k.khlebni...@samsung.com
 
 Sasha Levin reported KASAN splash inside isolate_migratepages_range().
 Problem is in function __is_movable_balloon_page() which tests AS_BALLOON_MAP
 in page-mapping-flags. This function has no protection against anonymous
 pages. As result it tried to check address space flags in inside anon-vma.
 
 Signed-off-by: Konstantin Khlebnikov k.khlebni...@samsung.com
 Reported-by: Sasha Levin sasha.le...@oracle.com
 Link: http://lkml.kernel.org/p/53e6ceaa.9020...@oracle.com
 Cc: stable sta...@vger.kernel.org # v3.8
 ---
  include/linux/balloon_compaction.h |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/include/linux/balloon_compaction.h 
 b/include/linux/balloon_compaction.h
 index 089743a..53d482e 100644
 --- a/include/linux/balloon_compaction.h
 +++ b/include/linux/balloon_compaction.h
 @@ -128,7 +128,7 @@ static inline bool page_flags_cleared(struct page *page)
  static inline bool __is_movable_balloon_page(struct page *page)
  {
   struct address_space *mapping = page-mapping;
 - return mapping_balloon(mapping);
 + return !PageAnon(page)  mapping_balloon(mapping);
  }
  
  /*
 
Acked-by: Rafael Aquini aqu...@redhat.com

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 1/6] mm/balloon_compaction: ignore anonymous pages

2014-08-30 Thread Konstantin Khlebnikov
From: Konstantin Khlebnikov 

Sasha Levin reported KASAN splash inside isolate_migratepages_range().
Problem is in function __is_movable_balloon_page() which tests AS_BALLOON_MAP
in page->mapping->flags. This function has no protection against anonymous
pages. As result it tried to check address space flags in inside anon-vma.

Signed-off-by: Konstantin Khlebnikov 
Reported-by: Sasha Levin 
Link: http://lkml.kernel.org/p/53e6ceaa.9020...@oracle.com
Cc: stable  # v3.8
---
 include/linux/balloon_compaction.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/balloon_compaction.h 
b/include/linux/balloon_compaction.h
index 089743a..53d482e 100644
--- a/include/linux/balloon_compaction.h
+++ b/include/linux/balloon_compaction.h
@@ -128,7 +128,7 @@ static inline bool page_flags_cleared(struct page *page)
 static inline bool __is_movable_balloon_page(struct page *page)
 {
struct address_space *mapping = page->mapping;
-   return mapping_balloon(mapping);
+   return !PageAnon(page) && mapping_balloon(mapping);
 }
 
 /*

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 1/6] mm/balloon_compaction: ignore anonymous pages

2014-08-30 Thread Konstantin Khlebnikov
From: Konstantin Khlebnikov k.khlebni...@samsung.com

Sasha Levin reported KASAN splash inside isolate_migratepages_range().
Problem is in function __is_movable_balloon_page() which tests AS_BALLOON_MAP
in page-mapping-flags. This function has no protection against anonymous
pages. As result it tried to check address space flags in inside anon-vma.

Signed-off-by: Konstantin Khlebnikov k.khlebni...@samsung.com
Reported-by: Sasha Levin sasha.le...@oracle.com
Link: http://lkml.kernel.org/p/53e6ceaa.9020...@oracle.com
Cc: stable sta...@vger.kernel.org # v3.8
---
 include/linux/balloon_compaction.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/balloon_compaction.h 
b/include/linux/balloon_compaction.h
index 089743a..53d482e 100644
--- a/include/linux/balloon_compaction.h
+++ b/include/linux/balloon_compaction.h
@@ -128,7 +128,7 @@ static inline bool page_flags_cleared(struct page *page)
 static inline bool __is_movable_balloon_page(struct page *page)
 {
struct address_space *mapping = page-mapping;
-   return mapping_balloon(mapping);
+   return !PageAnon(page)  mapping_balloon(mapping);
 }
 
 /*

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/