nestybox / nestybox/sysbox

Disabling ASLR not supported in inner "privileged" containers

Open
#241 2 comments 0 reactions 1 assignee View on GitHub

@ctalledo is already working on this.

Since Mar 23, 2022.

question
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:

  1. On the host, run: docker run --runtime=sysbox-runc -it nestybox/alpine-docker:latest
  2. Start dockerd: dockerd 1>/var/log/dockerd.log 2>&1 &
  3. In the container, create a "privileged" inner container: docker run --privileged -it --rm alpine:3.12
  4. In the inner container, add some packages for simple development and debugging: apk add gcc musl-dev gdb nano
  5. Make a small C program and compile it.
  6. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.