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]
Message-Id: <D1043A13-EDCD-48C7-BA2B-CE4FCFC73338@linaro.org>
Date:	Fri, 23 Oct 2015 20:34:50 +0800
From:	Pingbo Wen <pingbo.wen@...aro.org>
To:	Arnd Bergmann <arnd@...db.de>
Cc:	y2038@...ts.linaro.org, dmitry.torokhov@...il.com,
	linux-kernel@...r.kernel.org, linux-input@...r.kernel.org
Subject: Re: [Y2038] [PATCH] hil_mlc: convert timeval to timespec64


> 在 2015年10月23日,17:45,Arnd Bergmann <arnd@...db.de> 写道:
> 
> On Friday 23 October 2015 17:12:38 Pingbo Wen wrote:
>> On Monday, October 19, 2015 04:58 PM, Arnd Bergmann wrote:
>>>> -            do_gettimeofday(&tv);
>>>> -        
> Handling the jiffies overflow is trivially done through the time_before()
> and time_after() helpers, like
> 
> 
> 	start = jiffies;
> 	...
> 	now = jiffies;
> 	timeout = start + HZ * timeout_usec / USEC_PER_SEC;
> 	if (time_after(now, start + timeout_jiffies)
> 		timeout();
> 	else
> 		mod_timer(timer, start + timeout_jiffies);
> 
> The time_after function works because unsigned overflow is well-defined
> in C (unlike signed overflow).
> 

Make sense, I will try this in next version.

Thanks,
Pingbo

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