[v2 PATCH 1/2] rhashtable: Fix unprotected RCU dereference in __rht_ptr

2020-07-24 Thread Herbert Xu
The rcu_dereference call in rht_ptr_rcu is completely bogus because we've already dereferenced the value in __rht_ptr and operated on it. This causes potential double readings which could be fatal. The RCU dereference must occur prior to the comparison in __rht_ptr. This patch changes the order

[PATCH 1/2] rhashtable: Fix unprotected RCU dereference in __rht_ptr

2020-07-23 Thread Herbert Xu
The rcu_dereference call in rht_ptr_rcu is completely bogus because we've already dereferenced the value in __rht_ptr and operated on it. This causes potential double readings which could be fatal. The RCU dereference must occur prior to the comparison in __rht_ptr. This patch changes the order