summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/socket/netstack
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-03-26 22:49:28 +0000
committergVisor bot <gvisor-bot@google.com>2020-03-26 22:49:28 +0000
commit9699018b4ab2b2ca9abb3170abff4ab630238641 (patch)
treeccc43fb184215226265ede5412a2ed3ca6bed433 /pkg/sentry/socket/netstack
parent98c58a207c4b3dfc9dd9b0d0ccab4e85fe82be75 (diff)
parent0e62a548eb093c95e41780c753afa87f4ccc5c8f (diff)
Merge release-20200219.0-249-g0e62a54 (automated)
Diffstat (limited to 'pkg/sentry/socket/netstack')
-rwxr-xr-xpkg/sentry/socket/netstack/provider.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/sentry/socket/netstack/provider.go b/pkg/sentry/socket/netstack/provider.go
index 5f181f017..eb090e79b 100755
--- a/pkg/sentry/socket/netstack/provider.go
+++ b/pkg/sentry/socket/netstack/provider.go
@@ -126,6 +126,12 @@ func (p *provider) Socket(t *kernel.Task, stype linux.SockType, protocol int) (*
ep, e = eps.Stack.NewRawEndpoint(transProto, p.netProto, wq, associated)
} else {
ep, e = eps.Stack.NewEndpoint(transProto, p.netProto, wq)
+
+ // Assign task to PacketOwner interface to get the UID and GID for
+ // iptables owner matching.
+ if e == nil {
+ ep.SetOwner(t)
+ }
}
if e != nil {
return nil, syserr.TranslateNetstackError(e)