diff options
author | Fabricio Voznika <fvoznika@google.com> | 2018-12-27 14:58:41 -0800 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-12-27 14:59:50 -0800 |
commit | 46e6577014c849d7306c63905db25f3c695fa7e7 (patch) | |
tree | f0beec40f3bbda38bf209809b091cf537b66cba8 /pkg/sentry/socket/epsocket | |
parent | bce2f9751f415da869d04ccb53833b024373666d (diff) |
Fix deadlock between epoll_wait and getdents
epoll_wait acquires EventPoll.listsMu (in EventPoll.ReadEvents) and
then calls Inotify.Readiness which tries to acquire Inotify.evMu.
getdents acquires Inotify.evMu (in Inotify.queueEvent) and then calls
readyCallback.Callback which tries to acquire EventPoll.listsMu.
The fix is to release Inotify.evMu before calling Queue.Notify. Queue
is thread-safe and doesn't require Inotify.evMu to be held.
Closes #121
PiperOrigin-RevId: 227066695
Change-Id: Id29364bb940d1727f33a5dff9a3c52f390c15761
Diffstat (limited to 'pkg/sentry/socket/epsocket')
0 files changed, 0 insertions, 0 deletions