mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
userfaultfd: non-cooperative: flush event_wqh at release time
There may still be threads waiting on event_wqh at the time the
userfault file descriptor is closed. Flush the events wait-queue to
prevent waiting threads from hanging.
Link: http://lkml.kernel.org/r/[email protected]
Fixes: 9cd75c3cd4 ("userfaultfd: non-cooperative: add ability to report
non-PF events from uffd descriptor")
Signed-off-by: Mike Rapoport <[email protected]>
Cc: Andrea Arcangeli <[email protected]>
Cc: "Dr. David Alan Gilbert" <[email protected]>
Cc: Pavel Emelyanov <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
ade9f91b32
commit
5a18b64e3f
1 changed files with 3 additions and 0 deletions
|
|
@ -854,6 +854,9 @@ wakeup:
|
|||
__wake_up_locked_key(&ctx->fault_wqh, TASK_NORMAL, &range);
|
||||
spin_unlock(&ctx->fault_pending_wqh.lock);
|
||||
|
||||
/* Flush pending events that may still wait on event_wqh */
|
||||
wake_up_all(&ctx->event_wqh);
|
||||
|
||||
wake_up_poll(&ctx->fd_wqh, POLLHUP);
|
||||
userfaultfd_ctx_put(ctx);
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue