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:   Tue, 31 Jul 2018 13:27:01 -0700
From:   Stephen Hemminger <stephen@...workplumber.org>
To:     "Jason A. Donenfeld" <Jason@...c4.com>
Cc:     linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
        davem@...emloft.net, Greg KH <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v1 3/3] net: WireGuard secure network tunnel

On Tue, 31 Jul 2018 21:11:02 +0200
"Jason A. Donenfeld" <Jason@...c4.com> wrote:

> +#define push(stack, p, len) ({ \
> +	if (rcu_access_pointer(p)) { \
> +		BUG_ON(len >= 128); \
> +		stack[len++] = rcu_dereference_protected(p, lockdep_is_held(lock)); \
> +	} \
> +	true; \
> +})
> +static void free_root_node(struct allowedips_node __rcu *top, struct mutex *lock)
> +{
> +	struct allowedips_node *stack[128], *node;
> +	unsigned int len;
> +
> +	for (len = 0, push(stack, top, len); len > 0 && (node = stack[--len]) && push(stack, node->bit[0], len) && push(stack, node->bit[1], len);)
> +		call_rcu_bh(&node->rcu, node_free_rcu);
> +}

This looks like you are doing traversal to free a tree.  The stack is there so that you do the rcu callbacks
in the proper order. Won't this create an lot of RCU work at once?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ