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: <20100324195725.GC29364@hmsreliant.think-freely.org>
Date:	Wed, 24 Mar 2010 16:21:54 -0400
From:	Neil Horman <nhorman@...driver.com>
To:	Pavel Emelyanov <xemul@...nvz.org>
Cc:	David Miller <davem@...emloft.net>,
	Eric Dumazet <dada1@...mosbay.com>,
	Linux Netdev List <netdev@...r.kernel.org>
Subject: Re: [PATCH 2/2] ipv4: Restart rt_intern_hash after emergency rebuild

On Wed, Mar 24, 2010 at 08:43:27PM +0300, Pavel Emelyanov wrote:
> The the rebuild changes the genid which in turn is used at the
> hash calculation. Thus if we don't restart and go on with the
> inserting the rt will happen in wrong chain.
> 
> This doesn't seem critical to me, since the proper rt entry will 
> be hashed at next skb.
> 
> Signed-off-by: Pavel Emelyanov <xemul@...nvz.org>
> ---
>  net/ipv4/route.c |   18 ++++++++++++------
>  1 files changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> index 28c1c2f..bbce53e 100644
> --- a/net/ipv4/route.c
> +++ b/net/ipv4/route.c
> @@ -1097,7 +1097,7 @@ static int slow_chain_length(const struct rtable *head)
>  }
>  
>  static int rt_intern_hash(unsigned hash, struct rtable *rt,
> -			  struct rtable **rp, struct sk_buff *skb)
> +			  struct rtable **rp, struct sk_buff *skb, int in)
>  {
>  	struct rtable	*rth, **rthp;
>  	unsigned long	now;
> @@ -1217,6 +1217,12 @@ restart:
>  					rt->u.dst.dev->name, num);
>  			}
>  			rt_emergency_hash_rebuild(net);
> +			spin_unlock_bh(rt_hash_lock_addr(hash));
> +
> +			hash = rt_hash(rt->fl.fl4_dst, rt->fl.fl4_src,
> +					in ? rt->fl.iif : rt->fl.oif,
> +					rt_genid(net));
> +			goto restart;
>  		}
>  	}
Why pass in a flag here?  Perhaps it would be easier just to pass in the ifindex
that was origionally used by the caller of rt_intern_hash so that the hash could
be redone without needing to toggle on the value of the flag.  

Regards
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