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]
Date:	Wed, 2 Mar 2016 09:09:47 -0500
From:	Matthew Wilcox <willy@...ux.intel.com>
To:	Ross Zwisler <ross.zwisler@...ux.intel.com>
Cc:	linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	Dan Williams <dan.j.williams@...el.com>,
	linux-nvdimm@...ts.01.org
Subject: Re: [PATCH] dax: check return value of dax_radix_entry()

On Tue, Mar 01, 2016 at 03:15:08PM -0700, Ross Zwisler wrote:
> dax_pfn_mkwrite() previously wasn't checking the return value of the call
> to dax_radix_entry(), which was a mistake.
> 
> Instead, capture this return value and pass it up the stack if it is an
> error.

>  	 */
> -	dax_radix_entry(file->f_mapping, vmf->pgoff, NO_SECTOR, false, true);
> +	error = dax_radix_entry(file->f_mapping, vmf->pgoff, NO_SECTOR, false,
> +			true);
> +	if (error)
> +		return error;
> +
>  	return VM_FAULT_NOPAGE;

You can't return an errno from here.

	if (error)
		return VM_FAULT_SIGBUS;

is better.  For full points,

	if (error == -ENOMEM)
		return VM_FAULT_OOM;
	if (error)
		return VM_FAULT_SIGBUS;
	return VM_FAULT_NOPAGE;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ