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] [day] [month] [year] [list]
Date:	Fri, 23 May 2014 07:06:10 +0800 (SGT)
From:	Julia Lawall <julia.lawall@...6.fr>
To:	Manuel Schölling <manuel.schoelling@....de>
cc:	davem@...emloft.net, jg1.han@...sung.com, dingtianhong@...wei.com,
	ebiederm@...ssion.com, Julia.Lawall@...6.fr,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] micrel: Use time_before_eq()

On Thu, 22 May 2014, Manuel Schölling wrote:

> To be future-proof and for better readability the time comparisons are modified
> to use time_before_eq() instead of plain, error-prone math.

I had the impression that the real reason for these functions was that
they were somehow sensitive to the possibility of overflow of jiffies?

julia

> Signed-off-by: Manuel Schölling <manuel.schoelling@....de>
> ---
>  drivers/net/ethernet/micrel/ksz884x.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c
> index 14ac0e2..90fa5f3 100644
> --- a/drivers/net/ethernet/micrel/ksz884x.c
> +++ b/drivers/net/ethernet/micrel/ksz884x.c
> @@ -4930,7 +4930,7 @@ static void netdev_tx_timeout(struct net_device *dev)
>  		 * Only reset the hardware if time between calls is long
>  		 * enough.
>  		 */
> -		if (jiffies - last_reset <= dev->watchdog_timeo)
> +		if (time_before_eq(jiffies, last_reset + dev->watchdog_timeo))
>  			hw_priv = NULL;
>  	}
>
> --
> 1.7.10.4
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ