Disabling ASLR not supported in inner "privileged" containers
@ctalledo is already working on this.
Since Mar 23, 2022.
- Dominant language
- Shell
- Stars
- 3.9k
- Forks
- 230
- Avg merge
- 7h 48m
- Merged PRs (30d)
- 3
Description
Background: I am working on containerizing a buffer overflow exploit lab for our security class, and one of the issues I ran into is that the default seccomp profile limits the personality() syscall to "safe" values which prevents ASLR from being turned off.
I began investigating sysbox as a way to run "privileged" containers which allow the personality() syscall to disable process ASLR. However, this doesn't seem to work. I'm running sysbox 0.2.1 on Ubuntu 20.04.2.
Steps to reproduce:
- On the host, run: docker run --runtime=sysbox-runc -it nestybox/alpine-docker:latest
- Start dockerd: dockerd 1>/var/log/dockerd.log 2>&1 &
- In the container, create a "privileged" inner container: docker run --privileged -it --rm alpine:3.12
- In the inner container, add some packages for simple development and debugging: apk add gcc musl-dev gdb nano
- Make a small C program and compile it.
- Run the resulting executable under gdb:
(gdb) r
Starting program: /hello
warning: Error disabling address space randomization: Operation not permitted
Hello, world!
[Inferior 1 (process 52) exited normally]
(gdb)
Obviously this is a niche use case so it might not be worth addressing. However, it might be useful for debugging reproduceable crashes inside a container, etc.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.