summaryrefslogtreecommitdiffhomepage
path: root/pkg
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-06-30 00:05:49 +0000
committergVisor bot <gvisor-bot@google.com>2021-06-30 00:05:49 +0000
commit7a8bc54a0cb8edc370e4a2ac3d9b285dc37a21dc (patch)
treedc7c17a853989cfd348076c7d6964679dfe35618 /pkg
parenta81deffb4e19f1edb78b618a97df4bd129e312c8 (diff)
parent90dbb4b0c7e594ba67fec26c2cdb1dfd7d7454de (diff)
Merge release-20210628.0-9-g90dbb4b0c (automated)
Diffstat (limited to 'pkg')
-rw-r--r--pkg/sentry/socket/hostinet/socket_unsafe.go18
1 files changed, 17 insertions, 1 deletions
diff --git a/pkg/sentry/socket/hostinet/socket_unsafe.go b/pkg/sentry/socket/hostinet/socket_unsafe.go
index d3be2d825..86dc879d5 100644
--- a/pkg/sentry/socket/hostinet/socket_unsafe.go
+++ b/pkg/sentry/socket/hostinet/socket_unsafe.go
@@ -67,7 +67,23 @@ func ioctl(ctx context.Context, fd int, io usermem.IO, args arch.SyscallArgument
AddressSpaceActive: true,
})
return 0, err
-
+ case unix.SIOCGIFFLAGS:
+ cc := &usermem.IOCopyContext{
+ Ctx: ctx,
+ IO: io,
+ Opts: usermem.IOOpts{
+ AddressSpaceActive: true,
+ },
+ }
+ var ifr linux.IFReq
+ if _, err := ifr.CopyIn(cc, args[2].Pointer()); err != nil {
+ return 0, err
+ }
+ if _, _, errno := unix.Syscall(unix.SYS_IOCTL, uintptr(fd), cmd, uintptr(unsafe.Pointer(&ifr))); errno != 0 {
+ return 0, translateIOSyscallError(errno)
+ }
+ _, err := ifr.CopyOut(cc, args[2].Pointer())
+ return 0, err
default:
return 0, syserror.ENOTTY
}