Docker not built with seccomp

Bug #1639407 reported by Lizzie Dixon
264
This bug affects 1 person
Affects Status Importance Assigned to Milestone
docker.io (Ubuntu)
Fix Released
Undecided
Unassigned
Xenial
Fix Released
Undecided
Unassigned
Yakkety
Fix Released
Undecided
Unassigned
runc (Ubuntu)
Fix Released
Undecided
Unassigned
Xenial
Fix Released
Undecided
Unassigned
Yakkety
Fix Released
Undecided
Unassigned

Bug Description

[Impact]
Hi,

I noticed that the 'docker' provided by the 'docker.io' package
is not built with seccomp support.

This is seems to be true in xenial, yakkety, and zesty:

  ubuntu@ubuntu-xenial:~$ sudo docker run -it ubuntu grep Seccomp /proc/self/status
  Seccomp: 0

  ubuntu@ubuntu-yakkety:~$ sudo docker run -it ubuntu grep Seccomp /proc/self/status
  Seccomp: 0

  ubuntu@ubuntu-zesty:~$ sudo docker run -it ubuntu grep Seccomp /proc/self/status
  Seccomp: 0

This is despite the fact that the Ubuntu kernels are built with
seccomp support and that the necessary 'seccomp' version (2.2.1) is
available.

This damages Docker's security on Ubuntu:

+ This exploit of CVE-2016-5195 works on Ubuntu Docker but not on
  stock Docker, because of the availabilty of the 'ptrace' system
  call, which is blocked by Docker's default seccomp filter:
  https://github.com/gebl/dirtycow-docker-vdso

+ Ubuntu Docker allows the 'perf_event_open' system call, which,
  combined with /proc/sys/kernel/perf_event_paranoid being 1 by
  default on xenial, allows disclosure of registers in the
  kernel. This can be used to break KASLR, and possibly to leak other
  sensitive values, like the /dev/urandom seed.

+ Ubuntu Docker allows access to system calls like 'move_pages', which
  could be used to deny service to other NUMA-aware processes on the
  host.

+ Processes in Ubuntu Docker containers can 'unshare' to create a new
  user namespace and obtain a new set of capabilities, potentially
  including capabilities the user intended to drop.

These are acceptable security trade-offs to make in some contexts, but
I think the fact that they're different from Docker's packages could
easily make this surprising or unexpected behavior.

[Test Case]
"sudo docker run -it ubuntu grep Seccomp /proc/self/status" should show that Seccomp is enabled.

Also see https://wiki.ubuntu.com/DockerUpdates

[Regression potential]
See above.

Revision history for this message
Emily Ratliff (emilyr) wrote :

Thanks for the report, Lizzie. I've subscribed the Docker Ubuntu Maintainers so that they can have a look and comment.

Revision history for this message
Tianon Gravi (tianon) wrote :

I don't know much about /proc/<pid>/status, but I'm fairly certain we compile Docker with whatever seccomp support is available from upstream. Can you share the output of "docker info", especially the "Security Options" field?

Revision history for this message
Lizzie Dixon (l-zzie) wrote :
Download full text (6.3 KiB)

Here's the version I have installed and 'docker info':

    ubuntu@ubuntu-yakkety:~$ dpkg -s docker.io
    Package: docker.io
    Status: install ok installed
    Priority: optional
    Section: admin
    Installed-Size: 77442
    Maintainer: Ubuntu Developers <email address hidden>
    Architecture: amd64
    Version: 1.12.1-0ubuntu15
    Replaces: docker (<< 1.5~)
    Depends: adduser, containerd (>= 0.2.3~), iptables, runc (>= 1.0.0~rc1~), init-system-helpers (>= 1.18~), libapparmor1 (>= 2.6~devel), libc6 (>= 2.14), libdevmapper1.02.1 (>= 2:1.02.97)
    Recommends: ca-certificates, cgroupfs-mount | cgroup-lite, git, ubuntu-fan, xz-utils, apparmor
    Suggests: aufs-tools, btrfs-tools, debootstrap, docker-doc, rinse, zfs-fuse | zfsutils
    Breaks: docker (<< 1.5~)
    Conffiles:
     /etc/default/docker 4ed438ab743c3abef1a1006fa57b05cd
     /etc/init.d/docker 73e254995b37e21ac3b63825a3b28704
     /etc/init/docker.conf 8ce66c020d5e129a177a87e0c504439c
    Description: Linux container runtime
     Docker complements kernel namespacing with a high-level API which operates at
     the process level. It runs unix processes with strong guarantees of isolation
     and repeatability across servers.
     .
     Docker is a great building block for automating distributed systems:
     large-scale web deployments, database clusters, continuous deployment systems,
     private PaaS, service-oriented architectures, etc.
     .
     This package contains the daemon and client. Using docker.io on non-amd64 hosts
     is not supported at this time. Please be careful when using it on anything
     besides amd64.
     .
     Also, note that kernel version 3.8 or above is required for proper operation of
     the daemon process, and that any lower versions may have subtle and/or glaring
     issues.
    Built-Using: glibc (= 2.24-3ubuntu1), golang-1.6 (= 1.6.3-1ubuntu1)
    Homepage: https://dockerproject.org
    Original-Maintainer: Paul Tagliamonte <email address hidden>
    ubuntu@ubuntu-yakkety:~$ docker info
    Cannot connect to the Docker daemon. Is the docker daemon running on this host?
    ubuntu@ubuntu-yakkety:~$ sudo docker info
    Containers: 0
     Running: 0
     Paused: 0
     Stopped: 0
    Images: 0
    Server Version: 1.12.1
    Storage Driver: overlay
     Backing Filesystem: extfs
    Logging Driver: json-file
    Cgroup Driver: cgroupfs
    Plugins:
     Volume: local
     Network: host bridge overlay null
    Swarm: inactive
    Runtimes: runc
    Default Runtime: runc
    Security Options: apparmor
    Kernel Version: 4.8.0-26-generic
    Operating System: Ubuntu 16.10
    OSType: linux
    Architecture: x86_64
    CPUs: 2
    Total Memory: 991.7 MiB
    Name: ubuntu-yakkety
    ID: G6JA:MD2U:CD45:5DC3:DFZ3:GUNY:IDH7:HYP5:C4J5:TOSZ:ZFE4:ZK6K
    Docker Root Dir: /var/lib/docker
    Debug Mode (client): false
    Debug Mode (server): false
    Registry: https://index.docker.io/v1/
    WARNING: No swap limit support
    Insecure Registries:
     127.0.0.0/8

Here's what happens if I try to specify a seccomp profile:

    ubuntu@ubuntu-yakkety:~$ curl -L -O https://raw.githubusercontent.com/docker/docker/master/profile...

Read more...

Revision history for this message
Robie Basak (racb) wrote :

Subscribing Jon Grimm. He's the Canonical Server Team manager and can help make sure this doesn't get lost! I'm just drive-by triaging, and this appeared in my triage report as I happen to also be in ~docker-maint.

Revision history for this message
Lizzie Dixon (l-zzie) wrote :

Hello,

Do you have any more information?

Can you confirm whether this has been reproduced?

Do you know whether this is done intentionally?

Could this bug be opened, so I have a place to point others to when it comes up?

information type: Private Security → Public Security
Revision history for this message
Tianon Gravi (tianon) wrote :

This is definitely a real issue, and it wasn't intentional -- I've got a fix in progress, but it needs to happen in both the runc and the docker.io packages.

Changed in docker.io (Ubuntu):
status: New → Confirmed
Changed in runc (Ubuntu):
status: New → Confirmed
Revision history for this message
Lizzie Dixon (l-zzie) wrote :

Thanks for the update!

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package runc - 1.0.0~rc1-0ubuntu2

---------------
runc (1.0.0~rc1-0ubuntu2) zesty; urgency=medium

  [ Tianon Gravi ]
  * Enable seccomp support (LP: #1639407)

 -- Steve Langasek <email address hidden> Wed, 30 Nov 2016 12:31:01 -0800

Changed in runc (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package docker.io - 1.12.3-0ubuntu4

---------------
docker.io (1.12.3-0ubuntu4) zesty; urgency=medium

  * Explicity depend on the version of runc that was built with seccomp
    support.

 -- Michael Hudson-Doyle <email address hidden> Mon, 12 Dec 2016 11:15:01 +1300

Changed in docker.io (Ubuntu):
status: Confirmed → Fix Released
Changed in docker.io (Ubuntu Xenial):
status: New → In Progress
Changed in docker.io (Ubuntu Yakkety):
status: New → In Progress
Changed in runc (Ubuntu Xenial):
status: New → In Progress
Changed in runc (Ubuntu Yakkety):
status: New → In Progress
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Lizzie, or anyone else affected,

Accepted docker.io into yakkety-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/docker.io/1.12.3-0ubuntu4~16.10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in docker.io (Ubuntu Yakkety):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Lizzie, or anyone else affected,

Accepted runc into yakkety-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/runc/1.0.0~rc1-0ubuntu2~16.10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in runc (Ubuntu Yakkety):
status: In Progress → Fix Committed
Revision history for this message
Andy Whitcroft (apw) wrote :

Hello Lizzie, or anyone else affected,

Accepted docker.io into yakkety-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/docker.io/1.12.3-0ubuntu4~16.10.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Revision history for this message
Andy Whitcroft (apw) wrote :

Hello Lizzie, or anyone else affected,

Accepted docker.io into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/docker.io/1.12.3-0ubuntu4~16.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in docker.io (Ubuntu Xenial):
status: In Progress → Fix Committed
Revision history for this message
Andy Whitcroft (apw) wrote :

Hello Lizzie, or anyone else affected,

Accepted runc into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/runc/1.0.0~rc1-0ubuntu2~16.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in runc (Ubuntu Xenial):
status: In Progress → Fix Committed
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

$ docker run -it ubuntu grep Seccomp /proc/self/status
Seccomp: 2

tags: added: verification-done-xenial verification-done-yakkety
removed: verification-needed
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

(I've run this on my xenial system and a yakkety vm)

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package runc - 1.0.0~rc1-0ubuntu2~16.04.1

---------------
runc (1.0.0~rc1-0ubuntu2~16.04.1) xenial; urgency=medium

  * Backport to Xenial. (LP: #1639407)

 -- Michael Hudson-Doyle <email address hidden> Thu, 15 Dec 2016 13:33:42 +1300

Changed in runc (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Chris J Arges (arges) wrote : Update Released

The verification of the Stable Release Update for runc has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package runc - 1.0.0~rc1-0ubuntu2~16.10.1

---------------
runc (1.0.0~rc1-0ubuntu2~16.10.1) yakkety; urgency=medium

  * Backport to Yakkety. (LP: #1639407)

 -- Michael Hudson-Doyle <email address hidden> Thu, 15 Dec 2016 13:33:42 +1300

Changed in runc (Ubuntu Yakkety):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package docker.io - 1.12.3-0ubuntu4~16.10.2

---------------
docker.io (1.12.3-0ubuntu4~16.10.2) yakkety; urgency=medium

  * Update runc dep to account for its backported version.

docker.io (1.12.3-0ubuntu4~16.10.1) yakkety; urgency=medium

  * Backport to Yakkety. (LP: #1647376, #1639407)

 -- Michael Hudson-Doyle <email address hidden> Mon, 19 Dec 2016 09:20:48 +1300

Changed in docker.io (Ubuntu Yakkety):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package docker.io - 1.12.3-0ubuntu4~16.04.2

---------------
docker.io (1.12.3-0ubuntu4~16.04.2) xenial; urgency=medium

  * Update runc dep to account for its backported version.

 -- Michael Hudson-Doyle <email address hidden> Mon, 19 Dec 2016 09:20:48 +1300

Changed in docker.io (Ubuntu Xenial):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.