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] [day] [month] [year] [list]
Message-ID: <20151013221530.GA17773@linux.intel.com>
Date:	Tue, 13 Oct 2015 16:15:30 -0600
From:	Ross Zwisler <ross.zwisler@...ux.intel.com>
To:	Eric Curtin <ericcurtin17@...il.com>
Cc:	Dave Chinner <david@...morbit.com>,
	Ross Zwisler <ross.zwisler@...ux.intel.com>,
	Kernel development list <linux-kernel@...r.kernel.org>,
	Jan Kara <jack@...e.com>, linux-ext4@...r.kernel.org,
	Dan Williams <dan.j.williams@...el.com>,
	linux-nvdimm@...ts.01.org,
	Matthew Wilcox <matthew.r.wilcox@...el.com>,
	Andreas Dilger <andreas.dilger@...el.com>
Subject: Re: [PATCH 2/2] ext2: Add locking for DAX faults

On Tue, Oct 13, 2015 at 12:35:44AM +0100, Eric Curtin wrote:
> Hi Ross,
> 
> For all those int ret declarations. Why not declare and initialize all
> on the same line?
> 
> Regards,
> Eric

Because the return value 'ret' is set unconditionally later in the function as
part of a call into the DAX code.  This call needs to be made after we've done
appropriate locking, though, which really is the point of the ext2 wrapper for
the DAX function.  Setting it to some random value and then unconditionally
overwriting it later in the function is a bad pattern because a) the initial
value is meaningless and b) it can hide coding errors where you are no longer
setting the variable to something meaningful.  The "warning: ‘ret’ is used
uninitialized in this function" warnings would otherwise warn you that you've
made a mistake.
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ