diff options
author | Beau Belgrave <beaub@linux.microsoft.com> | 2022-03-09 16:11:41 -0800 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2022-03-11 11:49:24 -0500 |
commit | 7e348b325bc40eb52aead4d57a1f90d33ea834fc (patch) | |
tree | 3cf73f757cbc4b1d1a483d8ad8e3fe7ee7306f09 /include/linux/fpga/fpga-mgr.h | |
parent | 3a73333fb370f7b65de9d94c53df503642bda789 (diff) |
user_events: Prevent dyn_event delete racing with ioctl add/delete
Find user_events always while under the event_mutex and before leaving
the lock, add a ref count to the user_event. This ensures that all paths
under the event_mutex that check the ref counts will be synchronized.
The ioctl add/delete paths are protected by the reg_mutex. However,
dyn_event is only protected by the event_mutex. The dyn_event delete
path cannot acquire reg_mutex, since that could cause a deadlock between
the ioctl delete case acquiring event_mutex after acquiring the reg_mutex.
Link: https://lkml.kernel.org/r/20220310001141.1660-1-beaub@linux.microsoft.com
Signed-off-by: Beau Belgrave <beaub@linux.microsoft.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'include/linux/fpga/fpga-mgr.h')
0 files changed, 0 insertions, 0 deletions