Commit Graph

494 Commits

Author SHA1 Message Date
Stéphane Graber
7e37cc96bb
Release LXC 4.0.12
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2022-02-01 23:26:09 -05:00
Christian Brauner
bceb81cd26
build: simplify thread local storage handling
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2022-01-27 10:32:04 +01:00
Christian Brauner
919da35b03
build: only enable LTO for regular builds
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2022-01-27 10:32:01 +01:00
Joan Bruguera
fc4e948c9b
autotools: Avoid multiple liblxc.so with --enable-pam
When installing LXC with the default options, a single non-symlink liblxc.so*
(e.g. liblxc.so.1.7.0) file is created:

```
    $ ./autogen.sh && ./configure && make && \
    rm -rf "$HOME/lxci" && make DESTDIR="$HOME/lxci" install && \
    stat -c%N "$HOME/lxci/usr/local/lib/liblxc.so"*
    [...]
    '/home/someone/lxci/usr/local/lib/liblxc.so' -> 'liblxc.so.1'
    '/home/someone/lxci/usr/local/lib/liblxc.so.1' -> 'liblxc.so.1.7.0'
    '/home/someone/lxci/usr/local/lib/liblxc.so.1.7.0'
```

However, when automake>=1.16.5, and the `--enable-pam` option is used, two
non-symlink liblxc.so* (e.g. liblxc.so.1.0.0 and liblxc.so.1.7.0) are
erroneously created:

```
    $ ./autogen.sh && ./configure --enable-pam && make && \
    rm -rf "$HOME/lxci" && make DESTDIR="$HOME/lxci" install && \
    stat -c%N "$HOME/lxci/usr/local/lib/liblxc.so"*
    [...]
    '/home/someone/lxci/usr/local/lib/liblxc.so' -> 'liblxc.so.1.0.0'
    '/home/someone/lxci/usr/local/lib/liblxc.so.1' -> 'liblxc.so.1.0.0'
    '/home/someone/lxci/usr/local/lib/liblxc.so.1.0.0'
    '/home/someone/lxci/usr/local/lib/liblxc.so.1.7.0'
```

This is due to infighting between libtool's and LXC's versioning:
libtool creates liblxc.so.1.0.0, then LXC's `install-exec-local` hook in
`Makefile.am` moves it to liblxc.so.1.7.0. However, with `--enable-pam`, the
`install-libLTLIBRARIES` target is re-triggered after `install-pamLTLIBRARIES`,
which will create liblxc.so.1.0.0 again.

The bigger problem here is that the install for the pam_cgfs library is done on
the `data` phase of the automake install process instead of the `exec` phase
(https://www.gnu.org/software/automake/manual/html_node/The-Two-Parts-of-Install.html),
which gives `install-libLTLIBRARIES` a chance to run again after the
`install-exec-local` / `install-exec-hook` targets have already run.

To fix this, we add an "exec_" prefix to the pam_cgfs library to make it run
during the `exec` phase (see link above). We also consolidate the various hooks
in the `install-exec-hook` target, which runs after the whole install, avoiding
needing to manually specify the dependencies like in `install-exec-local`.

Signed-off-by: Joan Bruguera <joanbrugueram@gmail.com>
2021-11-09 14:04:53 +01:00
Christian Brauner
4915c91128
process_utils: add signal_name() helper
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-11-03 10:42:32 +01:00
Diederik de Haas
1ec5939b4a
Replace deprecated backticks with $() construct
See https://github.com/koalaman/shellcheck/wiki/SC2006 for details.
Not only uses this the recommended construct, it also makes the code
more uniform as in many other places the $() construct was already used.

Signed-off-by: Diederik de Haas <didi.debian@cknow.org>
2021-10-29 10:07:07 +02:00
Stéphane Graber
48e079bf31
Release LXC 4.0.11
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2021-10-19 12:01:41 -04:00
Christian Brauner
d5f993841b
log: fix cross-compilation with %m modifier
Fixes: #3961
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:26:32 +02:00
Christian Brauner
94bdf89bc4
build: make sure _GNU_SOURCE is set
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:25:57 +02:00
Christian Brauner
6aaa6ece42
configure: add sanitizer flags to LDFLAGS as well
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:23:56 +02:00
Christian Brauner
b1f9aee5c4
mainloop: add io_uring support
Users can choose to compile liblxc with io_uring support. This will
cause LXC to use io_uring instead of epoll.
We're using both, io_uring's one-shot and multi-shot poll mode depending
on the type of handler.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-10-14 17:21:46 +02:00
Stéphane Graber
d867b94c22
Release LXC 4.0.10
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2021-07-16 16:30:14 -04:00
Stéphane Graber
37485abd46
Release LXC 4.0.9
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2021-05-04 12:56:15 -04:00
Evgeny Vereshchagin
d3162efaa1
oss-fuzz: always turn off logging on OSS-Fuzz
Apparently /proc/self/cmd can't be used (reliably) on OSS-Fuzz to figure out
whether the code is run inside the fuzz targets, which causes the
fuzz targets to fill the filesystem with log files.

Related: https://github.com/google/oss-fuzz/issues/5509
Should address https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33835

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-05-04 17:43:32 +02:00
Stéphane Graber
c53580ec51
Release LXC 4.0.8
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2021-04-30 14:11:01 -04:00
Stéphane Graber
a751b90b17
Release LXC 4.0.7
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2021-04-29 16:55:34 -04:00
Evgeny Vereshchagin
3a07cd4220
build-system: turn off lto=thin when building the fuzzers
With lto=thin the fuzzers fail as soon as they start with
```
ERROR: The size of coverage PC tables does not match the
number of instrumented PCs. This might be a compiler bug,
please contact the libFuzzer developers.
Also check https://bugs.llvm.org/show_bug.cgi?id=34636
for possible workarounds (tl;dr: don't use the old GNU ld)
```

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-04-29 15:59:10 +02:00
Evgeny Vereshchagin
06b14efd10
build-system: add --enable-fuzzers
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-04-29 15:59:07 +02:00
Christian Brauner
c910e00de1
configure: fix function detection
Fixes: #3809
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-29 15:59:01 +02:00
Christian Brauner
1633166b85
mount_utils: add support for mount_setattr() syscall
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-23 09:07:20 +02:00
Evgeny Vereshchagin
5855f270b5
autoconf: stop passing -fsanitize=address via AM_LDFLAGS
The snippet is redundant because the build system automatically
passes the sanitizers flags set in AM_CFLAGS to the linker

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-04-21 10:05:11 +02:00
Christian Brauner
a905c1eda8
configure: fix sanitizer compilation
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-18 17:50:47 +02:00
Evgeny Vereshchagin
52c57882a0
build-system: make it compatible with ASan/UBsan/MSan
Closes: https://github.com/lxc/lxc/issues/3727

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2021-04-02 16:11:01 +02:00
Christian Brauner
96c61d3ad8
autotools: remove --enable-{asan,ubsan} in favor of --enable-sanitizers
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-04-02 16:10:53 +02:00
Christian Brauner
03fd67960a
compiler: fix thread_local detection
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-29 17:06:24 +02:00
Christian Brauner
6334098841
conf: fix thread_local support detection
Our detection for TLS wasn't working. Fix it.

Fixes: https://github.com/lxc/lxd/issues/8327
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-29 17:06:22 +02:00
Christian Brauner
682ae75628
configure: fix strchrnul conditiona compilation
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-25 14:19:17 +01:00
Christian Brauner
700c9f6630
string_utils: provide a version of strchrnul() in case it's not available
This should only happen on Android.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-25 14:19:13 +01:00
Christian Brauner
dcf690189a
macro: define __aligned_u64 to handle kernels without such support
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-03-17 22:16:51 +01:00
Christian Brauner
6f5af027da
cgroups: remove compile-time bpf support detection
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 21:27:41 +01:00
Christian Brauner
3c0117ccfb
mount_utils: add locked flag helpers
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 21:07:07 +01:00
Christian Brauner
83cd77dbd9
syscalls: add close_range()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-26 20:53:14 +01:00
Christian Brauner
5b8e411ec7
configure: fix static builds with clang-12 and LTO
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-02-08 17:34:17 +01:00
Christian Brauner
0564659714
autotools: update build
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-27 16:06:55 +01:00
Christian Brauner
63efab747c
configure: add AC_SYS_LARGEFILE checking
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-27 16:06:53 +01:00
Christian Brauner
a8d0ef4f13
configure: support static binaries
Including openssl handling.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2021-01-27 16:06:44 +01:00
Eneas U de Queiroz
9d6a3de700
configure: skip libseccomp tests if it is disabled
Move the block checking for libseccomp api compatibility inside
AM_COND_IF([ENABLE_SECCOMP] ... ).

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2021-01-22 19:37:14 +01:00
Stéphane Graber
1048d5e1f6
Release LXC 4.0.6
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2021-01-11 19:19:17 -05:00
Stéphane Graber
7bae22f73d
Release LXC 4.0.5
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2020-10-21 19:13:14 -04:00
Christian Brauner
36c2ad35c5
syscalls: add openat2()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-10-19 17:52:35 +02:00
Stéphane Graber
531e012803
Release LXC 4.0.4
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2020-08-04 17:18:57 -04:00
Christian Brauner
747ea18991
syscalls: add fsmount()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-03 17:51:16 +02:00
Christian Brauner
2b12bdbf30
syscalls: add fsconfig()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-03 17:51:16 +02:00
Christian Brauner
30850a5d48
syscalls: add fspick()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-03 17:51:15 +02:00
Christian Brauner
befb6f0d1d
syscalls: add fsopen()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-08-03 17:51:14 +02:00
Christian Brauner
40d5ef1e12
openpty: improve implementation and handling of platforms without it
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-07-18 13:01:37 +02:00
Stéphane Graber
6dc1208ded
Release LXC 4.0.3
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
2020-06-28 11:20:38 -04:00
Christian Brauner
7ebcd704be
process_utils: make lxc use clone3() whenever possible
No more weird api quirks between architectures and cool new features.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-24 21:33:33 -04:00
Christian Brauner
a62eb3aa12
process_utils: add clone3() support
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-24 21:02:05 -04:00
Christian Brauner
6aefab38c1
process_utils: introduce new process_utils.{c,h}
This will be the central place for all process management helpers. This also
removes raw_syscalls.{c,h}.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
2020-05-24 21:02:01 -04:00