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

fixes for CVE-2019-16884 #28

Conversation

giuseppe
Copy link

giuseppe and others added 5 commits October 14, 2019 15:14
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Fixes #2128

This allows proc to be bind mounted for host and rootless namespace usecases but
it removes the ability to mount over the top of proc with a directory.

```bash
> sudo docker run --rm  apparmor
docker: Error response from daemon: OCI runtime create failed:
container_linux.go:346: starting container process caused "process_linux.go:449:
container init caused \"rootfs_linux.go:58: mounting
\\\"/var/lib/docker/volumes/aae28ea068c33d60e64d1a75916cf3ec2dc3634f97571854c9ed30c8401460c1/_data\\\"
to rootfs
\\\"/var/lib/docker/overlay2/a6be5ae911bf19f8eecb23a295dec85be9a8ee8da66e9fb55b47c841d1e381b7/merged\\\"
at \\\"/proc\\\" caused
\\\"\\\\\\\"/var/lib/docker/overlay2/a6be5ae911bf19f8eecb23a295dec85be9a8ee8da66e9fb55b47c841d1e381b7/merged/proc\\\\\\\"
cannot be mounted because it is not of type proc\\\"\"": unknown.

> sudo docker run --rm -v /proc:/proc apparmor

docker-default (enforce)        root     18989  0.9  0.0   1288     4 ?
Ss   16:47   0:00 sleep 20
```

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit 331692b)
This is a bump to v1.3.0, plus the necessary CVE-2019-16884 mitigation.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
(cherry picked from commit 9aef504)
This is an additional mitigation for CVE-2019-16884. The primary problem
is that Docker can be coerced into bind-mounting a file system on top of
/proc (resulting in label-related writes to /proc no longer happening).

While we are working on mitigations against permitting the mounts, this
helps avoid our code from being tricked into writing to non-procfs
files. This is not a perfect solution (after all, there might be a
bind-mount of a different procfs file over the target) but in order to
exploit that you would need to be able to tweak a config.json pretty
specifically (which thankfully Docker doesn't allow).

Specifically this stops AppArmor from not labeling a process silently
due to /proc/self/attr/... being incorrectly set, and stops any
accidental fd leaks because /proc/self/fd/... is not real.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
(cherry picked from commit d463f64)
@rhatdan
Copy link
Member

rhatdan commented Oct 14, 2019

LGTM

@giuseppe giuseppe changed the title [WIP] fixes for CVE-2019-16884 fixes for CVE-2019-16884 Oct 16, 2019
@giuseppe
Copy link
Author

dropped the WIP

@rhatdan
Copy link
Member

rhatdan commented Oct 16, 2019

@edsantiago PTAL

@edsantiago
Copy link

I don't think I can help here. I don't know enough about runc to review the proposed changes; and I can't reproduce the SELinux vulnerability on Fedora, not even with runc -93 nor with crun, so I can't even write test cases. I'm sorry.

@rhatdan
Copy link
Member

rhatdan commented Oct 18, 2019

Ok I will merge, as I think this fixes this issue.

@rhatdan rhatdan merged commit 75d83c7 into projectatomic:docker-1.13.1-rhel Oct 18, 2019
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 this pull request may close these issues.

None yet

5 participants