]> git.ipfire.org Git - thirdparty/lxc.git/log
thirdparty/lxc.git
6 years agoutils: make id switching functions return bool stable-2.0
Christian Brauner [Tue, 9 Apr 2019 17:59:01 +0000 (19:59 +0200)] 
utils: make id switching functions return bool

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoattach: improve id switching
Christian Brauner [Tue, 9 Apr 2019 17:42:43 +0000 (19:42 +0200)] 
attach: improve id switching

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agochange version to 2.0.11 in configure.ac lxc-2.0.11
Stéphane Graber [Mon, 25 Feb 2019 12:29:37 +0000 (13:29 +0100)] 
change version to 2.0.11 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
6 years agoautotools: add memory_utils.h to Makefile.am
Christian Brauner [Thu, 21 Feb 2019 09:18:17 +0000 (10:18 +0100)] 
autotools: add memory_utils.h to Makefile.am

 rexec.c:36:10: fatal error: memory_utils.h: No such file or directory
 #include "memory_utils.h"
           ^~~~~~~~~~~~~~~~
 compilation terminated.
 make[5]: *** [Makefile:1571: rexec.o] Error 1
 make[5]: Leaving directory '/<<BUILDDIR>>/lxc-2.0.10+stable~20190220-1844/src/lxc'
 make[4]: *** [Makefile:448: all-recursive] Error 1
 make[4]: Leaving directory '/<<BUILDDIR>>/lxc-2.0.10+stable~20190220-1844/src'
 make[3]: *** [Makefile:387: all] Error 2
 make[3]: Leaving directory '/<<BUILDDIR>>/lxc-2.0.10+stable~20190220-1844/src'
 make[2]: *** [Makefile:540: all-recursive] Error 1
 make[2]: Leaving directory '/<<BUILDDIR>>/lxc-2.0.10+stable~20190220-1844'
 dh_auto_build: make -j1 returned exit code 2
 make[1]: *** [debian/rules:25: override_dh_auto_build] Error 2
 make[1]: Leaving directory '/<<BUILDDIR>>/lxc-2.0.10+stable~20190220-1844'
 make: *** [debian/rules:14: build] Error 2
 dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoMerge pull request #2870 from brauner/2019-02-20/fix_stable-2.0
Stéphane Graber [Wed, 20 Feb 2019 18:34:11 +0000 (10:34 -0800)] 
Merge pull request #2870 from brauner/2019-02-20/fix_stable-2.0

autotools: handle getgrgid_r on bionic

6 years agoautotools: handle getgrgid_r on bionic 2870/head
Christian Brauner [Wed, 20 Feb 2019 17:38:07 +0000 (18:38 +0100)] 
autotools: handle getgrgid_r on bionic

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agochange version to 2.0.10 in configure.ac lxc-2.0.10
Stéphane Graber [Tue, 19 Feb 2019 18:23:52 +0000 (13:23 -0500)] 
change version to 2.0.10 in configure.ac

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
6 years agocve-2019-5736: add test for rexec
Christian Brauner [Tue, 19 Feb 2019 17:15:31 +0000 (18:15 +0100)] 
cve-2019-5736: add test for rexec

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agorexec: handle legacy kernels
Christian Brauner [Tue, 19 Feb 2019 16:38:42 +0000 (17:38 +0100)] 
rexec: handle legacy kernels

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agofexecve: use correct name
Christian Brauner [Tue, 12 Feb 2019 10:35:49 +0000 (11:35 +0100)] 
fexecve: use correct name

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agofexecve: remove unnecessary #ifdef
Christian Brauner [Tue, 12 Feb 2019 00:52:10 +0000 (01:52 +0100)] 
fexecve: remove unnecessary #ifdef

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoinclude: add fexecve() for Android's Bionic
Christian Brauner [Mon, 11 Feb 2019 13:35:50 +0000 (14:35 +0100)] 
include: add fexecve() for Android's Bionic

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoutils: add missing sealing flags
Christian Brauner [Mon, 11 Feb 2019 13:44:57 +0000 (14:44 +0100)] 
utils: add missing sealing flags

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agorexec: don't include non-existing header
Christian Brauner [Mon, 11 Feb 2019 13:37:33 +0000 (14:37 +0100)] 
rexec: don't include non-existing header

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoCVE-2019-5736 (runC): rexec callers as memfd
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>
6 years agoMerge pull request #2831 from brauner/2019-02-08/capabilities_stable-2.0
Stéphane Graber [Sat, 9 Feb 2019 21:57:15 +0000 (16:57 -0500)] 
Merge pull request #2831 from brauner/2019-02-08/capabilities_stable-2.0

caps: check uid and euid

6 years agocaps: check uid and euid 2831/head
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>
6 years agoFixing hooks functionality Android where 'sh' is placed under /system/bin
ondra [Fri, 11 Jan 2019 16:42:13 +0000 (16:42 +0000)] 
Fixing hooks functionality Android where 'sh' is placed under /system/bin

Signed-off-by: ondra <ondrak@localhost.localdomain>
6 years agoFixing compile error when compiling for android
Ondrej Kubik [Tue, 8 Jan 2019 17:00:36 +0000 (17:00 +0000)] 
Fixing compile error when compiling for android

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
6 years agocommands: backport robust infrastructure
Christian Brauner [Tue, 11 Dec 2018 10:55:25 +0000 (11:55 +0100)] 
commands: backport robust infrastructure

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agostorage: src cannot be truncated
Christian Brauner [Tue, 11 Dec 2018 10:35:12 +0000 (11:35 +0100)] 
storage: src cannot be truncated

s/strlcpy/strncpy/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoattach: report standard shell exit codes
Christian Brauner [Mon, 10 Dec 2018 15:30:46 +0000 (16:30 +0100)] 
attach: report standard shell exit codes

custom backport

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoattach: don't shutdown ipc socket in child
Stephen Barber [Tue, 18 Sep 2018 00:31:22 +0000 (17:31 -0700)] 
attach: don't shutdown ipc socket in child

shutdown() affects sockets even across forked processes. The
attached child process doesn't have any interest in using the
IPC socket, so just close it in the child process and let the
intermediate process handle shutting it down.

This fixes a bug seen with lxc exec in crbug.com/884244

Signed-off-by: Stephen Barber <smbarber@chromium.org>
6 years agoautotools: add --{disable,enable}-thread-safety
Christian Brauner [Wed, 22 Aug 2018 11:13:29 +0000 (13:13 +0200)] 
autotools: add --{disable,enable}-thread-safety

Fail the build if --enable-thread-safety is passed and the environment cannot
guarantee thread-safety.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoCODING_STYLE: Update section header format
Tobin C. Harding [Fri, 17 Aug 2018 04:40:45 +0000 (14:40 +1000)] 
CODING_STYLE: Update section header format

Currently for section headings we use fourth level markdown heading
level (####).  We do not have levels two or three.

We can use standard incremental levels for heading adornments i.e

1) =========
2) ##
3) ###
ect.

Since this document is likely referenced by maintainers when guiding new
contributors it can save maintainer time to be able to quickly reference
a section in the coding stlye guide.  If we add numbers to each heading
(like the kernel stlye guide) then maintainers can say:

   Nice patch, please see section 3 of the coding style guide and ...

So, this patch makes two changes

- Use incremental level heading adornments
- Add a number to each section heading

Signed-off-by: Tobin C. Harding <me@tobin.cc>
6 years agoCODING_STYLE: Fix non-uniform heading level
Tobin C. Harding [Fri, 17 Aug 2018 04:07:48 +0000 (14:07 +1000)] 
CODING_STYLE: Fix non-uniform heading level

Heading uses only 3 level header (###) but the rest of the file uses
four (####).  We should be uniform.

Use uniform heading level in line with the rest of the file.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
6 years agoCODING_STLYE: Remove sections implied by 'kernel style'
Tobin C. Harding [Fri, 17 Aug 2018 03:55:47 +0000 (13:55 +1000)] 
CODING_STLYE: Remove sections implied by 'kernel style'

We explicitly state that LXC uses coding style based on Linux kernel
style.  It is redundant to then document obvious, and well known, kernel
style rules.  Identifier names certainly fall into this category as does
usage of braces.

Remove sections implied by 'kernel style'.  Naming conventions and brace
placement conventions.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
6 years agoCODING_STLYE: Simplify explanation for use of 'extern'
Tobin C. Harding [Thu, 16 Aug 2018 23:38:48 +0000 (09:38 +1000)] 
CODING_STLYE: Simplify explanation for use of 'extern'

Current explanation of rules around usage of 'extern' are overly
verbose.  It is not necessary to state that functions should be declared
in header files, the compiler already enforces this.  These rules are
simple, they are better described with simple statements.  An example is
not necessary for such simple rules and serves only to make the document
longer.

Use two simple statements describing the rules that govern function
declaration and the usage of the 'extern' keyword.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
6 years agoCONTRIBUTING: Add 'be' to fix grammar
Tobin C. Harding [Thu, 16 Aug 2018 23:22:40 +0000 (09:22 +1000)] 
CONTRIBUTING: Add 'be' to fix grammar

Fix minor grammatical issue.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
6 years agoCODING_STYLE: Mention kernel style in introduction
Tobin C. Harding [Fri, 17 Aug 2018 03:46:16 +0000 (13:46 +1000)] 
CODING_STYLE: Mention kernel style in introduction

Currently the coding style guide does not mention that we use kernel
coding style as a base style for LXC.  We have just linked to
CODING_STLYE.md from CONTRIBUTING (which mentions use of kernel coding
style).  We can increase documentation congruence and completeness by
mentioning kernel coding style guide in the introduction to our style
guide.

Add heading and introduction to coding style guide informing readers
that we follow kernel coding style as a base before explaining our style
additions.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
6 years agoCONTRIBUTING: Direct readers to CODING_STYLE.md
Tobin C. Harding [Thu, 16 Aug 2018 23:19:32 +0000 (09:19 +1000)] 
CONTRIBUTING: Direct readers to CODING_STYLE.md

Currently the 'Coding Style' section mentions only the kernel coding
style.  We have additions on top on this outlined in CODING_STYLE.md.
We should direct readers to this document as well as the kernel docs.

Direct readers to CODING_STLYE.md in the 'Coding Style' section.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
6 years agoCONTRIBUTING: Link to latest online kernel docs
Tobin C. Harding [Fri, 17 Aug 2018 04:29:15 +0000 (14:29 +1000)] 
CONTRIBUTING: Link to latest online kernel docs

Currently we link to a URL for v4.10 of the kernel docs.  Since we
already mention the kernel tree we should link to the _latest_ kernel
docs online instead of a fixed past version.

Link to latest online kernel docs tracking the mainline instead of past
fixed version.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
6 years agoCONTRIBUTING: Update reference to kernel coding style
Tobin C. Harding [Fri, 17 Aug 2018 04:16:47 +0000 (14:16 +1000)] 
CONTRIBUTING: Update reference to kernel coding style

Kernel coding style guide filename is stale, this file has been renamed
in the kernel tree.  While this file still exists we should use the new
filename.

Update reference to kernel coding style guide to use the new file name.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
6 years agoMAINTAINERS: add Wolfgang Bumiller
Christian Brauner [Tue, 7 Aug 2018 13:01:19 +0000 (15:01 +0200)] 
MAINTAINERS: add Wolfgang Bumiller

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoREADEM: update Serge's mail address
Christian Brauner [Tue, 31 Jul 2018 11:52:12 +0000 (13:52 +0200)] 
READEM: update Serge's mail address

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Serge Hallyn <serge@hallyn.com>
6 years agocoverity: #438136
Christian Brauner [Tue, 31 Jul 2018 08:55:52 +0000 (10:55 +0200)] 
coverity: #438136

String not null terminated

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocaps: handle EINTR in read()
Christian Brauner [Sun, 29 Jul 2018 21:57:30 +0000 (23:57 +0200)] 
caps: handle EINTR in read()

We don't want to link caps.{c,h} against utils.{c,h} for the sake of our static
builds init.lxc.static. This means lxc_write_nointr() will not be available. So
handle it EINTR.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolog: handle EINTR in read()
Christian Brauner [Sun, 29 Jul 2018 21:54:32 +0000 (23:54 +0200)] 
log: handle EINTR in read()

We don't want to link log.{c,h} against utils.{c,h} for the sake of our static
builds init.lxc.static. This means lxc_write_nointr() will not be available. So
handle it EINTR.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agosync: s/write()/lxc_write_nointr()/g
Christian Brauner [Sun, 29 Jul 2018 21:51:02 +0000 (23:51 +0200)] 
sync: s/write()/lxc_write_nointr()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agosync: s/read()/lxc_read_nointr()/g
Christian Brauner [Sun, 29 Jul 2018 21:50:51 +0000 (23:50 +0200)] 
sync: s/read()/lxc_read_nointr()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agonetwork: s/write()/lxc_write_nointr()/g
Christian Brauner [Sun, 29 Jul 2018 21:49:32 +0000 (23:49 +0200)] 
network: s/write()/lxc_write_nointr()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agonetwork: s/read()/lxc_read_nointr()/g
Christian Brauner [Sun, 29 Jul 2018 21:49:05 +0000 (23:49 +0200)] 
network: s/read()/lxc_read_nointr()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: s/read()/lxc_read_nointr()/g
Christian Brauner [Sun, 29 Jul 2018 21:48:28 +0000 (23:48 +0200)] 
lxccontainer: s/read()/lxc_read_nointr()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: s/write()/lxc_write_nointr()/g
Christian Brauner [Sun, 29 Jul 2018 21:47:57 +0000 (23:47 +0200)] 
lxccontainer: s/write()/lxc_write_nointr()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocriu: s/write()/lxc_write_nointr()/g
Christian Brauner [Sun, 29 Jul 2018 21:47:15 +0000 (23:47 +0200)] 
criu: s/write()/lxc_write_nointr()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocriu: s/read()/lxc_read_nointr()/g
Christian Brauner [Sun, 29 Jul 2018 21:46:54 +0000 (23:46 +0200)] 
criu: s/read()/lxc_read_nointr()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocmd: s/read()/lxc_read_nointr()/g
Christian Brauner [Sun, 29 Jul 2018 21:45:51 +0000 (23:45 +0200)] 
cmd: s/read()/lxc_read_nointr()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocmd: s/write()/lxc_write_nointr()/g
Christian Brauner [Sun, 29 Jul 2018 21:45:18 +0000 (23:45 +0200)] 
cmd: s/write()/lxc_write_nointr()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocmd: s/pipe()/pipe2()/g
Christian Brauner [Sun, 29 Jul 2018 20:59:37 +0000 (22:59 +0200)] 
cmd: s/pipe()/pipe2()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: s/pipe()/pipe2()/g
Christian Brauner [Sun, 29 Jul 2018 21:09:45 +0000 (23:09 +0200)] 
lxccontainer: s/pipe()/pipe2()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxccontainer: cleanup do_lxcapi_get_interfaces()
Christian Brauner [Sun, 29 Jul 2018 21:09:13 +0000 (23:09 +0200)] 
lxccontainer: cleanup do_lxcapi_get_interfaces()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocriu: s/pipe()/pipe2()/
Christian Brauner [Sun, 29 Jul 2018 21:07:33 +0000 (23:07 +0200)] 
criu: s/pipe()/pipe2()/

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: always close pipe in run_userns_fn()
Christian Brauner [Sun, 29 Jul 2018 21:03:32 +0000 (23:03 +0200)] 
conf: always close pipe in run_userns_fn()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoconf: s/pipe()/pipe2()/g
Christian Brauner [Sun, 29 Jul 2018 21:02:14 +0000 (23:02 +0200)] 
conf: s/pipe()/pipe2()/g

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agonl: avoid NULL pointer dereference
Rafał Miłecki [Sun, 29 Jul 2018 15:44:06 +0000 (17:44 +0200)] 
nl: avoid NULL pointer dereference

It's a valid case to call nla_put() with NULL data and 0 len. It's done e.g. in
the nla_put_attr().

There has to be a check for data in nla_put() as passing NULL to the memcpy()
is not allowed. Even if length is 0, both pointers have to be valid.

For a reference see C99 standard (7.21.1/2), it says: "pointer arguments on
such a call shall still have valid values".

Reported-by: Daniel Gimpelevich <daniel@gimpelevich.san-francisco.ca.us>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
[christian.brauner@ubuntu.com: adapted commit message]
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agochange log macro of error case from lxc_ambient_caps_up/down
2xsec [Sun, 22 Jul 2018 12:03:46 +0000 (21:03 +0900)] 
change log macro of error case from lxc_ambient_caps_up/down

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
6 years agocoverity: #1438067
2xsec [Sat, 21 Jul 2018 13:47:08 +0000 (22:47 +0900)] 
coverity: #1438067

Explicit null dereferenced

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
6 years agoconf: the atime flags are locked in userns
Christian Brauner [Wed, 18 Jul 2018 16:09:21 +0000 (18:09 +0200)] 
conf: the atime flags are locked in userns

This means they need to be added for remount and for fresh mounts.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolxclock: change error log using strerror to SYSERROR
2xsec [Fri, 13 Jul 2018 12:33:09 +0000 (21:33 +0900)] 
lxclock: change error log using strerror to SYSERROR

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
6 years agocoverity: #1437935
Christian Brauner [Thu, 12 Jul 2018 15:52:09 +0000 (17:52 +0200)] 
coverity: #1437935

Unchecked return value

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1437936
Christian Brauner [Thu, 12 Jul 2018 15:49:30 +0000 (17:49 +0200)] 
coverity: #1437936

Unchecked return value

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoattach: simplify lxc_attach_getpwshell()
Christian Brauner [Wed, 11 Jul 2018 21:12:04 +0000 (23:12 +0200)] 
attach: simplify lxc_attach_getpwshell()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolog: thread-safety backports
Christian Brauner [Mon, 10 Dec 2018 14:14:07 +0000 (15:14 +0100)] 
log: thread-safety backports

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agostart: don't unconditionally open("/dev/null")
Christian Brauner [Mon, 9 Jul 2018 12:28:57 +0000 (14:28 +0200)] 
start: don't unconditionally open("/dev/null")

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1425816
2xsec [Mon, 2 Jul 2018 11:37:36 +0000 (20:37 +0900)] 
coverity: #1425816

Explicit null dereferenced

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
6 years agoCODING_STYLE: add section about using strlcat()
Christian Brauner [Sat, 30 Jun 2018 09:41:23 +0000 (11:41 +0200)] 
CODING_STYLE: add section about using strlcat()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolog: account for Android's Bionic's strerror_r()
Christian Brauner [Tue, 26 Jun 2018 09:25:37 +0000 (11:25 +0200)] 
log: account for Android's Bionic's strerror_r()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agolog: add lxc_log_strerror_r macro
2xsec [Mon, 25 Jun 2018 13:00:43 +0000 (22:00 +0900)] 
log: add lxc_log_strerror_r macro

Let's ensure that we always use the thread-safe strerror_r() function and add
an approriate macro.
Additionally, define SYS*() macros for all log levels. They will use the new
macro and ensure thread-safe retrieval of errno values.

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
[christian.brauner@ubuntu.com: simplify lxc_log_strerror_r macro]
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agomove some comments in lxc.spec.in
2xsec [Mon, 25 Jun 2018 04:26:39 +0000 (13:26 +0900)] 
move some comments in lxc.spec.in

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
6 years agomonitor: change exit() => _exit() system call in child process
2xsec [Fri, 22 Jun 2018 13:42:32 +0000 (22:42 +0900)] 
monitor: change exit() => _exit() system call in child process

Signed-off-by: 2xsec <dh48.jeong@samsung.com>
6 years agocommands: simplify lxc_cmd()
Christian Brauner [Fri, 22 Jun 2018 12:13:06 +0000 (14:13 +0200)] 
commands: simplify lxc_cmd()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agofix pointer c is dereferenced after checking null
Donghwa Jeong [Tue, 19 Jun 2018 01:37:47 +0000 (10:37 +0900)] 
fix pointer c is dereferenced after checking null

Signed-off-by: Donghwa Jeong <dh48.jeong@samsung.com>
6 years agofix fd handle leak
Donghwa Jeong [Tue, 19 Jun 2018 01:27:33 +0000 (10:27 +0900)] 
fix fd handle leak

Signed-off-by: Donghwa Jeong <dh48.jeong@samsung.com>
6 years agosecure coding: #2 strcpy => strlcpy
Donghwa Jeong [Mon, 18 Jun 2018 08:18:14 +0000 (17:18 +0900)] 
secure coding: #2 strcpy => strlcpy

Signed-off-by: Donghwa Jeong <dh48.jeong@samsung.com>
6 years agobtrfs: fix get_btrfs_subvol_path()
Christian Brauner [Mon, 10 Dec 2018 13:22:04 +0000 (14:22 +0100)] 
btrfs: fix get_btrfs_subvol_path()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoinclude: add strlcat() implementation
Christian Brauner [Wed, 20 Jun 2018 11:44:02 +0000 (13:44 +0200)] 
include: add strlcat() implementation

CC: Donghwa Jeong <dh48.jeong@samsung.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agobtrfs: fix btrfs_snapshot()
Christian Brauner [Mon, 10 Dec 2018 13:15:01 +0000 (14:15 +0100)] 
btrfs: fix btrfs_snapshot()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agosecure coding: network: strcpy => strlcpy
Donghwa Jeong [Mon, 18 Jun 2018 04:42:48 +0000 (13:42 +0900)] 
secure coding: network: strcpy => strlcpy

Signed-off-by: Donghwa Jeong <dh48.jeong@samsung.com>
6 years agosecure coding: strcpy => strlcpy
Donghwa Jeong [Mon, 18 Jun 2018 02:30:41 +0000 (11:30 +0900)] 
secure coding: strcpy => strlcpy

Signed-off-by: Donghwa Jeong <dh48.jeong@samsung.com>
6 years agocoverity: #1437027
Christian Brauner [Fri, 15 Jun 2018 11:37:47 +0000 (13:37 +0200)] 
coverity: #1437027

Read from pointer after free

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1425855
Christian Brauner [Fri, 15 Jun 2018 11:36:37 +0000 (13:36 +0200)] 
coverity: #1425855

String not null terminated

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1425789
Christian Brauner [Fri, 15 Jun 2018 11:35:09 +0000 (13:35 +0200)] 
coverity: #1425789

Unchecked return value from library

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1425846
Christian Brauner [Fri, 15 Jun 2018 10:56:19 +0000 (12:56 +0200)] 
coverity: #1425846

Unchecked return value

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1425840
Christian Brauner [Fri, 15 Jun 2018 10:55:06 +0000 (12:55 +0200)] 
coverity: #1425840

Unchecked return value

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1425837
Christian Brauner [Fri, 15 Jun 2018 10:50:47 +0000 (12:50 +0200)] 
coverity: #1425837

String not null terminated

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1425825
Christian Brauner [Fri, 15 Jun 2018 10:43:48 +0000 (12:43 +0200)] 
coverity: #1425825

Unchecked return value

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1425824
Christian Brauner [Fri, 15 Jun 2018 10:41:09 +0000 (12:41 +0200)] 
coverity: #1425824

Missing break in switch

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1425819
Christian Brauner [Fri, 15 Jun 2018 09:54:14 +0000 (11:54 +0200)] 
coverity: #1425819

Resource leak

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1425818
Christian Brauner [Fri, 15 Jun 2018 09:52:04 +0000 (11:52 +0200)] 
coverity: #1425818

Dereference after null check

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1425813
Christian Brauner [Fri, 15 Jun 2018 09:49:10 +0000 (11:49 +0200)] 
coverity: #1425813

Resource leak

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1425810
Christian Brauner [Fri, 15 Jun 2018 09:47:31 +0000 (11:47 +0200)] 
coverity: #1425810

Explicit null dereferenced

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1425799
Christian Brauner [Fri, 15 Jun 2018 09:43:15 +0000 (11:43 +0200)] 
coverity: #1425799

Logically dead code

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1425793
Christian Brauner [Fri, 15 Jun 2018 09:42:18 +0000 (11:42 +0200)] 
coverity: #1425793

Unchecked return value

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1425792
Christian Brauner [Fri, 15 Jun 2018 09:40:53 +0000 (11:40 +0200)] 
coverity: #1425792

Insecure temporary file

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1425789
Christian Brauner [Fri, 15 Jun 2018 09:37:11 +0000 (11:37 +0200)] 
coverity: #1425789

Unchecked return value from library

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1425771
Christian Brauner [Fri, 15 Jun 2018 09:35:10 +0000 (11:35 +0200)] 
coverity: #1425771

Insecure temporary file

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agocoverity: #1425770
Christian Brauner [Fri, 15 Jun 2018 09:33:34 +0000 (11:33 +0200)] 
coverity: #1425770

Insecure temporary file

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agoinclude: add getgrgid_r()
Christian Brauner [Thu, 14 Jun 2018 22:17:01 +0000 (00:17 +0200)] 
include: add getgrgid_r()

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
6 years agostorage: Resource leak
Donghwa Jeong [Fri, 15 Jun 2018 02:11:48 +0000 (11:11 +0900)] 
storage: Resource leak

Signed-off-by: Donghwa Jeong <dh48.jeong@samsung.com>
6 years agocoverity: #1425768
Christian Brauner [Thu, 14 Jun 2018 20:17:08 +0000 (22:17 +0200)] 
coverity: #1425768

Untrusted array index read

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>