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:	Tue, 16 Dec 2014 12:41:09 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	Chris Rorvick <chris@...vick.com>
Cc:	Oleg Drokin <oleg.drokin@...el.com>,
	Andreas Dilger <andreas.dilger@...el.com>,
	devel@...verdev.osuosl.org, HPDD-discuss@...1.01.org,
	Greg Donald <gdonald@...il.com>,
	James Simmons <uja.ornl@...il.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>,
	linux-kernel@...r.kernel.org, Fabian Frederick <fabf@...net.be>,
	Julia Lawall <Julia.Lawall@...6.fr>,
	Andriy Skulysh <Andriy_Skulysh@...atex.com>,
	"John L. Hammond" <john.hammond@...el.com>
Subject: Re: [PATCH] drivers: staging: lustre: Use mult if units not specified

On Mon, Dec 15, 2014 at 11:41:49PM -0600, Chris Rorvick wrote:
> Units can be passed to lprocfs_write_frac_u64_helper() via a suffix
> (e.g., "...K", "...M", etc.) tacked onto the value.  A comment states
> that "specified units override the multiplier," though the multiplier is
> overridden regardless.  Update the conditional logic so that it only
> applies when units are specified.
> 

That introduces a bug.  We need to take the initial '-' into
consideration.  Just remove the condition.  Also remove the "mult"
parameter since that is always 1.

	bool negative = false;

	...

	if (*pbuf == '-') {
		negative = true;
		pbuf++;
	}

	...

	mult = negative ? -units : units;


regards,
dan carpenter

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

Powered by blists - more mailing lists