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-next>] [day] [month] [year] [list]
Date:   Wed, 12 Dec 2018 17:58:12 +0800
From:   Xiaozhou Liu <liuxiaozhou@...edance.com>
To:     netdev@...r.kernel.org
Cc:     "David S . Miller" <davem@...emloft.net>,
        Xiaozhou Liu <liuxiaozhou@...edance.com>
Subject: [PATCH net] soreuseport: use RCU_INIT_POINTER() when NULLing

Use RCU_INIT_POINTER() instead of rcu_assign_pointer() to
NULL out the pointer because it is a bit faster.

Signed-off-by: Xiaozhou Liu <liuxiaozhou@...edance.com>
---
 net/core/sock_reuseport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/sock_reuseport.c b/net/core/sock_reuseport.c
index d8fe3e549373..25e71355f0a6 100644
--- a/net/core/sock_reuseport.c
+++ b/net/core/sock_reuseport.c
@@ -205,7 +205,7 @@ void reuseport_detach_sock(struct sock *sk)
 	if (reuse->reuseport_id)
 		bpf_sk_reuseport_detach(sk);
 
-	rcu_assign_pointer(sk->sk_reuseport_cb, NULL);
+	RCU_INIT_POINTER(sk->sk_reuseport_cb, NULL);
 
 	for (i = 0; i < reuse->num_socks; i++) {
 		if (reuse->socks[i] == sk) {
-- 
2.11.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ