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]
Message-ID: <47E1F2DB.20204@cn.fujitsu.com>
Date:	Thu, 20 Mar 2008 13:15:07 +0800
From:	Wang Chen <wangchen@...fujitsu.com>
To:	"David S. Miller" <davem@...emloft.net>
CC:	NETDEV <netdev@...r.kernel.org>
Subject: [PATCH] FIB_TRIE: RCU refine

David, sorry to send this patch again.
I sent it yesterday, but seems that it was refused by
netdev maillist. I subscribed the mailist and send it
again.

On reader side, RCU list-traversal functions, such as
*list_for_each_entry_rcu(), should be within an RCU
read-side critical section.

Surround them by rcu_read_*lock().

Signed-off-by: Wang Chen <wangchen@...fujitsu.com>
---
 net/ipv4/fib_trie.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index 1ff446d..092e02b 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -2416,6 +2416,7 @@ static int fib_trie_seq_show(struct seq_file *seq, void *v)
 		seq_indent(seq, iter->depth);
 		seq_printf(seq, "  |-- %d.%d.%d.%d\n", NIPQUAD(val));
 
+		rcu_read_lock();
 		hlist_for_each_entry_rcu(li, node, &l->list, hlist) {
 			struct fib_alias *fa;
 
@@ -2433,6 +2434,7 @@ static int fib_trie_seq_show(struct seq_file *seq, void *v)
 				seq_putc(seq, '\n');
 			}
 		}
+		rcu_read_unlock();
 	}
 
 	return 0;
-- 
WCN

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