diff options
| author | Peter Zijlstra <[email protected]> | 2015-02-26 15:23:11 +0000 |
|---|---|---|
| committer | Ingo Molnar <[email protected]> | 2015-03-23 09:49:07 +0000 |
| commit | 35a9393c95b31870a74f51a3e7455f33f5657b6f (patch) | |
| tree | 9a0e913b3d2dc02956c03a24b535a3604bb2dfa7 /net/unix/af_unix.c | |
| parent | Linux 4.0-rc5 (diff) | |
| download | kernel-35a9393c95b31870a74f51a3e7455f33f5657b6f.tar.gz kernel-35a9393c95b31870a74f51a3e7455f33f5657b6f.zip | |
lockdep: Fix the module unload key range freeing logic
Module unload calls lockdep_free_key_range(), which removes entries
from the data structures. Most of the lockdep code OTOH assumes the
data structures are append only; in specific see the comments in
add_lock_to_list() and look_up_lock_class().
Clearly this has only worked by accident; make it work proper. The
actual scenario to make it go boom would involve the memory freed by
the module unlock being re-allocated and re-used for a lock inside of
a rcu-sched grace period. This is a very unlikely scenario, still
better plug the hole.
Use RCU list iteration in all places and ammend the comments.
Change lockdep_free_key_range() to issue a sync_sched() between
removal from the lists and returning -- which results in the memory
being freed. Further ensure the callers are placed correctly and
comment the requirements.
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Andrey Tsyvarev <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Paul E. McKenney <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Rusty Russell <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions
