]> git.ipfire.org Git - thirdparty/lxc.git/log
thirdparty/lxc.git
2 years agosrc/lxc/meson.build: fix the static library path 4225/head
Serge Hallyn [Sat, 12 Nov 2022 00:20:37 +0000 (18:20 -0600)] 
src/lxc/meson.build: fix the static library path

Since switching to meson, liblxc.a is being shipped as liblxc_static.a.
Change it back to liblxc.a.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
(cherry picked from commit 64eb31d02d4933ad414239130df3dff45a0f6f91)

2 years agoMerge pull request #4215 from cyphar/lxc5.x-opensuse-build
Christian Brauner [Tue, 22 Nov 2022 07:10:46 +0000 (08:10 +0100)] 
Merge pull request #4215 from cyphar/lxc5.x-opensuse-build

[lxc-5.0.z] build: fix build issues on openSUSE

2 years agobuild: drop build-time systemd dependency 4215/head
Aleksa Sarai [Fri, 28 Oct 2022 01:58:10 +0000 (12:58 +1100)] 
build: drop build-time systemd dependency

On openSUSE, our packages are build in the Open Build Service which does
not have a proper systemd installation that you can query to get the
systemdunitdir.

The simplest solution is to re-add the ability to explicitly set the
systemdunitdir (as was previously possible with the autotools build
system in pre-5.0 LXC).

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2 years agobuild: only build init.lxc.static if libcap is statically linkable
Aleksa Sarai [Fri, 28 Oct 2022 01:44:39 +0000 (12:44 +1100)] 
build: only build init.lxc.static if libcap is statically linkable

Without setting this, the default build will fail if you don't have the
static libcap library installed (on openSUSE this is packaged separately
to libcap-devel).

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2 years agobuild: fix handling of dependancies to fix build on openSUSE
Aleksa Sarai [Fri, 28 Oct 2022 01:38:20 +0000 (12:38 +1100)] 
build: fix handling of dependancies to fix build on openSUSE

Among other things, openSUSE places seccomp.h inside a non-default
include directory (/usr/include/seccomp/seccomp.h) which revealed
several issues with how dependencies were being handled previously.

The most notable issue is that the include cflags of our build
dependencies were not being provided to the recipes for static
executables (yet they still expected access to the dependency headers).

This also involved a minor cleanup of how these dependencies are
collected, and added liburing to the set of private pkg-config libs
(which I assume was an oversight?).

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2 years agocgroups: fix -Waddress warning
Aleksa Sarai [Fri, 28 Oct 2022 01:27:57 +0000 (12:27 +1100)] 
cgroups: fix -Waddress warning

While in principle the pointer could overflow, GCC 12 considers this to
not be possible and issues the following warning:

  ../src/lxc/cgroups/cgfsng.c: In function ‘__cgfsng_delegate_controllers’:
  ../src/lxc/cgroups/cgfsng.c:3306:21: warning: the comparison will always evaluate as ‘true’ for the pointer operand in ‘it + 8’ must not be NULL [-Waddress]
   3306 |                 if ((it + 1) && *(it + 1))
        |                     ^

This removes the only build warning triggered when building on openSUSE.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2 years agobuild: detect sys/pidfd.h availability
Christian Brauner [Tue, 9 Aug 2022 14:27:40 +0000 (16:27 +0200)] 
build: detect sys/pidfd.h availability

Fixes: #4176
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2 years agobuild: detect where struct mount_attr is declared
Christian Brauner [Tue, 9 Aug 2022 14:14:25 +0000 (16:14 +0200)] 
build: detect where struct mount_attr is declared

Fixes: #4176
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
2 years agomeson.build: allow explicit distrosysconfdir
Đoàn Trần Công Danh [Tue, 9 Aug 2022 15:24:09 +0000 (22:24 +0700)] 
meson.build: allow explicit distrosysconfdir

Allows either:

- Build inside minimal-and-clean chroot with neither
  /etc/sysconfig nor /etc/default available.
- Cross Compile lxc from foreign distro,
  let's say host distro uses /etc/sysconfig and build distro
  uses /etc/default and vice versus.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
3 years agoRelease LXC 5.0.1 lxc-5.0.1
Stéphane Graber [Thu, 28 Jul 2022 04:20:41 +0000 (00:20 -0400)] 
Release LXC 5.0.1

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agoREADME: update security mails
Christian Brauner [Tue, 19 Jul 2022 08:29:41 +0000 (10:29 +0200)] 
README: update security mails

Reported-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agomeson.build: fix build without stack-protector
Fabrice Fontaine [Thu, 14 Jul 2022 15:49:54 +0000 (17:49 +0200)] 
meson.build: fix build without stack-protector

Move -fstack-protector-strong from possible_cc_flags to
possible_link_flags to avoid a build failure on toolchains without ssp

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3 years agomeson.build: fix build with -Dcapabilities=false
Fabrice Fontaine [Thu, 14 Jul 2022 15:03:40 +0000 (17:03 +0200)] 
meson.build: fix build with -Dcapabilities=false

Define libcap_static to an empty array to avoid the following build
failure with -Dcapabilities=false:

output/build/lxc-5.0.0/src/lxc/cmd/meson.build:64:4: ERROR: Unknown variable "libcap_static".

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3 years agosrc/lxc/log.h: fix STRERROR_R_CHAR_P
Fabrice Fontaine [Thu, 14 Jul 2022 10:31:21 +0000 (12:31 +0200)] 
src/lxc/log.h: fix STRERROR_R_CHAR_P

STRERROR_R_CHAR_P is always defined to 0 or 1 depending on the value of
have_func_strerror_r_char_p in meson.build so replace #ifdef by #if to
avoid a redefinition build failure if char *strerror_r is not defined

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3 years agomeson: add remaining still-in-use config checks
Wolfgang Bumiller [Mon, 4 Jul 2022 09:27:14 +0000 (11:27 +0200)] 
meson: add remaining still-in-use config checks

These are all still in use in the code but have not been
added to meson.build when switching over from autoconf.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agoStore mount options in correct variable
srd424 [Sun, 3 Jul 2022 17:18:23 +0000 (18:18 +0100)] 
Store mount options in correct variable

This was exposed by the fix in the previous commit.

Signed-off-by: srd424 <srd424@users.noreply.github.com>
3 years agoFix off-by-one error constructing mount options
srd424 [Sun, 3 Jul 2022 09:21:30 +0000 (10:21 +0100)] 
Fix off-by-one error constructing mount options

This fixes a really subtle off-by-one error constructing overlay mount options if rootfs options are provided and modern overlayfs (i.e. requiring a workdir) is used. We need to allow for the extra "," required to separate the extra options when computing the length!

Signed-off-by: srd424 <srd424@users.noreply.github.com>
3 years agoadd check for statvfs
Wolfgang Bumiller [Fri, 1 Jul 2022 09:09:15 +0000 (11:09 +0200)] 
add check for statvfs

we use HAVE_STATVFS in the code but with meson the check got
lost causing mount_entry to fail to remount some things such
as a bind mount of /dev/fuse via

    lxc.mount.entry = /dev/fuse dev/fuse none bind,create=file 0 0

which would cause the following log messages:

    DEBUG    conf - ../src/lxc/conf.c:mount_entry:2416 - Remounting "/dev/fuse" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/fuse" to respect bind or remount options
    ERROR    conf - ../src/lxc/conf.c:mount_entry:2459 - Operation not permitted - Failed to mount "/dev/fuse" on "/usr/lib/x86_64-linux-gnu/lxc/rootfs/dev/fuse"

note that the `Flags for ... were ...` line is not showing
up there, which depends on HAVE_STATVFS

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
3 years agostart: fix namespace sharing
Christian Brauner [Fri, 1 Jul 2022 08:12:45 +0000 (10:12 +0200)] 
start: fix namespace sharing

Fixes: #4134
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agoconf: fix append_ttyname()
Christian Brauner [Thu, 30 Jun 2022 10:48:01 +0000 (12:48 +0200)] 
conf: fix append_ttyname()

We appended container_tty= and then used setenv(container_tty, ...)
resulting int container_tty=container_tty=.

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agostart: record inherited namespaces earlier to make it available for idmapped rootfs...
Christian Brauner [Wed, 29 Jun 2022 16:31:37 +0000 (18:31 +0200)] 
start: record inherited namespaces earlier to make it available for idmapped rootfs setup

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agostart: don't overwrite file descriptors during namespace preservation
Christian Brauner [Wed, 29 Jun 2022 16:31:01 +0000 (18:31 +0200)] 
start: don't overwrite file descriptors during namespace preservation

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agoconf: log file descriptors on error during idmapped mount setup
Christian Brauner [Wed, 29 Jun 2022 16:29:52 +0000 (18:29 +0200)] 
conf: log file descriptors on error during idmapped mount setup

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agofix for issue 4026: set broadcast to 0.0.0.0 for /31 and /32
Marc E. Fiuczynski [Mon, 13 Jun 2022 12:43:14 +0000 (08:43 -0400)] 
fix for issue 4026: set broadcast to 0.0.0.0 for /31 and /32

Signed-off-by: Marc E. Fiuczynski <mfiuczyn@akamai.com>
3 years agouse systemd dbus StartTransientUnit for unpriv cgroup2
Serge Hallyn [Tue, 21 Jun 2022 12:50:53 +0000 (14:50 +0200)] 
use systemd dbus StartTransientUnit for unpriv cgroup2

If, when init'ing cgroups for a container start, we detect that we
are an unprivileged user on a unified-hierarchy-only system, then we
try to request systemd, through dbus api, to create a new scope for
us with delegation.  Call the cgroup it creates for us P1.  We then
create P1/init, move ourselves into there, so we can enable the
controllers for delegation to P1's children through P1/cgroup.subtree_control.

On attach, we try to request systemd attach us to the container's
scope.  We can't do that ourselves in the normal case, as root owns
our login cgroups.

Create a new command api for the lxc monitor to tell lxc-attach the
systemd scope to which to attach.

Changelog:
 * free cgroup_meta.systemd_scope in lxc_conf_free (Thanks Tycho)
 * fix some indent
 * address some (not all) of brauner's feedback

Signed-off-by: Serge Hallyn <serge@hallyn.com>
3 years agoFix uninitialized read in parse_cap when libcap is not used
Raphael Isemann [Tue, 21 Jun 2022 11:10:40 +0000 (13:10 +0200)] 
Fix uninitialized read in parse_cap when libcap is not used

fuzz-lxc-cgroup-init currently fails for me with the input
```
 lxc.cap.keep=0
```

with this report:

```
==640655==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x833c77 in parse_cap /src/lxc/san_build/../src/lxc/conf.c:3161:6
    #1 0xaa5fd6 in add_cap_entry /src/lxc/san_build/../src/lxc/confile.c:2462:9
    #2 0x9eb69c in set_config_cap_keep /src/lxc/san_build/../src/lxc/confile.c:2503:8
    #3 0x974a76 in parse_line /src/lxc/san_build/../src/lxc/confile.c:3115:9
    #4 0xea8cac in lxc_file_for_each_line_mmap /src/lxc/san_build/../src/lxc/parse.c:123:9
    #5 0x9700a1 in lxc_config_read /src/lxc/san_build/../src/lxc/confile.c:3192:9
    #6 0x4a3b50 in LLVMFuzzerTestOneInput /src/lxc/san_build/../src/tests/fuzz-lxc-cgroup-init.c:40:8
    #7 0x10556e3 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:611:15
    #8 0x1041372 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:324:6
    #9 0x1046bbc in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:860:9
    #10 0x106f7b2 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
    #11 0x7ffff7bc00b2 in __libc_start_main /build/glibc-sMfBJT/glibc-2.31/csu/../csu/libc-start.c:308:16
    #12 0x420a9d in _start (/home/fuzzer/oss-fuzz/build/out/lxc/fuzz-lxc-cgroup-init+0x420a9d)

  Uninitialized value was created by an allocation of 'last_cap' in the stack frame of function 'parse_cap'
    #0 0x832e30 in parse_cap /src/lxc/san_build/../src/lxc/conf.c:3131
```

The reason is that without libcap we parse_cap ends up comparing two
uninitialized values. See the snippet below:

```
int parse_cap(const char *cap_name, __u32 *cap)
{
int ret;
unsigned int res;
__u32 last_cap;

  [...]

ret = lxc_caps_last_cap(&last_cap); // NOTE: 1. Call here.
if (ret) // Not taken as dummy lxc_caps_last_cap returned 0.
return -1;

if ((__u32)res > last_cap) // last_cap is uninitialized.
return -1;

*cap = (__u32)res;
return 0;
}
```

Root cause seems to be that the dummy `lxc_caps_last_cap` returns 0 but
doesn't set the last_cap value. This patch just returns -1 as an error code
to avoid the uninitialized read.

Note: When reproducing the bug you need to compile with O0 and *not* with O1
otherwise you will not see the report.

Signed-off-by: Raphael Isemann <teemperor@gmail.com>
3 years agomeson: Generate compile commands by iterating over an array
Petr Malat [Wed, 15 Jun 2022 13:59:30 +0000 (15:59 +0200)] 
meson: Generate compile commands by iterating over an array

This makes it possible to add a new command without updating multiple
places in the meson file.

Signed-off-by: Petr Malat <oss@malat.biz>
3 years agoRelease LXC 5.0.0 lxc-5.0.0
Stéphane Graber [Thu, 16 Jun 2022 19:20:14 +0000 (15:20 -0400)] 
Release LXC 5.0.0

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agoMerge pull request #4148 from stgraber/master
Stéphane Graber [Tue, 14 Jun 2022 02:17:52 +0000 (22:17 -0400)] 
Merge pull request #4148 from stgraber/master

meson: Fix bad strerror_r check

3 years agomeson: Fix bad strerror_r check 4148/head
Stéphane Graber [Tue, 14 Jun 2022 01:27:46 +0000 (21:27 -0400)] 
meson: Fix bad strerror_r check

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agoMerge pull request #4146 from brauner/2022-06-13.fixes
Stéphane Graber [Mon, 13 Jun 2022 14:12:07 +0000 (10:12 -0400)] 
Merge pull request #4146 from brauner/2022-06-13.fixes

build: fixes

3 years agobuild: map autotools options to meson options in meson_options.txt 4146/head
Christian Brauner [Mon, 13 Jun 2022 13:46:33 +0000 (15:46 +0200)] 
build: map autotools options to meson options in meson_options.txt

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agoREADME: reflect meson in the documentation
Christian Brauner [Mon, 13 Jun 2022 13:36:13 +0000 (15:36 +0200)] 
README: reflect meson in the documentation

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agobuild: add missing memfd-rexec option
Christian Brauner [Mon, 13 Jun 2022 13:31:36 +0000 (15:31 +0200)] 
build: add missing memfd-rexec option

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agobuild: support thread-safety enforcement as option
Christian Brauner [Mon, 13 Jun 2022 11:46:15 +0000 (13:46 +0200)] 
build: support thread-safety enforcement as option

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agobuild: use cc.links() to check for static libcap
Christian Brauner [Mon, 13 Jun 2022 09:04:17 +0000 (11:04 +0200)] 
build: use cc.links() to check for static libcap

Fixes: #4144
Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agoMerge pull request #4142 from brauner/2022-06-09.build.fixes
Stéphane Graber [Thu, 9 Jun 2022 21:35:34 +0000 (17:35 -0400)] 
Merge pull request #4142 from brauner/2022-06-09.build.fixes

tests: fix oss-fuzz port to meson

3 years agooss-fuzz: cleanup build flags 4142/head
Christian Brauner [Thu, 9 Jun 2022 16:15:41 +0000 (18:15 +0200)] 
oss-fuzz: cleanup build flags

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agooss-fuzz: ensure binaries are zipped
Christian Brauner [Thu, 9 Jun 2022 16:15:12 +0000 (18:15 +0200)] 
oss-fuzz: ensure binaries are zipped

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agooss-fuzz: adapt options to oss-fuzz build
Christian Brauner [Thu, 9 Jun 2022 16:14:45 +0000 (18:14 +0200)] 
oss-fuzz: adapt options to oss-fuzz build

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agooss-fuzz: handle dependencies
Christian Brauner [Thu, 9 Jun 2022 16:14:13 +0000 (18:14 +0200)] 
oss-fuzz: handle dependencies

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agobuild: separate oss-fuzz tests from regular test builds
Christian Brauner [Thu, 9 Jun 2022 16:12:54 +0000 (18:12 +0200)] 
build: separate oss-fuzz tests from regular test builds

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agogithub/workflows/cifuzz: update to Ubuntu 22.04
Christian Brauner [Thu, 9 Jun 2022 16:12:25 +0000 (18:12 +0200)] 
github/workflows/cifuzz: update to Ubuntu 22.04

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agobuild: add oss-fuzz switch
Christian Brauner [Thu, 9 Jun 2022 16:11:37 +0000 (18:11 +0200)] 
build: add oss-fuzz switch

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agobuild: add seccomp build option
Christian Brauner [Thu, 9 Jun 2022 16:10:27 +0000 (18:10 +0200)] 
build: add seccomp build option

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agobuild: fix build with various options turned off
Christian Brauner [Thu, 9 Jun 2022 16:08:27 +0000 (18:08 +0200)] 
build: fix build with various options turned off

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agobuild: tweak build flags
Christian Brauner [Thu, 9 Jun 2022 16:07:35 +0000 (18:07 +0200)] 
build: tweak build flags

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agoMerge pull request #4141 from lxc/dependabot/github_actions/actions/upload-artifact-3
Stéphane Graber [Thu, 9 Jun 2022 06:02:41 +0000 (02:02 -0400)] 
Merge pull request #4141 from lxc/dependabot/github_actions/actions/upload-artifact-3

build(deps): bump actions/upload-artifact from 1 to 3

3 years agobuild(deps): bump actions/upload-artifact from 1 to 3 4141/head
dependabot[bot] [Thu, 9 Jun 2022 06:01:55 +0000 (06:01 +0000)] 
build(deps): bump actions/upload-artifact from 1 to 3

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 1 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v1...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
3 years agoMerge pull request #4140 from turrisxyz/Dependabot-GitHub-Actions
Stéphane Graber [Thu, 9 Jun 2022 06:01:31 +0000 (02:01 -0400)] 
Merge pull request #4140 from turrisxyz/Dependabot-GitHub-Actions

chore: Included githubactions in the dependabot config

3 years agochore: Included githubactions in the dependabot config 4140/head
naveen [Thu, 9 Jun 2022 01:29:39 +0000 (01:29 +0000)] 
chore: Included githubactions in the dependabot config

This should help with keeping the GitHub actions updated on new releases. This will also help with keeping it secure.

Dependabot helps in keeping the supply chain secure https://docs.github.com/en/code-security/dependabot

GitHub actions up to date https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot

https://github.com/ossf/scorecard/blob/main/docs/checks.md#dependency-update-tool
Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
3 years agoMerge pull request #4139 from stgraber/master
Christian Brauner [Wed, 8 Jun 2022 22:46:28 +0000 (00:46 +0200)] 
Merge pull request #4139 from stgraber/master

Github workflow fixes

3 years agogithub: Fix compiler version task for coverity 4139/head
Stéphane Graber [Wed, 8 Jun 2022 21:46:50 +0000 (17:46 -0400)] 
github: Fix compiler version task for coverity

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agogithub: Fix bad syntax in cifuzz
Stéphane Graber [Wed, 8 Jun 2022 21:44:08 +0000 (17:44 -0400)] 
github: Fix bad syntax in cifuzz

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agoMerge pull request #4137 from brauner/2022-06-08.stgraber.master
Christian Brauner [Wed, 8 Jun 2022 18:43:10 +0000 (20:43 +0200)] 
Merge pull request #4137 from brauner/2022-06-08.stgraber.master

build: remove autotools and finish meson port

3 years agogithub/workflows/sanitizers: port sanitizers builds to meson 4137/head
Christian Brauner [Wed, 8 Jun 2022 18:14:23 +0000 (20:14 +0200)] 
github/workflows/sanitizers: port sanitizers builds to meson

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agogithub/workflows: port all workflows to Ubuntu 22.04
Christian Brauner [Wed, 8 Jun 2022 18:12:22 +0000 (20:12 +0200)] 
github/workflows: port all workflows to Ubuntu 22.04

So we have a new enough meson version everywhere.

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agogithub/workflows/cifuzz: ensure necessary paths are added
Christian Brauner [Wed, 8 Jun 2022 18:10:52 +0000 (20:10 +0200)] 
github/workflows/cifuzz: ensure necessary paths are added

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agogithub/workflows/build: remove sanitizer build
Christian Brauner [Wed, 8 Jun 2022 18:08:47 +0000 (20:08 +0200)] 
github/workflows/build: remove sanitizer build

We have a separate workflow for this.

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agogithub/workflows/build: add -Db_lto_mode=default
Christian Brauner [Wed, 8 Jun 2022 18:07:21 +0000 (20:07 +0200)] 
github/workflows/build: add -Db_lto_mode=default

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agogithub/workflows/build: install lvvm as well
Christian Brauner [Wed, 8 Jun 2022 18:06:41 +0000 (20:06 +0200)] 
github/workflows/build: install lvvm as well

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agooss-fuzz: more meson options
Christian Brauner [Wed, 8 Jun 2022 18:05:38 +0000 (20:05 +0200)] 
oss-fuzz: more meson options

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agobuild: lxc-init doesn't need to build the whole config infra
Christian Brauner [Wed, 8 Jun 2022 18:03:59 +0000 (20:03 +0200)] 
build: lxc-init doesn't need to build the whole config infra

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agobuild: add additional command line switches
Christian Brauner [Wed, 8 Jun 2022 18:03:05 +0000 (20:03 +0200)] 
build: add additional command line switches

In order to compile for fuzzers where we will need and want to turn a
bunch of things off add command line switches that allow us to do so.

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agobuild: use liblxc_sources everywhere
Christian Brauner [Wed, 8 Jun 2022 18:00:38 +0000 (20:00 +0200)] 
build: use liblxc_sources everywhere

The old split didn't buy us a lot and causes problems when buidling with
sanitizers enabled so just use the full sources.

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agoconfig: make lxc-{containers,net}.in executable
Christian Brauner [Wed, 8 Jun 2022 16:15:08 +0000 (18:15 +0200)] 
config: make lxc-{containers,net}.in executable

Signed-off-by: Christian Brauner (Microsoft) <christian.brauner@ubuntu.com>
3 years agoMerge pull request #4136 from turrisxyz/Pinned-Dependencies-GitHub
Stéphane Graber [Wed, 8 Jun 2022 05:26:59 +0000 (01:26 -0400)] 
Merge pull request #4136 from turrisxyz/Pinned-Dependencies-GitHub

chore: Set permissions for GitHub actions

3 years agomeson: Always defined IS_BIONIC 4131/head
Stéphane Graber [Wed, 8 Jun 2022 05:00:51 +0000 (01:00 -0400)] 
meson: Always defined IS_BIONIC

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agosrc: Don't use ifdef/defined for config.h
Stéphane Graber [Tue, 7 Jun 2022 20:21:10 +0000 (16:21 -0400)] 
src: Don't use ifdef/defined for config.h

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agogithub: Update coverity workflow for meson
Stéphane Graber [Fri, 3 Jun 2022 19:51:09 +0000 (15:51 -0400)] 
github: Update coverity workflow for meson

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agogithub: Update build test for meson
Stéphane Graber [Fri, 3 Jun 2022 19:43:42 +0000 (15:43 -0400)] 
github: Update build test for meson

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agoREADME: Update for meson
Stéphane Graber [Fri, 3 Jun 2022 19:37:05 +0000 (15:37 -0400)] 
README: Update for meson

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agodoc: Update for meson
Stéphane Graber [Fri, 3 Jun 2022 19:35:35 +0000 (15:35 -0400)] 
doc: Update for meson

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agomeson: Add basic Makefile
Stéphane Graber [Fri, 29 Apr 2022 03:14:07 +0000 (23:14 -0400)] 
meson: Add basic Makefile

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agoRemove autotools
Stéphane Graber [Fri, 29 Apr 2022 03:12:35 +0000 (23:12 -0400)] 
Remove autotools

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agochore: Set permissions for GitHub actions 4136/head
neilnaveen [Wed, 8 Jun 2022 01:08:12 +0000 (01:08 +0000)] 
chore: Set permissions for GitHub actions

 Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: neilnaveen <42328488+neilnaveen@users.noreply.github.com>
3 years agoMerge pull request #4135 from stgraber/meson
Christian Brauner [Tue, 7 Jun 2022 21:51:34 +0000 (23:51 +0200)] 
Merge pull request #4135 from stgraber/meson

More meson fixes

3 years agomeson: Fix mntent include condition 4135/head
Stéphane Graber [Tue, 7 Jun 2022 21:16:08 +0000 (17:16 -0400)] 
meson: Fix mntent include condition

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agolxc/rexec: Use HAVE_FEXECVE
Stéphane Graber [Tue, 7 Jun 2022 21:15:54 +0000 (17:15 -0400)] 
lxc/rexec: Use HAVE_FEXECVE

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agomeson: Add lxcmntent to unmount-namespace hook
Stéphane Graber [Tue, 7 Jun 2022 21:15:26 +0000 (17:15 -0400)] 
meson: Add lxcmntent to unmount-namespace hook

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agomeson: Add missing prlimit include
Stéphane Graber [Tue, 7 Jun 2022 20:21:54 +0000 (16:21 -0400)] 
meson: Add missing prlimit include

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agomeson: Only build seccomp and selinux when needed
Stéphane Graber [Tue, 7 Jun 2022 20:21:42 +0000 (16:21 -0400)] 
meson: Only build seccomp and selinux when needed

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agomeson: Always define HAVE_LIBURING
Stéphane Graber [Tue, 7 Jun 2022 20:19:57 +0000 (16:19 -0400)] 
meson: Always define HAVE_LIBURING

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agomeson: seccomp is optional
Stéphane Graber [Tue, 7 Jun 2022 19:16:36 +0000 (15:16 -0400)] 
meson: seccomp is optional

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agomeson: Fix on shallow git trees
Stéphane Graber [Tue, 7 Jun 2022 19:16:11 +0000 (15:16 -0400)] 
meson: Fix on shallow git trees

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agomeson: Add bionic detection
Stéphane Graber [Tue, 7 Jun 2022 19:14:01 +0000 (15:14 -0400)] 
meson: Add bionic detection

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agomeson: Fix RPM spec variables
Stéphane Graber [Tue, 7 Jun 2022 05:30:43 +0000 (01:30 -0400)] 
meson: Fix RPM spec variables

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agomeson: Make lxc-user-nic setuid
Stéphane Graber [Tue, 7 Jun 2022 05:14:37 +0000 (01:14 -0400)] 
meson: Make lxc-user-nic setuid

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agomeson: Don't include lxc-test-fuzzers
Stéphane Graber [Tue, 7 Jun 2022 05:05:35 +0000 (01:05 -0400)] 
meson: Don't include lxc-test-fuzzers

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agomeson: Skip static library when using sanitizer
Stéphane Graber [Mon, 6 Jun 2022 22:06:09 +0000 (18:06 -0400)] 
meson: Skip static library when using sanitizer

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agomeson: Cleanup and fix includes
Stéphane Graber [Fri, 3 Jun 2022 21:53:45 +0000 (17:53 -0400)] 
meson: Cleanup and fix includes

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agomeson: Add coverity flag
Stéphane Graber [Fri, 3 Jun 2022 19:48:32 +0000 (15:48 -0400)] 
meson: Add coverity flag

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agoMerge pull request #4133 from dasteihn/sta/fallthrough
Christian Brauner [Tue, 7 Jun 2022 11:20:05 +0000 (13:20 +0200)] 
Merge pull request #4133 from dasteihn/sta/fallthrough

CODING_STYLE: add forgotten fallthrough

3 years agoCODING_STYLE: add forgotten fallthrough 4133/head
Philipp Stanner [Tue, 7 Jun 2022 11:06:56 +0000 (13:06 +0200)] 
CODING_STYLE: add forgotten fallthrough

Signed-off-by: Philipp Stanner <stanner@posteo.de>
3 years agoMerge pull request #4130 from stgraber/master
Christian Brauner [Fri, 3 Jun 2022 08:32:25 +0000 (10:32 +0200)] 
Merge pull request #4130 from stgraber/master

Finalize the meson port

3 years agomeson: Add RPM spec 4130/head
Stéphane Graber [Thu, 2 Jun 2022 20:49:37 +0000 (16:49 -0400)] 
meson: Add RPM spec

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agomeson: Rework configuration variables
Stéphane Graber [Thu, 2 Jun 2022 20:37:45 +0000 (16:37 -0400)] 
meson: Rework configuration variables

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agomeson: Tweak config for manpages
Stéphane Graber [Thu, 2 Jun 2022 19:24:57 +0000 (15:24 -0400)] 
meson: Tweak config for manpages

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agomeson: Export more variables to doc
Stéphane Graber [Thu, 2 Jun 2022 17:57:32 +0000 (13:57 -0400)] 
meson: Export more variables to doc

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
3 years agomeson: Export LXC_DISTRO_SYSCONF
Stéphane Graber [Thu, 2 Jun 2022 17:57:02 +0000 (13:57 -0400)] 
meson: Export LXC_DISTRO_SYSCONF

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>