summaryrefslogtreecommitdiffhomepage
path: root/pkg
diff options
context:
space:
mode:
authorJamie Liu <jamieliu@google.com>2019-03-29 13:15:49 -0700
committerShentubot <shentubot@google.com>2019-03-29 13:16:46 -0700
commit69afd0438e3213b8bf6d74bdf9c288772f81e834 (patch)
treecd0a67d09b6486efc9ba219a37b95e2ce97043a6 /pkg
parented23f547093e705ba3d6f82b2ce49592180f9a5a (diff)
Return srclen in proc.idMapFileOperations.Write.
PiperOrigin-RevId: 241037926 Change-Id: I4b0381ac1c7575e8b861291b068d3da22bc03850
Diffstat (limited to 'pkg')
-rw-r--r--pkg/sentry/fs/proc/uid_gid_map.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/sentry/fs/proc/uid_gid_map.go b/pkg/sentry/fs/proc/uid_gid_map.go
index a52e0cb1f..0c68bbfc9 100644
--- a/pkg/sentry/fs/proc/uid_gid_map.go
+++ b/pkg/sentry/fs/proc/uid_gid_map.go
@@ -169,5 +169,8 @@ func (imfo *idMapFileOperations) Write(ctx context.Context, file *fs.File, src u
if err != nil {
return 0, err
}
- return int64(len(b)), nil
+
+ // On success, Linux's kernel/user_namespace.c:map_write() always returns
+ // count, even if fewer bytes were used.
+ return int64(srclen), nil
}