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

idmaptool_on_path_and_privileged doesn't check file privileges #3777

Closed
fergus-dall opened this issue Apr 12, 2021 · 1 comment
Closed

idmaptool_on_path_and_privileged doesn't check file privileges #3777

fergus-dall opened this issue Apr 12, 2021 · 1 comment
Labels
Bug Confirmed to be a bug

Comments

@fergus-dall
Copy link

Issue description

idmaptool_on_path_and_privileged is supposed to control whether the newuidmap and newgidmap tools are used, skipping them if they lack both setuid and CAP_SETUID/CAP_SETGID file capabilities. However, if they lack any of these permissions, the function still returns success.

This appears to have been introduced by commit 3275932. The previous version stored the return value in a local variable, and the refactorer appears to have thought that this value was always set to one by the bottom of the function, when it could actually keep it's default value the whole way through.

Steps to reproduce

  1. Remove setuid and all file capabilities from /usr/bin/newuidmap
  2. Start a container with a non-trivial uid map
@brauner brauner added the Bug Confirmed to be a bug label Apr 12, 2021
@brauner
Copy link
Member

brauner commented Apr 12, 2021

I sent a fix for that.

brauner pushed a commit that referenced this issue Apr 12, 2021
Fixes: #3777
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Confirmed to be a bug
Development

No branches or pull requests

2 participants