From: Herbert Xu Date: Sat, 25 Feb 2017 14:39:50 +0000 (+0800) Subject: rhashtable: Fix RCU dereference annotation in rht_bucket_nested X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c4d2603dac3a555e4bb324daf5cb5cdb5694eedd;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- 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, union nested_table *ntbl; ntbl = (union nested_table *)rcu_dereference_raw(tbl->buckets[0]); - ntbl = rht_dereference_bucket(ntbl[index].table, tbl, hash); + ntbl = rht_dereference_bucket_rcu(ntbl[index].table, tbl, hash); subhash >>= tbl->nest; while (ntbl && size > (1 << shift)) { index = subhash & ((1 << shift) - 1); - ntbl = rht_dereference_bucket(ntbl[index].table, tbl, hash); + ntbl = rht_dereference_bucket_rcu(ntbl[index].table, + tbl, hash); size >>= shift; subhash >>= shift; }