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: <20170508.172618.676839687841750049.davem@davemloft.net>
Date:   Mon, 08 May 2017 17:26:18 -0400 (EDT)
From:   David Miller <davem@...emloft.net>
To:     karim.eshapa@...il.com
Cc:     inaky.perez-gonzalez@...el.com, linux-wimax@...el.com,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drivers: net: wimax: i2400m: i2400m-usb: Use
 time_after for time comparison

From: Karim Eshapa <karim.eshapa@...il.com>
Date: Mon,  8 May 2017 18:58:02 +0200

> diff --git a/drivers/net/wimax/i2400m/i2400m-usb.h b/drivers/net/wimax/i2400m/i2400m-usb.h
> index 649ecad..6fc941c 100644
> --- a/drivers/net/wimax/i2400m/i2400m-usb.h
> +++ b/drivers/net/wimax/i2400m/i2400m-usb.h
> @@ -131,7 +131,7 @@ static inline int edc_inc(struct edc *edc, u16 max_err, u16 timeframe)
>  	unsigned long now;
>  
>  	now = jiffies;
> -	if (now - edc->timestart > timeframe) {
> +	if (time_after(now - edc->timestart, (unsigned long)timeframe)) {

This is far from correct.

time_after() compares two "jiffies" timestamp values.  The second
argument here is not a jiffies timestamp value.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ