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

Don't touch groups with -Z root. #1209

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marenamat
Copy link

In single-user namespaces, calling initgroups() is forbidden. This enables tcpdump to be compiled with forced privilege separation while keeping the ability to actually run in an isolated environment where the privilege separation is already done by other means.

In single-user namespaces, calling initgroups() is forbidden.
This enables tcpdump to be compiled with forced privilege separation
while keeping the ability to actually run in an isolated environment
where the privilege separation is already done by other means.
@infrastation
Copy link
Member

What would be the simplest way to reproduce the problem that this change solves?

@marenamat
Copy link
Author

unshare -nUfr tcpdump -Z root

This command actually makes no sense to be run isolated but it reproduces the issue.

$ unshare -nUfr tcpdump -Z root
tcpdump: Couldn't change to 'root' uid=0 gid=0: Operation not permitted
$ unshare -nUfr ~/tcpdump/tcpdump -Z root
requested to not drop privs
tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
…

The actual use case is to simulate routing between several virtual pseudomachines. It is all possible to be run by an unprivileged user but tcpdump built with default privilege separation refuses to work there because it's forbidden to call setgroups inside these not-even-containers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants