summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/fasync
diff options
context:
space:
mode:
authorDean Deng <deandeng@google.com>2020-07-01 08:40:31 -0700
committergVisor bot <gvisor-bot@google.com>2020-07-01 08:42:12 -0700
commitcda2979b63fad37a33706f8aa430664a9c4d0b3b (patch)
treec8842b932e519733af30a77945a1c0d6c2d7569e /pkg/sentry/kernel/fasync
parentb8f165ab1cb4d4345d8a25f95a5bc0fece2d49c7 (diff)
Complete async signal delivery support in vfs2.
- Support FIOASYNC, FIO{SET,GET}OWN, SIOC{G,S}PGRP (refactor getting/setting owner in the process). - Unset signal recipient when setting owner with pid == 0 and valid owner type. Updates #2923. PiperOrigin-RevId: 319231420
Diffstat (limited to 'pkg/sentry/kernel/fasync')
-rw-r--r--pkg/sentry/kernel/fasync/fasync.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/sentry/kernel/fasync/fasync.go b/pkg/sentry/kernel/fasync/fasync.go
index 323f1dfa5..153d2cd9b 100644
--- a/pkg/sentry/kernel/fasync/fasync.go
+++ b/pkg/sentry/kernel/fasync/fasync.go
@@ -176,3 +176,13 @@ func (a *FileAsync) SetOwnerProcessGroup(requester *kernel.Task, recipient *kern
a.recipientTG = nil
a.recipientPG = recipient
}
+
+// ClearOwner unsets the current signal recipient.
+func (a *FileAsync) ClearOwner() {
+ a.mu.Lock()
+ defer a.mu.Unlock()
+ a.requester = nil
+ a.recipientT = nil
+ a.recipientTG = nil
+ a.recipientPG = nil
+}