lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <0B408D50-D101-4457-B779-5951DEE0435A@oracle.com>
Date:   Thu, 29 Nov 2018 06:51:28 -0700
From:   William Kucharski <william.kucharski@...cle.com>
To:     Yongkai Wu <nic.wuyk@...il.com>
Cc:     mike.kravetz@...cle.com, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, nic_w@....com
Subject: Re: [PATCH] hugetlbfs: Call VM_BUG_ON_PAGE earlier in free_huge_page

Reviewed-by: William Kucharski <william.kucharski@...cle.com>

> On Nov 29, 2018, at 4:44 AM, Yongkai Wu <nic.wuyk@...il.com> wrote:
> 
> A stack trace was triggered by VM_BUG_ON_PAGE(page_mapcount(page),
> page) in free_huge_page().  Unfortunately, the page->mapping field
> was set to NULL before this test.  This made it more difficult to
> determine the root cause of the problem.
> 
> Move the VM_BUG_ON_PAGE tests earlier in the function so that if
> they do trigger more information is present in the page struct.
> 
> Signed-off-by: Yongkai Wu <nic_w@....com>
> Acked-by: Michal Hocko <mhocko@...e.com>
> Acked-by: Mike Kravetz <mike.kravetz@...cle.com>
> ---
> mm/hugetlb.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 7f2a28a..14ef274 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -1248,10 +1248,11 @@ void free_huge_page(struct page *page)
> 		(struct hugepage_subpool *)page_private(page);
> 	bool restore_reserve;
> 
> -	set_page_private(page, 0);
> -	page->mapping = NULL;
> 	VM_BUG_ON_PAGE(page_count(page), page);
> 	VM_BUG_ON_PAGE(page_mapcount(page), page);
> +
> +	set_page_private(page, 0);
> +	page->mapping = NULL;
> 	restore_reserve = PagePrivate(page);
> 	ClearPagePrivate(page);
> 
> -- 
> 1.8.3.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ