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: <1458773986.10868.54.camel@edumazet-glaptop3.roam.corp.google.com>
Date:	Wed, 23 Mar 2016 15:59:46 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Tom Herbert <tom@...bertland.com>
Cc:	davem@...emloft.net, netdev@...r.kernel.org, kernel-team@...com
Subject: Re: [PATCH RFC 2/9] udp: Add noreference lookup functions

On Wed, 2016-03-23 at 15:36 -0700, Tom Herbert wrote:
> This patches adds udp6_lib_lookup_skb_noref, udp4_lib_lookup_skb_noref
> and related support to allow a caller to lookup a UDP socket
> without automatically taking a reference. The lookup and caller
> use of the socket must be done under rcu_read_lock.
> 
> This feature will be used in a fast receive encapsulation path and
> also when performing GRO through callout in the UDP socket.
> 
> Signed-off-by: Tom Herbert <tom@...bertland.com>
> ---

As already mentioned in the past, you can not do a UDP lookup without
taking a reference, because we use SLAB_DESTROY_BY_RCU rules which are
strict.

Only taking a reference and re-doing the keys check can make sure the
lookup result makes sense (as we check multiple words and there is no
way it can be done atomically)

This is explained in include/linux/slab.h and
Documentation/RCU/rculist_nulls.txt

If you want that to happen, we need first to not use
SLAB_DESTROY_BY_RCU.

Then, we do not need to take a reference at all, even for the regular
UDP stack unicast receive path.



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ