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]
Date:	Sat, 26 Apr 2014 16:40:06 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Tom Herbert <therbert@...gle.com>
Cc:	davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH 2/2] ipv6: Set flow label to skb_hash on transmit

On Sat, 2014-04-26 at 16:00 -0700, Tom Herbert wrote:
>  
> +static inline __be32 ip6_make_flowlabel(struct net *net, struct sk_buff *skb,
> +					__be32 flowlabel)
> +{
> +	__be32 hash;
> +
> +	if (flowlabel || !net->ipv6.sysctl.auto_flowlabels)
> +		return flowlabel;
> +
> +	hash = skb->sk && skb->sk->sk_hash ? skb->sk->sk_hash :
> +					     skb_get_hash_raw(skb);
> +
> +	return hash & IPV6_FLOWLABEL_MASK;
> +}

Hmm... 

We use jhash and a random perturb to generate sk_hash which serves as
our input to locate sockets in hash table.

If we leak sk_hash, an attacker can easily target one hash slot.

You could simply use :

hash = skb->sk ? hash_ptr(skb->sk, 20) : skb_get_hash_raw(skb);

But even with this, we could leak sensitive information...

So I would rather use a separate sk->sk_flowhash value, and put a
completely random value in it.



--
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