Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux: copy map_file before tokenizing in uidgidmap_helper #1587

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

aconz2
Copy link
Contributor

@aconz2 aconz2 commented Oct 24, 2024

libcrun_set_usernamespace passes uid_map/gid_map to uidgidmap_helper which tokenizes it to pass as process args. But if the helper isn't available, the fallback (when host_uid != 0) reuses this tokenized string and tries writing it to /proc/pid/gid_map which fails with EINVAL

closes #1585

src/libcrun/linux.c Outdated Show resolved Hide resolved
libcrun_set_usernamespace passes uid_map/gid_map to uidgidmap_helper
which tokenizes it to pass as process args. But if the helper isn't available,
the fallback (when host_uid != 0) reuses this tokenized string and tries
writing it to /proc/pid/gid_map which fails with EINVAL

Signed-off-by: Andrew Consroe <[email protected]>
Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@giuseppe giuseppe merged commit 135f6aa into containers:main Oct 25, 2024
57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gid_map creation fails without newgidmap when host_uid != 0
2 participants