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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090902105535.GB402@hmsreliant.think-freely.org>
Date:	Wed, 2 Sep 2009 06:55:35 -0400
From:	Neil Horman <nhorman@...driver.com>
To:	David Miller <davem@...emloft.net>
Cc:	netdev@...r.kernel.org, eric.dumazet@...il.com
Subject: Re: [PATCH] drop_monitor: make last_rx timestamp private

On Tue, Sep 01, 2009 at 06:21:27PM -0700, David Miller wrote:
> From: Neil Horman <nhorman@...driver.com>
> Date: Mon, 31 Aug 2009 15:58:47 -0400
> 
> > It was recently pointed out to me that the last_rx field of the net_device
> > structure wasn't updated regularly.  In fact only the bonding driver really uses
> > it currently.  Since the drop_monitor code relies on the last_rx field to detect
> > drops on recevie in hardware, We need to find a more reliable way to rate limit
> > our drop checks (so that we don't check for drops on every frame recevied, which
> > would be inefficient.  This patch makes a last_rx timestamp that is private to
> > the drop monitor code and is updated for every device that we track.
> > 
> > Signed-off-by: Neil Horman <nhorman@...driver.com>
> 
> Neil, this doesn't apply to net-next-2.6:
> 
> > diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
> > index 9d66fa9..34a05ce 100644
> > --- a/net/core/drop_monitor.c
> > +++ b/net/core/drop_monitor.c
>  ...
> > @@ -179,18 +180,21 @@ static void trace_napi_poll_hit(struct napi_struct *napi)
> >  {
> >  	struct dm_hw_stat_delta *new_stat;
> >  
> > -	/*
> > -	 * Ratelimit our check time to dm_hw_check_delta jiffies
> > -	 */
> > -	if (!time_after(jiffies, napi->dev->last_rx + dm_hw_check_delta))
> > -		return;
> >  
> >  	rcu_read_lock();
> >  	list_for_each_entry_rcu(new_stat, &hw_stats_list, list) {
> 
> In net-next-2.6 this test reads:
> 
> 	/*
> 	 * Ratelimit our check time to dm_hw_check_delta jiffies
> 	 */
> 	if (!napi->dev ||
> 	    !time_after(jiffies, napi->dev->last_rx + dm_hw_check_delta))
> 		return;
> 
> and you must retain the napi->dev NULL check there as otherwise
> the list traversal tests will blindly dereference that pointer.
> 

Apologies, this raced with Xiao fix to trace_napi_poll hit, which introduced
that null check.  I'll rediff/repost shortly.

Neil

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ