From beac59b37a8b0ea834904870e5c236d2627947a2 Mon Sep 17 00:00:00 2001 From: Ian Gudger Date: Wed, 3 Oct 2018 20:21:25 -0700 Subject: Fix panic if FIOASYNC callback is registered and triggered without target PiperOrigin-RevId: 215674589 Change-Id: I4f8871b64c570dc6da448d2fe351cec8a406efeb --- pkg/sentry/kernel/fasync/fasync.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pkg/sentry/kernel/fasync') 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 || -- cgit v1.2.3