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

Does crun really need CAP_SYS_RESOURCE #1388

Closed
alexlarsson opened this issue Jan 17, 2024 · 1 comment · Fixed by #1391
Closed

Does crun really need CAP_SYS_RESOURCE #1388

alexlarsson opened this issue Jan 17, 2024 · 1 comment · Fixed by #1391

Comments

@alexlarsson
Copy link

We've been trying to run containers in a subcontainer (qm) that has dropped the sys_resource capability, but we then get:

bash-5.1# podman run -ti localhost/auto-apps bash
Error: crun: setrlimit (RLIM_MEMLOCK): Operation not permitted: OCI permission denied

This seems to be from
https://github.com/containers/crun/blob/14958f43c803aef3cd2f936e37cf404f6b9ebc64/src/libcrun/ebpf.c#L465C1-L470C67
which sets RLIMIT_MEMLOCK when it sets up the cgroupv2 version of device access.
Is this really needed?

dougsland added a commit to containers/qm that referenced this issue Jan 17, 2024
There is errors running podman (OCI permission denied) limiting
the environment. Comment for now.

See-Also: containers/crun#1388

Signed-off-by: Douglas Schilling Landgraf <[email protected]>
giuseppe added a commit to giuseppe/crun that referenced this issue Jan 18, 2024
Linux commit 3ac1f01b43b6e2759cc34d3a715ba5eed04c5805, present in
Linux 5.11, changed the way memory for eBPF programs is
accounted. They do not use rlimit-based memory accounting anymore, buy
memcg-based memory accounting.

Closes: containers#1388

Signed-off-by: Giuseppe Scrivano <[email protected]>
@giuseppe
Copy link
Member

opened a PR: #1391

dougsland added a commit to containers/qm that referenced this issue Jan 31, 2024
Recently we commented DropCapability due crun issue
containers/crun#1388 got resolved.

Fixes: #335

Signed-off-by: Douglas Schilling Landgraf <[email protected]>
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 a pull request may close this issue.

2 participants