Subject: Re: [PATCH] ax25: unsigned cannot be less than 0 in ax25_ctl_ioctl()

From: Kevin Dawson <[email-masked]>
Date: Wed, 14 Oct 2009 08:50:15 +1100

walter harms wrote:
> 
> Kevin Dawson schrieb:
>> 
>>     if (ax25_ctl.arg > ULONG_MAX / HZ && ...
> 
> i like this because it prevents a wrap around for stupid ax25_ctl.arg values but will not help when
> ax25_ctl.arg * HZ is used later. NTL i think HZ does not need to be constant these days but i am not an
> expert on that area.

I don't have a kernel source tree at the moment, so I haven't seen where 
it's used, but the same size-limiting principle using divisions would 
apply whether you have constants, variables or function calls.

If ax25_ctl.arg * HZ is used later, one should arrange that the thread 
won't get that far if it has already been deemed an excessive value.

Kevin