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: <20180602220136.GA14810@bombadil.infradead.org>
Date:   Sat, 2 Jun 2018 15:01:36 -0700
From:   Matthew Wilcox <willy@...radead.org>
To:     Souptick Joarder <jrdr.linux@...il.com>
Cc:     viro@...iv.linux.org.uk, hughd@...gle.com,
        akpm@...ux-foundation.org, mhocko@...e.com,
        ross.zwisler@...ux.intel.com, zi.yan@...rutgers.edu,
        kirill.shutemov@...ux.intel.com, dan.j.williams@...el.com,
        gregkh@...uxfoundation.org, mark.rutland@....com, riel@...hat.com,
        pasha.tatashin@...cle.com, jschoenh@...zon.de,
        kstewart@...uxfoundation.org, rientjes@...gle.com,
        tglx@...utronix.de, peterz@...radead.org, mgorman@...e.de,
        yang.s@...baba-inc.com, minchan@...nel.org,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-mm@...ck.org
Subject: Re: [PATCH v2] mm: Change return type int to vm_fault_t for fault
 handlers

On Sun, Jun 03, 2018 at 01:34:07AM +0530, Souptick Joarder wrote:
> @@ -3570,9 +3571,8 @@ static int hugetlb_cow(struct mm_struct *mm, struct vm_area_struct *vma,
>  			return 0;
>  		}
>  
> -		ret = (PTR_ERR(new_page) == -ENOMEM) ?
> -			VM_FAULT_OOM : VM_FAULT_SIGBUS;
> -		goto out_release_old;
> +		ret = vmf_error(PTR_ERR(new_page));
> +			goto out_release_old;
>  	}
>  
>  	/*

Something weird happened to the goto here?

> +static vm_fault_t hugetlb_no_page(struct mm_struct *mm,
> +			struct vm_area_struct *vma,
> +			struct address_space *mapping, pgoff_t idx,
> +			unsigned long address, pte_t *ptep, unsigned int flags)
>  {
>  	struct hstate *h = hstate_vma(vma);
> -	int ret = VM_FAULT_SIGBUS;
> -	int anon_rmap = 0;
> +	vm_fault_t ret = VM_FAULT_SIGBUS;
> +	int anon_rmap = 0, err;
>  	unsigned long size;
>  	struct page *page;
>  	pte_t new_pte;
> @@ -3742,11 +3743,8 @@ static int hugetlb_no_page(struct mm_struct *mm, struct vm_area_struct *vma,
>  
>  		page = alloc_huge_page(vma, address, 0);
>  		if (IS_ERR(page)) {
> -			ret = PTR_ERR(page);
> -			if (ret == -ENOMEM)
> -				ret = VM_FAULT_OOM;
> -			else
> -				ret = VM_FAULT_SIGBUS;
> +			err = PTR_ERR(page);
> +			ret = vmf_error(err);
>  			goto out;
>  		}
>  		clear_huge_page(page, address, pages_per_huge_page(h));

Not sure why you bother with the 'int err' in this function when just
above you were happy to do

			ret = vmf_error(PTR_ERR(page));

With those fixed,

Reviewed-by: Matthew Wilcox <mawilcox@...rosoft.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ