Commit Graph

386 Commits

Author SHA1 Message Date
Christian Brauner
2268c27754
autotools: compiler based hardening
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-10-20 00:22:18 +02:00
Christian Brauner
a3bb6b8ed9
autools: use -fno-strict-aliasing
The gcc implementation and the C standard are not to be considered sane
in this respect. We don't want to risk reordering of writes when the
compiler incorrectly *thinks* two types do not alias each other.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-10-12 21:23:07 +02:00
Christian Brauner
da5efb6f76
netns_ifaddrs: handle IFLA_STATS{64} correctly
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-30 12:29:19 +02:00
Christian Brauner
e6fe24e134
autotools: support -z relro and -z now
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-28 22:58:20 +02:00
Christian Brauner
b25291da14
utils: add lxc_setup_keyring()
Allocate a new keyring if we can to prevent information leak.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-28 13:41:14 +02:00
Christian Brauner
c73fbad129
configure: fix -Wimplicit-fallthrough check
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-28 13:41:14 +02:00
Stéphane Graber
810fd51c92
Merge pull request #2618 from CameronNemo/lxcmountroot
apparmor: account for specified rootfs path (closes #2617)
2018-09-25 14:46:21 -04:00
Christian Brauner
246736be38
autotools: support -Wstrict-prototypes
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-23 20:22:41 +02:00
Christian Brauner
6ce39620fd
autotools: support -Wcast-align
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-23 20:22:41 +02:00
Christian Brauner
23b44c365e
autotools: fix wrong AX_CHECK_COMPILE_FLAG test
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-21 23:45:33 +02:00
Christian Brauner
292b3910d5
cgroups: switch to lxc.payload as default pattern
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-21 16:47:03 +02:00
Christian Brauner
cf0fd972be
autotools: add -Wimplicit-fallthrough
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-09-21 15:24:14 +02:00
Cameron Nemo
b19c5d1237 apparmor: account for specified rootfs path (closes #2617)
Signed-off-by: Cameron Nemo <camerontnorman@gmail.com>
2018-09-20 15:56:05 -07:00
2xsec
5c7bfc0231
log: support dlog
Signed-off-by: 2xsec <dh48.jeong@samsung.com>
2018-09-11 16:04:25 +09:00
Fabrice Fontaine
218e814412 lxc: fix build with --disable-werror
Fix #2592 by defining -Wvla -std=gnu11 even if --disable-werror is set
As -std=gnu11 is always set, bump requirement on gcc from 4.6 to 4.7
(see https://gcc.gnu.org/projects/cxx-status.html#cxx11)

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2018-09-08 21:09:20 +02:00
Christian Brauner
8bc781b419
configure: reorder header checks
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-08-28 20:10:46 +02:00
Christian Brauner
d029e1defd
Makefile: conditionalize ifaddrs.h inclusion
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-08-23 14:06:54 +02:00
Christian Brauner
81c76cff14
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>
2018-08-22 13:41:43 +02:00
Christian Brauner
607e3fcae1
log: handle strerror_r() versions
Closes #2563.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-08-22 13:41:41 +02:00
Christian Brauner
9b5724cd58
autotools: check if compiler is new enough
We line up with the Linux kernel and won't support any compiler under 4.6.
Additionally, we also require at least gnu99 so this is due anyway.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-08-22 00:04:19 +02:00
Christian Brauner
81a56e8029
autotools: default to -Wvla -std=gnu11
We can't really support anything less than gcc-4.8 anyway.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-07-26 16:38:42 +02:00
Wolfgang Bumiller
1800f92473 apparmor: profile generation
This copies lxd's apparmor profile generation. This tries to
detect features such as cgroup namespaces, apparmor
namespaces and stacking support, and has profile parts
conditionally for unprivileged containers.

This introduces the following changes to the configuration:
  lxc.apparmor.profile = generated
    The fixed value 'generated' will cause this
    functionality to be used, otherwise there should be no
    functional changes happening unless specifically
    requested with the next key:
  lxc.apparmor.allow_nesting
    This is a boolean which, if enabled, causes the
    following changes: When generated apparmor profiles are
    used, they will contain the necessary changes to allow
    creating a nested container. In addition to the usual
    mount points, /dev/.lxc/proc and /dev/.lxc/sys will
    contain procfs and sysfs mount points without the lxcfs
    overlays, which, if generated apparmor profiles are
    being used, will not be read/writable directly.
  lxc.apparmor.raw
    A list of raw apparmor profile lines to append to the
    profile. Only valid when using generated profiles.

The following apparmor profile lines have not been copied
from lxd:

  mount /var/lib/lxd/shmounts/ -> /var/lib/lxd/shmounts/,
  mount none -> /var/lib/lxd/shmounts/,
  mount options=bind /var/lib/lxd/shmounts/** -> /var/lib/lxd/**,

They should be added via lxc.apparmor.raw entries by lxd.

In order for apparmor_parser's cache to be of use, this adds
a --with-apparmor-cache-dir ./configure option.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2018-07-25 14:37:32 +02:00
Christian Brauner
9a5e7ac4a9
include: add strlcat() implementation
CC: Donghwa Jeong <dh48.jeong@samsung.com>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-06-20 13:44:02 +02:00
Christian Brauner
477e62b618
include: add getgrgid_r()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-06-15 11:39:23 +02:00
Christian Brauner
91c272a571
strlcpy: add strlcpy() implementation
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-05-11 13:32:01 +02:00
Fabrice Fontaine
49bc916b1d Fix compilation with static libcap and shared gnutls
Commit c06ed219c4 has broken
compilation with a static libcap and a shared gnutls.
This results in a build failure on init_lxc_static if gnutls is
a shared library as init_lxc_static is built with -all-static option
(see src/lxc/Makefile.am) and AC_CHECK_LIB adds gnutls to LIBS.

This commit fix the issue by removing default behavior of AC_CHECK_LIB
and handling manually GNUTLS_LIBS and HAVE_LIBGNUTLS

Fixes:
 - http://autobuild.buildroot.net/results/b655d6853c25a195df28d91512b3ffb6c654fc90

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2018-04-07 18:12:12 +02:00
Stéphane Graber
5b66b6ee3e
Release LXC 3.0.0
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-03-27 21:49:16 -04:00
Stéphane Graber
b195038dfc
configure.ac: Support redhatenterpriseserver
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-03-27 15:21:51 -04:00
Stéphane Graber
769cf3c1cc
Release LXC 3.0.0.beta4
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-03-26 23:38:01 -04:00
Stéphane Graber
b53a26168c
Release LXC 3.0.0.beta3
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-03-23 16:22:00 -04:00
Stéphane Graber
14f16c4171
Release LXC 3.0.0.beta2
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-03-19 16:05:53 -04:00
Stéphane Graber
282753c6c9
Release LXC 3.0.0.beta1
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-03-01 13:59:24 -05:00
Christian Brauner
aafb5ea2a8
tree-wide: rm templates in favor of distrobuilder
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 10:05:34 +01:00
Christian Brauner
98619a7362
autotools: remove --enable-deprecated
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 10:05:34 +01:00
Christian Brauner
e144a06bd7
tree-wide: remove python3 bindings
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 10:05:33 +01:00
Christian Brauner
b52a5bef6f
tree-wide: remove lua bindings
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 10:05:33 +01:00
Christian Brauner
a9145d622f
tree-wide: cleanup
- remove legacy binaries
- conditionalize creation of docs and tests for the command line tools and the
  shared library helper commands

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 10:05:33 +01:00
Christian Brauner
8d0609371e
autotools: add --{enable,disable}-{commands,tools}
This allows users to only compile the shared libray without having to compile
any of the command line tools or command helpers for the shared library.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-28 10:05:30 +01:00
Stéphane Graber
d4feae43a6
Merge pull request #2192 from brauner/2018-02-26/enable_pam_flag
configure: add --enable-pam
2018-02-26 12:11:13 -05:00
Christian Brauner
f7a8609fab
configure: add --enable-pam
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-26 17:27:46 +01:00
Christian Brauner
35444f3827
templates: add lxc-local template
Closes #2184.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-26 17:22:48 +01:00
Christian Brauner
7ac43d3d21
Revert "Revert "pam: create writable cgroups for unpriv users""
This reverts commit 79cf25e826.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-26 17:01:18 +01:00
Stéphane Graber
79cf25e826
Revert "pam: create writable cgroups for unpriv users"
This reverts commit 7995662124.

Before we can merge something like this we need to have it be behind a
configure flag and quite probably be an opt-in feature (--enable-pam).

This should fix Jenkins, PPA builds and the current binary conflicts
between the lxcfs and lxc package builds (snap and archive).

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-02-21 17:25:58 -05:00
Serge Hallyn
e235f961bf
Merge pull request #2148 from brauner/2018-02-09/move_pam_module_to_liblxc
pam: create writable cgroups for unpriv users
2018-02-21 13:27:59 -06:00
Christian Brauner
0e7ff52c92
tree-wide: remove cgmanager
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-13 05:39:58 +01:00
Christian Brauner
7995662124
pam: create writable cgroups for unpriv users
This moves pam_cgfs from the LXCFS repo into the LXC repo. This will allow us
to share a bunch of code between the cgroup backends and the pam module. The
next step obviously is to share code.

Closes #1307.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-09 14:39:43 +01:00
Christian Brauner
6a342cab36
cmd: move lxc-update-config
Closes #2073.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-06 21:03:33 +01:00
Christian Brauner
48b1dc4cdc
cmd: move lxc-checkconfig
Closes #2073.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-02-06 21:03:32 +01:00
Christian Brauner
05f0f93a93
autotools: do not link against libapparmor
Since we write the label directly without going through the AppArmor API it
doesn't make sense to link against it.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2018-01-22 12:14:21 +01:00
Stéphane Graber
5f98011c3e
Include -devel suffix in version string
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2018-01-05 16:25:28 -05:00