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, 13 Oct 2009 08:58:19 +1100
From:	Kevin Dawson <kevind@....com.au>
To:	Roel Kluin <roel.kluin@...il.com>
CC:	wharms@....de, linux-hams@...r.kernel.org,
	netdev <netdev@...r.kernel.org>, Joerg Reuter <jreuter@...na.de>,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] ax25: unsigned cannot be less than 0 in ax25_ctl_ioctl()

Roel Kluin wrote:

>>  tmp_arg=ax25_ctl.arg * HZ;
>>
>>   if (arg == 0 || arg >  ULONG_MAX )
>> 		goto einval_put;
>
> I'm not sure, I think this would only work if we made `arg' an
> unsigned long long.

That depends on the possible values of ax25_ctl.arg.

> +	if (ax25_ctl.arg * HZ > ULONG_MAX && ax25_ctl.cmd != AX25_KILL)
> +		return -EINVAL;

Why the need to change arg before comparing it with a constant?  Let the 
compiler do the work:

	if (ax25_ctl.arg > ULONG_MAX / HZ && ...

Kevin
--
To unsubscribe from this list: send the line "unsubscribe netdev" 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