aboutsummaryrefslogtreecommitdiffstats
path: root/net/netlink
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2014-08-05 01:50:07 -0400
committerDavid S. Miller <davem@davemloft.net>2014-08-05 01:58:06 -0400
commit67a24ac18b0262178ba9f05501b2c6e6731d449a (patch)
tree64686aacce6c4383de38ff937fdfdd95cc7be8bc /net/netlink
parent64a124edcc94011ce459f0b9bdf51e1783146712 (diff)
netlink: fix lockdep splats
With netlink_lookup() conversion to RCU, we need to use appropriate rcu dereference in netlink_seq_socket_idx() & netlink_seq_next() Reported-by: Sasha Levin <sasha.levin@oracle.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Fixes: e341694e3eb57fc ("netlink: Convert netlink_lookup() to use RCU protected hash table") Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netlink')
-rw-r--r--net/netlink/af_netlink.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index 0b89ca51a3af..479a344563d8 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -2899,7 +2899,7 @@ static struct sock *netlink_seq_socket_idx(struct seq_file *seq, loff_t pos)
2899 2899
2900 for (i = 0; i < MAX_LINKS; i++) { 2900 for (i = 0; i < MAX_LINKS; i++) {
2901 struct rhashtable *ht = &nl_table[i].hash; 2901 struct rhashtable *ht = &nl_table[i].hash;
2902 const struct bucket_table *tbl = rht_dereference(ht->tbl, ht); 2902 const struct bucket_table *tbl = rht_dereference_rcu(ht->tbl, ht);
2903 2903
2904 for (j = 0; j < tbl->size; j++) { 2904 for (j = 0; j < tbl->size; j++) {
2905 rht_for_each_entry_rcu(nlk, tbl->buckets[j], node) { 2905 rht_for_each_entry_rcu(nlk, tbl->buckets[j], node) {
@@ -2950,7 +2950,7 @@ static void *netlink_seq_next(struct seq_file *seq, void *v, loff_t *pos)
2950 2950
2951 do { 2951 do {
2952 struct rhashtable *ht = &nl_table[i].hash; 2952 struct rhashtable *ht = &nl_table[i].hash;
2953 const struct bucket_table *tbl = rht_dereference(ht->tbl, ht); 2953 const struct bucket_table *tbl = rht_dereference_rcu(ht->tbl, ht);
2954 2954
2955 for (; j < tbl->size; j++) { 2955 for (; j < tbl->size; j++) {
2956 rht_for_each_entry_rcu(nlk, tbl->buckets[j], node) { 2956 rht_for_each_entry_rcu(nlk, tbl->buckets[j], node) {