mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Disallow "trusted" namespace xattr in VFS2 gofer client.
Allowing this namespace makes way for a lot of GetXattr RPCs to the gofer process when the gofer filesystem is the lower layer of an overlay. The overlay filesystem aggressively queries for "trusted.overlay.opaque" which in practice is never found in the lower layer gofer. But leads to a lot of wasted work. A consequence is that mutable gofer upper layer is not supported anymore but that is still consistent with VFS1. We can revisit when need arises. PiperOrigin-RevId: 401860585
This commit is contained in:
@@ -1595,7 +1595,10 @@ func (d *dentry) checkXattrPermissions(creds *auth.Credentials, name string, ats
|
||||
// (b/148380782). Allow all other extended attributes to be passed through
|
||||
// to the remote filesystem. This is inconsistent with Linux's 9p client,
|
||||
// but consistent with other filesystems (e.g. FUSE).
|
||||
if strings.HasPrefix(name, linux.XATTR_SECURITY_PREFIX) || strings.HasPrefix(name, linux.XATTR_SYSTEM_PREFIX) {
|
||||
//
|
||||
// NOTE(b/202533394): Also disallow "trusted" namespace for now. This is
|
||||
// consistent with the VFS1 gofer client.
|
||||
if strings.HasPrefix(name, linux.XATTR_SECURITY_PREFIX) || strings.HasPrefix(name, linux.XATTR_SYSTEM_PREFIX) || strings.HasPrefix(name, linux.XATTR_TRUSTED_PREFIX) {
|
||||
return linuxerr.EOPNOTSUPP
|
||||
}
|
||||
mode := linux.FileMode(atomic.LoadUint32(&d.mode))
|
||||
|
||||
Reference in New Issue
Block a user