spiegel_podman/pkg
Giuseppe Scrivano 7a11ed5a77
libpod: fix --userns=keep-id with big UIDs
when creating a keep-id namespace, we split the original user
namespace in:

inner ns | outer ns  | size:
0        | 1         | ID
ID       | 0         | 1
ID+1     | ID+1      | availableIds - ID

When the user ID is bigger than the number of available
subuids/subgids we fail to create the user namespace because the first
slice is bigger than the available number of IDs and the third one has
a negative size.

Fix it by not using more than the available number of IDs in the first
slice and creating the third one only if there are other IDs left.

When the user ID is bigger than the number of additional IDs, there
will be a gap between the two mappings so the IDs between the maximum
additional ID and the user ID won't be present inside of the
namespace.

Closes: https://github.com/containers/libpod/issues/4838

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-01-10 22:33:30 +01:00
..
adapter Initial commit on compatible API 2020-01-10 09:41:39 -06:00
annotations Add ContainerManager annotation to created containers 2019-09-10 09:37:14 +02:00
api fix e2e test failure 2020-01-10 13:06:26 -06:00
apparmor golangci-lint round #3 2019-07-21 14:22:39 -05:00
bindings Initial commit on compatible API 2020-01-10 09:41:39 -06:00
cgroups cgroups: read correctly the CPU stats 2019-11-01 20:51:24 +01:00
channelwriter account for varlink calls that dont use more 2019-07-10 08:50:05 -05:00
criu Add helper function to read out CRIU version 2018-10-23 12:52:03 +02:00
ctime Re-add int64 casts for ctime 2019-07-23 15:43:40 -04:00
errorhandling first pass of corrections for golangci-lint 2019-07-10 15:52:17 -05:00
hooks codespell: spelling corrections 2019-11-13 08:15:00 +11:00
inspect Begin to break up pkg/inspect 2019-06-03 15:54:53 -04:00
kubeutils Remove dependency on kubernetes 2018-03-27 21:55:33 +00:00
logs first pass of corrections for golangci-lint 2019-07-10 15:52:17 -05:00
lookup execuser: look at the source for /etc/{passwd,group} overrides 2019-09-21 22:11:09 +02:00
namespaces namespaces: by default create cgroupns on cgroups v2 2019-11-05 17:29:01 +01:00
netns network: hide EPERM warning when rootless 2019-10-01 08:51:58 +02:00
network Initial commit on compatible API 2020-01-10 09:41:39 -06:00
registrar Update registrar unit tests to match them of cri-o 2019-04-04 08:53:32 +02:00
registries podman: mirror information 2019-12-12 19:53:46 -03:00
resolvconf Use host's resolv.conf if no network namespace enabled 2018-11-27 15:28:09 -05:00
rootless fix lint in pkg/rootless 2020-01-08 15:44:30 +01:00
rootlessport rootlessport: honor ctr.runtime.config.TmpDir 2020-01-09 14:06:33 +09:00
spec fix lint - pkg/spec 2020-01-08 15:44:30 +01:00
sysinfo Setup a reasonable default for pids-limit 4096 2019-10-04 16:09:13 -04:00
systemdgen generate systemd: support pods and geneartig files 2019-08-21 17:28:30 +02:00
timetype timestamp related functions added 2019-11-14 17:16:22 +09:00
tracing trivial cleanups from golang 2019-07-03 15:41:33 -05:00
trust codespell: spelling corrections 2019-11-13 08:15:00 +11:00
util libpod: fix --userns=keep-id with big UIDs 2020-01-10 22:33:30 +01:00
varlinkapi Initial commit on compatible API 2020-01-10 09:41:39 -06:00