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>] [day] [month] [year] [list]
Message-ID: <20120420065150.GG22975@sweethome.fritz.box>
Date:	Fri, 20 Apr 2012 08:51:50 +0200
From:	Andreas Herz <andi@...kosphere.org>
To:	linux-kernel@...r.kernel.org
Cc:	tglx@...utronix.de
Subject: msecs_to_jiffies() still returns values greater then MAX_JIFFY_OFFSET

Hi,

i'm new to the LKML and so i couldn't reply to the old mail from Mar
2011.

On 29 Mar 2011 there was already a disucssion about this issue:

http://lkml.org/lkml/2011/3/29/262

The problem still exists, as /kernel/time.c wasn't patched. I stumbled
upon this "bug" when i modified the ipset sourcecode that uses
msecs_to_jiffies() for timeout calculations.

When i call msecs_to_jiffies(2147483000) the return value is 2147483000
on my x86 32-Bit System with 1000Hz. When i call the function with
msecs_to_jiffies(2147484000) the return value is MAX_JIFFY_OFFSET what's
1073741822 on my system. That isn't the behaviour i expect from this
comment in time.c:

 * - 'too large' values [that would result in larger than
 *   MAX_JIFFY_OFFSET values] mean 'infinite timeout' too.

So you can pass values greater then MAX_JIFFY_OFFSET up to INT_MAX in
this example although the limit should be at INT_MAX/2 for
MAX_JIFFY_OFFSET. 

I'm not sure if the solution is to increase MAX_JIFFY_OFFSET or to catch
values between this gap. I also don't understand why the function
returns a unsigned long but is limited to integer. It could be nice to
increase the values that can be handled with this function.

Greetings

-- 
Andreas Herz
--
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