diff options
author | Ian Gudger <igudger@google.com> | 2018-10-03 20:21:25 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-10-03 20:22:31 -0700 |
commit | beac59b37a8b0ea834904870e5c236d2627947a2 (patch) | |
tree | 7a8c5793b48ee86a8241fddb38a40e75490f96af /pkg/sentry/kernel/fasync/fasync.go | |
parent | e98b14b4aa1cb6ade3fcebbe5cbcb51136ba56a5 (diff) |
Fix panic if FIOASYNC callback is registered and triggered without target
PiperOrigin-RevId: 215674589
Change-Id: I4f8871b64c570dc6da448d2fe351cec8a406efeb
Diffstat (limited to 'pkg/sentry/kernel/fasync/fasync.go')
-rw-r--r-- | pkg/sentry/kernel/fasync/fasync.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/sentry/kernel/fasync/fasync.go b/pkg/sentry/kernel/fasync/fasync.go index 7d01abe90..f77339cae 100644 --- a/pkg/sentry/kernel/fasync/fasync.go +++ b/pkg/sentry/kernel/fasync/fasync.go @@ -60,6 +60,11 @@ func (a *FileAsync) Callback(e *waiter.Entry) { if tg != nil { t = tg.Leader() } + if t == nil { + // No recipient has been registered. + a.mu.Unlock() + return + } c := t.Credentials() // Logic from sigio_perm in fs/fcntl.c. if a.requester.EffectiveKUID == 0 || |