diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2017-02-25 09:39:50 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-02-26 21:33:43 -0500 |
commit | c4d2603dac3a555e4bb324daf5cb5cdb5694eedd (patch) | |
tree | aa471c625bdf28475ad8d5b6c48520ef547dac7d | |
parent | ca435407ba6655a0d63230818ffe7006d967dfe5 (diff) |
rhashtable: Fix RCU dereference annotation in rht_bucket_nested
The current annotation is wrong as it says that we're only called
under spinlock. In fact it should be marked as under either
spinlock or RCU read lock.
Fixes: da20420f83ea ("rhashtable: Add nested tables")
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | lib/rhashtable.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/rhashtable.c b/lib/rhashtable.c index fac1a78afb39..c5b9b9351cec 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c | |||
@@ -1121,12 +1121,13 @@ struct rhash_head __rcu **rht_bucket_nested(const struct bucket_table *tbl, | |||
1121 | union nested_table *ntbl; | 1121 | union nested_table *ntbl; |
1122 | 1122 | ||
1123 | ntbl = (union nested_table *)rcu_dereference_raw(tbl->buckets[0]); | 1123 | ntbl = (union nested_table *)rcu_dereference_raw(tbl->buckets[0]); |
1124 | ntbl = rht_dereference_bucket(ntbl[index].table, tbl, hash); | 1124 | ntbl = rht_dereference_bucket_rcu(ntbl[index].table, tbl, hash); |
1125 | subhash >>= tbl->nest; | 1125 | subhash >>= tbl->nest; |
1126 | 1126 | ||
1127 | while (ntbl && size > (1 << shift)) { | 1127 | while (ntbl && size > (1 << shift)) { |
1128 | index = subhash & ((1 << shift) - 1); | 1128 | index = subhash & ((1 << shift) - 1); |
1129 | ntbl = rht_dereference_bucket(ntbl[index].table, tbl, hash); | 1129 | ntbl = rht_dereference_bucket_rcu(ntbl[index].table, |
1130 | tbl, hash); | ||
1130 | size >>= shift; | 1131 | size >>= shift; |
1131 | subhash >>= shift; | 1132 | subhash >>= shift; |
1132 | } | 1133 | } |