diff options
author | Frederic Weisbecker <[email protected]> | 2021-06-28 15:34:28 +0200 |
---|---|---|
committer | Steffen Klassert <[email protected]> | 2021-07-02 09:27:55 +0200 |
commit | 2580d3f40022642452dd8422bfb8c22e54cf84bb (patch) | |
tree | 0c10c26a6d4bb8f398b40de983894a02bd13f7f1 /scripts/gdb/linux/timerlist.py | |
parent | eaf228263921cd15962654b539d916380a0f076e (diff) |
xfrm: Fix RCU vs hash_resize_mutex lock inversion
xfrm_bydst_resize() calls synchronize_rcu() while holding
hash_resize_mutex. But then on PREEMPT_RT configurations,
xfrm_policy_lookup_bytype() may acquire that mutex while running in an
RCU read side critical section. This results in a deadlock.
In fact the scope of hash_resize_mutex is way beyond the purpose of
xfrm_policy_lookup_bytype() to just fetch a coherent and stable policy
for a given destination/direction, along with other details.
The lower level net->xfrm.xfrm_policy_lock, which among other things
protects per destination/direction references to policy entries, is
enough to serialize and benefit from priority inheritance against the
write side. As a bonus, it makes it officially a per network namespace
synchronization business where a policy table resize on namespace A
shouldn't block a policy lookup on namespace B.
Fixes: 77cc278f7b20 (xfrm: policy: Use sequence counters with associated lock)
Cc: [email protected]
Cc: Ahmed S. Darwish <[email protected]>
Cc: Peter Zijlstra (Intel) <[email protected]>
Cc: Varad Gautam <[email protected]>
Cc: Steffen Klassert <[email protected]>
Cc: Herbert Xu <[email protected]>
Cc: David S. Miller <[email protected]>
Signed-off-by: Frederic Weisbecker <[email protected]>
Signed-off-by: Steffen Klassert <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/timerlist.py')
0 files changed, 0 insertions, 0 deletions