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: <20191204115623.GA25176@duo.ucw.cz>
Date:   Wed, 4 Dec 2019 12:56:23 +0100
From:   Pavel Machek <pavel@...x.de>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-kernel@...r.kernel.org, stable@...r.kernel.org,
        Ahmed Zaki <anzaki@...il.com>,
        Johannes Berg <johannes.berg@...el.com>,
        Sasha Levin <sashal@...nel.org>
Subject: Re: [PATCH 4.19 044/321] mac80211: fix station inactive_time shortly
 after boot

On Tue 2019-12-03 23:31:50, Greg Kroah-Hartman wrote:
> From: Ahmed Zaki <anzaki@...il.com>
> 
> [ Upstream commit 285531f9e6774e3be71da6673d475ff1a088d675 ]
> 
> In the first 5 minutes after boot (time of INITIAL_JIFFIES),
> ieee80211_sta_last_active() returns zero if last_ack is zero. This
> leads to "inactive time" showing jiffies_to_msecs(jiffies).
> 
>  # iw wlan0 station get fc:ec:da:64:a6:dd
>  Station fc:ec:da:64:a6:dd (on wlan0)
> 	inactive time:	4294894049 ms
> 	.
> 	.
> 	connected time:	70 seconds
> 
> Fix by returning last_rx if last_ack == 0.

I guess it fixes the message, but is it right fix?

> diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
> index f34202242d24d..507409e3fd39c 100644
> --- a/net/mac80211/sta_info.c
> +++ b/net/mac80211/sta_info.c
> @@ -2356,7 +2356,8 @@ unsigned long ieee80211_sta_last_active(struct sta_info *sta)
>  {
>  	struct ieee80211_sta_rx_stats *stats = sta_get_last_rx_stats(sta);
>  
> -	if (time_after(stats->last_rx, sta->status_stats.last_ack))
> +	if (!sta->status_stats.last_ack ||
> +	    time_after(stats->last_rx, sta->status_stats.last_ack))
>  		return stats->last_rx;
>  	return sta->status_stats.last_ack;
>  }

I mean, jiffies do wrapraound periodically, so eventually we'll have
sta->status_stats.last_ack == 0 even through it is not short after
boot, no?

Best regards,
								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Download attachment "signature.asc" of type "application/pgp-signature" (196 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ