]>
git.ipfire.org Git - thirdparty/lxc.git/log
Christian Brauner [Sat, 26 Jan 2019 00:19:29 +0000 (01:19 +0100)]
CVE-2019-5736 (runC): rexec callers as memfd
Adam Iwaniuk and Borys Popławski discovered that an attacker can compromise the
runC host binary from inside a privileged runC container. As a result, this
could be exploited to gain root access on the host. runC is used as the default
runtime for containers with Docker, containerd, Podman, and CRI-O.
The attack can be made when attaching to a running container or when starting a
container running a specially crafted image. For example, when runC attaches
to a container the attacker can trick it into executing itself. This could be
done by replacing the target binary inside the container with a custom binary
pointing back at the runC binary itself. As an example, if the target binary
was /bin/bash, this could be replaced with an executable script specifying the
interpreter path #!/proc/self/exe (/proc/self/exec is a symbolic link created
by the kernel for every process which points to the binary that was executed
for that process). As such when /bin/bash is executed inside the container,
instead the target of /proc/self/exe will be executed - which will point to the
runc binary on the host. The attacker can then proceed to write to the target
of /proc/self/exe to try and overwrite the runC binary on the host. However in
general, this will not succeed as the kernel will not permit it to be
overwritten whilst runC is executing. To overcome this, the attacker can
instead open a file descriptor to /proc/self/exe using the O_PATH flag and then
proceed to reopen the binary as O_WRONLY through /proc/self/fd/<nr> and try to
write to it in a busy loop from a separate process. Ultimately it will succeed
when the runC binary exits. After this the runC binary is compromised and can
be used to attack other containers or the host itself.
This attack is only possible with privileged containers since it requires root
privilege on the host to overwrite the runC binary. Unprivileged containers
with a non-identity ID mapping do not have the permission to write to the host
binary and therefore are unaffected by this attack.
LXC is also impacted in a similar manner by this vulnerability, however as the
LXC project considers privileged containers to be unsafe no CVE has been
assigned for this issue for LXC. Quoting from the
https://linuxcontainers.org/lxc/security/ project's Security information page:
"As privileged containers are considered unsafe, we typically will not consider
new container escape exploits to be security issues worthy of a CVE and quick
fix. We will however try to mitigate those issues so that accidental damage to
the host is prevented."
To prevent this attack, LXC has been patched to create a temporary copy of the
calling binary itself when it starts or attaches to containers. To do this LXC
creates an anonymous, in-memory file using the memfd_create() system call and
copies itself into the temporary in-memory file, which is then sealed to
prevent further modifications. LXC then executes this sealed, in-memory file
instead of the original on-disk binary. Any compromising write operations from
a privileged container to the host LXC binary will then write to the temporary
in-memory binary and not to the host binary on-disk, preserving the integrity
of the host LXC binary. Also as the temporary, in-memory LXC binary is sealed,
writes to this will also fail.
Note: memfd_create() was added to the Linux kernel in the 3.17 release.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Co-Developed-by: Aleksa Sarai <asarai@suse.de>
Acked-by: Serge Hallyn <serge@hallyn.com>
Stéphane Graber [Sat, 9 Feb 2019 21:57:20 +0000 (16:57 -0500)]
Merge pull request #2830 from brauner/2019-02-08/capabilities_stable-3.0
caps: check uid and euid
Christian Brauner [Fri, 8 Feb 2019 14:11:46 +0000 (15:11 +0100)]
caps: check uid and euid
When we are running inside of a user namespace getuid() will return a
non-zero uid. So let's check euid as well to make sure we correctly drop
capabilities
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Stéphane Graber [Mon, 7 Jan 2019 23:33:26 +0000 (00:33 +0100)]
Merge pull request #2772 from brauner/2018-01-09/fix_cgroup_deletion_stable-3.0
cgfsng: do not free container_full_path on error
Christian Brauner [Mon, 7 Jan 2019 15:10:44 +0000 (16:10 +0100)]
cgfsng: do not free container_full_path on error
Closes #2741.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Mon, 17 Dec 2018 11:06:57 +0000 (12:06 +0100)]
Merge pull request #2758 from Blub/2018-12-17/stable-3.0/apparmor-bind-remount
apparmor: allow various remount,bind options
Wolfgang Bumiller [Thu, 15 Nov 2018 10:51:34 +0000 (11:51 +0100)]
apparmor: allow various remount,bind options
RW bind mounts need to be restricted for some paths in
order to avoid MAC restriction bypasses, but read-only bind
mounts shouldn't have that problem.
Additionally, combinations of 'nosuid', 'nodev' and
'noexec' flags shouldn't be a problem either and are
required with newer systemd versions, so let's allow those
as long as they're combined with 'ro,remount,bind'.
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
(cherry picked from commit
e6ec0a9e71aa68c9fd67c691a62aaae87e356cef )
Stéphane Graber [Thu, 22 Nov 2018 23:07:50 +0000 (18:07 -0500)]
Release LXC 3.0.3
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Stéphane Graber [Thu, 22 Nov 2018 22:36:39 +0000 (17:36 -0500)]
Merge pull request #2735 from brauner/lxc/stable-3.0
start: don't call cgroup_exit() twice
Christian Brauner [Thu, 22 Nov 2018 22:19:09 +0000 (23:19 +0100)]
start: don't call cgroup_exit() twice
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Tue, 20 Nov 2018 17:06:43 +0000 (18:06 +0100)]
cgfsng: remove freezer requirement
The freezer controller has been made optional in all other codepaths so
don't require it.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Radostin Stoyanov [Tue, 20 Nov 2018 01:10:57 +0000 (01:10 +0000)]
autotools: fix lxc-{create,copy} build
After commit
2b670df lxc-create and lxc-copy fails with "undefined
symbol: get_fssize".
Closes #2730
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
Christian Brauner [Mon, 19 Nov 2018 02:26:58 +0000 (03:26 +0100)]
utils: make keyring allocation failure non-fatal
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
tomponline [Wed, 14 Nov 2018 13:55:18 +0000 (13:55 +0000)]
Adds -qq flags to lvcreate commands to avoid answer 'no' to ant questions the LVM subsystem asks to avoid hanging lxc-create command
Signed-off-by: tomponline <tomp@tomp.uk>
2xsec [Fri, 9 Nov 2018 07:10:15 +0000 (16:10 +0900)]
utils: add errno logs for exception case
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2xsec [Fri, 9 Nov 2018 07:08:37 +0000 (16:08 +0900)]
utils: fix coding styles
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2xsec [Fri, 9 Nov 2018 07:06:33 +0000 (16:06 +0900)]
pam_cgfs: remove dependency from cap & log
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2xsec [Fri, 9 Nov 2018 05:10:46 +0000 (14:10 +0900)]
cgfs: remove redundancy utils
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2xsec [Fri, 9 Nov 2018 04:43:41 +0000 (13:43 +0900)]
pam_cgfs: remove redundancy file utils
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
Christian Brauner [Thu, 8 Nov 2018 17:55:16 +0000 (18:55 +0100)]
conf: s/ty/tty/g
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2xsec [Thu, 8 Nov 2018 10:18:41 +0000 (19:18 +0900)]
dlog: move match_dlog_fds()
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2xsec [Thu, 8 Nov 2018 10:01:03 +0000 (19:01 +0900)]
log: replace write with lxc_write_nointr
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2xsec [Thu, 8 Nov 2018 10:00:19 +0000 (19:00 +0900)]
caps: replace read with lxc_read_nointr
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
Jungsub [Tue, 6 Nov 2018 14:25:11 +0000 (14:25 +0000)]
Fix spacing error in namespace.c
Signed-off-by: Jungsub Shin supsup5642@tmax.co.kr
Christian Brauner [Fri, 2 Nov 2018 22:20:46 +0000 (23:20 +0100)]
include: correctly include macro.h
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Fri, 2 Nov 2018 11:35:08 +0000 (12:35 +0100)]
coverity: move to separate branch
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2xsec [Fri, 2 Nov 2018 06:25:14 +0000 (15:25 +0900)]
log: fix too wide or inconsistent non-owner permissions
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2xsec [Fri, 2 Nov 2018 06:17:50 +0000 (15:17 +0900)]
string_utils: coding rules
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2xsec [Fri, 2 Nov 2018 06:17:14 +0000 (15:17 +0900)]
lxcmntent: coding rules
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
Josh Soref [Tue, 30 Oct 2018 08:26:30 +0000 (08:26 +0000)]
spelling: without
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 08:19:23 +0000 (08:19 +0000)]
spelling: userns
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 08:24:51 +0000 (08:24 +0000)]
spelling: unsigned
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 08:14:58 +0000 (08:14 +0000)]
spelling: timeout
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 08:12:17 +0000 (08:12 +0000)]
spelling: syscall
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 08:12:07 +0000 (08:12 +0000)]
spelling: successfully
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 08:11:56 +0000 (08:11 +0000)]
spelling: subtracting
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 08:09:44 +0000 (08:09 +0000)]
spelling: specify
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 08:09:37 +0000 (08:09 +0000)]
spelling: specified
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 08:09:19 +0000 (08:09 +0000)]
spelling: snapshotting
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 08:03:58 +0000 (08:03 +0000)]
spelling: securityfs
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:59:43 +0000 (07:59 +0000)]
spelling: root
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 08:02:42 +0000 (08:02 +0000)]
spelling: returns
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:56:15 +0000 (07:56 +0000)]
spelling: potentially
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:48:55 +0000 (07:48 +0000)]
spelling: portion
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:47:48 +0000 (07:47 +0000)]
spelling: pertains
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:47:17 +0000 (07:47 +0000)]
spelling: perhaps
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:45:15 +0000 (07:45 +0000)]
spelling: passphrase
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:44:56 +0000 (07:44 +0000)]
spelling: override
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:37:31 +0000 (07:37 +0000)]
spelling: overridden
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:37:13 +0000 (07:37 +0000)]
spelling: overlayfs
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:36:14 +0000 (07:36 +0000)]
spelling: output
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:35:39 +0000 (07:35 +0000)]
spelling: otherwise
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:26:07 +0000 (07:26 +0000)]
spelling: namespace
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:18:45 +0000 (07:18 +0000)]
spelling: loglevel
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:18:08 +0000 (07:18 +0000)]
spelling: libraries
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:17:22 +0000 (07:17 +0000)]
spelling: keepdata
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:16:39 +0000 (07:16 +0000)]
spelling: javascript
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:13:17 +0000 (07:13 +0000)]
spelling: initialize
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:12:26 +0000 (07:12 +0000)]
spelling: inherited
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:11:52 +0000 (07:11 +0000)]
spelling: implementations
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:11:19 +0000 (07:11 +0000)]
spelling: ifindices
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:09:02 +0000 (07:09 +0000)]
spelling: hoops
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:08:31 +0000 (07:08 +0000)]
spelling: hierarchy
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 17:13:36 +0000 (13:13 -0400)]
spelling: github
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:01:50 +0000 (07:01 +0000)]
spelling: feature
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:01:26 +0000 (07:01 +0000)]
spelling: explicitly
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:01:12 +0000 (07:01 +0000)]
spelling: exiting
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 07:00:01 +0000 (07:00 +0000)]
spelling: device
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 06:59:37 +0000 (06:59 +0000)]
spelling: describing
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 06:54:56 +0000 (06:54 +0000)]
spelling: could
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 06:55:05 +0000 (06:55 +0000)]
spelling: convenience
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 06:54:21 +0000 (06:54 +0000)]
spelling: control
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 06:53:11 +0000 (06:53 +0000)]
spelling: container
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 06:54:44 +0000 (06:54 +0000)]
spelling: constant
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 06:52:44 +0000 (06:52 +0000)]
spelling: configuration
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 06:52:23 +0000 (06:52 +0000)]
spelling: committer
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 06:52:09 +0000 (06:52 +0000)]
spelling: command
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 06:51:58 +0000 (06:51 +0000)]
spelling: comma
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 06:50:25 +0000 (06:50 +0000)]
spelling: checkpoint
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 06:50:12 +0000 (06:50 +0000)]
spelling: character
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 06:49:52 +0000 (06:49 +0000)]
spelling: capabilities
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 06:49:12 +0000 (06:49 +0000)]
spelling: backingstorage
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 06:48:09 +0000 (06:48 +0000)]
spelling: asynchronous
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 06:47:57 +0000 (06:47 +0000)]
spelling: array
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 06:47:09 +0000 (06:47 +0000)]
spelling: architecture
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 06:46:40 +0000 (06:46 +0000)]
spelling: answer
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 06:45:53 +0000 (06:45 +0000)]
spelling: ambiguous
Signed-off-by: Josh Soref <jsoref@gmail.com>
Josh Soref [Tue, 30 Oct 2018 06:45:18 +0000 (06:45 +0000)]
spelling: allocate
Signed-off-by: Josh Soref <jsoref@gmail.com>
2xsec [Tue, 23 Oct 2018 10:13:27 +0000 (19:13 +0900)]
dlog: inherit dlog fds
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2xsec [Tue, 23 Oct 2018 06:20:24 +0000 (15:20 +0900)]
parse: cleanups
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2xsec [Tue, 23 Oct 2018 02:38:29 +0000 (11:38 +0900)]
storage_utils: use _exit() instead of exit() in child process
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2xsec [Tue, 23 Oct 2018 02:33:45 +0000 (11:33 +0900)]
storage_utils: cleanups
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2xsec [Tue, 23 Oct 2018 02:30:12 +0000 (11:30 +0900)]
storage_utils: add error handling
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
Christian Brauner [Sat, 20 Oct 2018 10:04:33 +0000 (12:04 +0200)]
coverity: #
1426130
Bad bit shift operation
Fixes: commit b5b12b9e759 ("criu: add feature check capability")
Cc: Adrian Reber <areber@redhat.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sat, 20 Oct 2018 09:59:48 +0000 (11:59 +0200)]
coverity: #
1440389
Logically dead code
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sat, 20 Oct 2018 09:57:02 +0000 (11:57 +0200)]
coverity: #
1440391
Dereference null return value
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sat, 20 Oct 2018 09:49:47 +0000 (11:49 +0200)]
cmd/lxc_init: do not hide global variable
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sat, 20 Oct 2018 09:48:06 +0000 (11:48 +0200)]
tools/lxc_stop: use correct check
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sat, 20 Oct 2018 09:39:28 +0000 (11:39 +0200)]
start: prevent values smaller 0
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Christian Brauner [Sat, 20 Oct 2018 09:37:39 +0000 (11:37 +0200)]
lxccontainer: remove check from goto target
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>