diff options
author | Dean Deng <deandeng@google.com> | 2020-07-01 08:40:31 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-07-01 08:42:12 -0700 |
commit | cda2979b63fad37a33706f8aa430664a9c4d0b3b (patch) | |
tree | c8842b932e519733af30a77945a1c0d6c2d7569e /pkg/sentry/kernel/fasync | |
parent | b8f165ab1cb4d4345d8a25f95a5bc0fece2d49c7 (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.go | 10 |
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 +} |