mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
fix RCU-callback-after-kmem_cache_destroy problem in sl[aou]b
Jesper noted that kmem_cache_destroy() invokes synchronize_rcu() rather than rcu_barrier() in the SLAB_DESTROY_BY_RCU case, which could result in RCU callbacks accessing a kmem_cache after it had been destroyed. Cc: <[email protected]> Acked-by: Matt Mackall <[email protected]> Reported-by: Jesper Dangaard Brouer <[email protected]> Signed-off-by: Paul E. McKenney <[email protected]> Signed-off-by: Pekka Enberg <[email protected]>
This commit is contained in:
parent
28d0325ce6
commit
7ed9f7e5db
3 changed files with 5 additions and 1 deletions
|
|
@ -2547,7 +2547,7 @@ void kmem_cache_destroy(struct kmem_cache *cachep)
|
|||
}
|
||||
|
||||
if (unlikely(cachep->flags & SLAB_DESTROY_BY_RCU))
|
||||
synchronize_rcu();
|
||||
rcu_barrier();
|
||||
|
||||
__kmem_cache_destroy(cachep);
|
||||
mutex_unlock(&cache_chain_mutex);
|
||||
|
|
|
|||
Loading…
Reference in a new issue