summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/vfs/options.go
diff options
context:
space:
mode:
authorDean Deng <deandeng@google.com>2020-04-10 19:01:39 -0700
committergVisor bot <gvisor-bot@google.com>2020-04-10 19:02:55 -0700
commit09ddb5a4262c39744643b612109dd12dcce176a8 (patch)
tree6d8326d63c7712bea7a68bd4b4089c9c9866f5b2 /pkg/sentry/vfs/options.go
parent96f914295920404e7c5c97553771e09b31f6900a (diff)
Port extended attributes to VFS2.
As in VFS1, we only support the user.* namespace. Plumbing is added to tmpfs and goferfs. Note that because of the slightly different order of checks between VFS2 and Linux, one of the xattr tests needs to be relaxed slightly. Fixes #2363. PiperOrigin-RevId: 305985121
Diffstat (limited to 'pkg/sentry/vfs/options.go')
-rw-r--r--pkg/sentry/vfs/options.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/pkg/sentry/vfs/options.go b/pkg/sentry/vfs/options.go
index 2f04bf882..534528ce6 100644
--- a/pkg/sentry/vfs/options.go
+++ b/pkg/sentry/vfs/options.go
@@ -132,6 +132,20 @@ type SetStatOptions struct {
Stat linux.Statx
}
+// GetxattrOptions contains options to VirtualFilesystem.GetxattrAt(),
+// FilesystemImpl.GetxattrAt(), FileDescription.Getxattr(), and
+// FileDescriptionImpl.Getxattr().
+type GetxattrOptions struct {
+ // Name is the name of the extended attribute to retrieve.
+ Name string
+
+ // Size is the maximum value size that the caller will tolerate. If the value
+ // is larger than size, getxattr methods may return ERANGE, but they are also
+ // free to ignore the hint entirely (i.e. the value returned may be larger
+ // than size). All size checking is done independently at the syscall layer.
+ Size uint64
+}
+
// SetxattrOptions contains options to VirtualFilesystem.SetxattrAt(),
// FilesystemImpl.SetxattrAt(), FileDescription.Setxattr(), and
// FileDescriptionImpl.Setxattr().