diff options
author | Michael Pratt <mpratt@google.com> | 2020-03-02 10:05:52 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-03-02 10:07:13 -0800 |
commit | 62bd3ca8a37543c060292ca86669e537b9ebf36d (patch) | |
tree | f70d6f2058fbc6c35e35e6cc182d04f284c3793f /pkg/sentry/fs/fsutil/inode.go | |
parent | 3d9ddeb339ce41f82717643dce92b24f3ae0cf41 (diff) |
Take write lock when removing xattr
PiperOrigin-RevId: 298380654
Diffstat (limited to 'pkg/sentry/fs/fsutil/inode.go')
-rw-r--r-- | pkg/sentry/fs/fsutil/inode.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/sentry/fs/fsutil/inode.go b/pkg/sentry/fs/fsutil/inode.go index daecc4ffe..1922ff08c 100644 --- a/pkg/sentry/fs/fsutil/inode.go +++ b/pkg/sentry/fs/fsutil/inode.go @@ -259,8 +259,8 @@ func (i *InodeSimpleExtendedAttributes) ListXattr(context.Context, *fs.Inode, ui // RemoveXattr implements fs.InodeOperations.RemoveXattr. func (i *InodeSimpleExtendedAttributes) RemoveXattr(_ context.Context, _ *fs.Inode, name string) error { - i.mu.RLock() - defer i.mu.RUnlock() + i.mu.Lock() + defer i.mu.Unlock() if _, ok := i.xattrs[name]; ok { delete(i.xattrs, name) return nil |