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:	Thu, 11 Nov 2010 13:34:05 -0800 (PST)
From:	David Rientjes <rientjes@...gle.com>
To:	Vasiliy Kulikov <segooon@...il.com>
cc:	Andrew Morton <akpm@...ux-foundation.org>,
	kernel-janitors@...r.kernel.org,
	André Goddard Rosa <andre.goddard@...il.com>,
	Joe Perches <joe@...ches.com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	Bjorn Helgaas <bjorn.helgaas@...com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] lib: vsprintf: fix invalid arg check

On Fri, 12 Nov 2010, Vasiliy Kulikov wrote:

> OK, if the main reason here is return value type, then the correct
> handling should be:
> 
> 	/* Reject out-of-range values early.  Large positive sizes are
> 	   used for unknown buffer sizes. */
> -	if (WARN_ON_ONCE((int) size < 0))
> +	if (WARN_ON_ONCE(size > INT_MAX)
> 		return 0;
> 
> This should catch all underflows and too big integers.
> 

That is equivalent since size_t is always unsigned; if you'd like to 
change it, it should be presented only as a style change.  More important 
would be writing a less cryptic comment :)
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ