diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-07-22 14:33:18 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-07-22 14:33:18 -0700 |
commit | 8daeda207205f9c66083846e6ba231ab04e09163 (patch) | |
tree | d1ab40a29ca612f64396b4ce34a04fe163587032 /pkg/sentry/kernel/ipc_namespace.go | |
parent | 70626b3da217373eb74420e2c3426cc9283265fa (diff) | |
parent | 4a874557f5846ec9cb2e5b2515921e37a4ca4f07 (diff) |
Merge pull request #6108 from sudo-sturbia:msgqueue/syscalls
PiperOrigin-RevId: 386323389
Diffstat (limited to 'pkg/sentry/kernel/ipc_namespace.go')
-rw-r--r-- | pkg/sentry/kernel/ipc_namespace.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/sentry/kernel/ipc_namespace.go b/pkg/sentry/kernel/ipc_namespace.go index 9545bb5ef..0b101b1bb 100644 --- a/pkg/sentry/kernel/ipc_namespace.go +++ b/pkg/sentry/kernel/ipc_namespace.go @@ -17,6 +17,7 @@ package kernel import ( "gvisor.dev/gvisor/pkg/context" "gvisor.dev/gvisor/pkg/sentry/kernel/auth" + "gvisor.dev/gvisor/pkg/sentry/kernel/msgqueue" "gvisor.dev/gvisor/pkg/sentry/kernel/semaphore" "gvisor.dev/gvisor/pkg/sentry/kernel/shm" ) @@ -30,6 +31,7 @@ type IPCNamespace struct { // User namespace which owns this IPC namespace. Immutable. userNS *auth.UserNamespace + queues *msgqueue.Registry semaphores *semaphore.Registry shms *shm.Registry } @@ -38,6 +40,7 @@ type IPCNamespace struct { func NewIPCNamespace(userNS *auth.UserNamespace) *IPCNamespace { ns := &IPCNamespace{ userNS: userNS, + queues: msgqueue.NewRegistry(userNS), semaphores: semaphore.NewRegistry(userNS), shms: shm.NewRegistry(userNS), } @@ -45,6 +48,11 @@ func NewIPCNamespace(userNS *auth.UserNamespace) *IPCNamespace { return ns } +// MsgqueueRegistry returns the message queue registry for this namespace. +func (i *IPCNamespace) MsgqueueRegistry() *msgqueue.Registry { + return i.queues +} + // SemaphoreRegistry returns the semaphore set registry for this namespace. func (i *IPCNamespace) SemaphoreRegistry() *semaphore.Registry { return i.semaphores |