]> git.ipfire.org Git - thirdparty/lxc.git/log
thirdparty/lxc.git
84 min agoMerge pull request #4615 from chackoj-1204/meson-build-enable-api-docs main
Stéphane Graber [Mon, 15 Dec 2025 19:05:35 +0000 (14:05 -0500)] 
Merge pull request #4615 from chackoj-1204/meson-build-enable-api-docs

Add Meson option for enabling API documentation generation with Doxygen

5 hours agoMerge pull request #4625 from lxc/dependabot/github_actions/actions/upload-artifact-6
Stéphane Graber [Mon, 15 Dec 2025 15:28:43 +0000 (10:28 -0500)] 
Merge pull request #4625 from lxc/dependabot/github_actions/actions/upload-artifact-6

build(deps): bump actions/upload-artifact from 5 to 6

7 hours agobuild(deps): bump actions/upload-artifact from 5 to 6 4625/head
dependabot[bot] [Mon, 15 Dec 2025 13:03:44 +0000 (13:03 +0000)] 
build(deps): bump actions/upload-artifact from 5 to 6

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

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

Signed-off-by: dependabot[bot] <support@github.com>
3 days agoMerge pull request #4622 from Rahik-Sikder/lxc_create_rbd_user_option
Stéphane Graber [Fri, 12 Dec 2025 02:15:41 +0000 (21:15 -0500)] 
Merge pull request #4622 from Rahik-Sikder/lxc_create_rbd_user_option

added "--rbduser" option in "lxc-create -B rbd"

3 days agoadded doc for --rbduser 4622/head
Rahik-Sikder [Thu, 11 Dec 2025 21:14:36 +0000 (15:14 -0600)] 
added doc for --rbduser

Signed-off-by: Rahik-Sikder <sikder.rahik@gmail.com>
5 days agoadded "--rbduser" option in "lxc-create -B rbd"
Rahik-Sikder [Tue, 9 Dec 2025 22:12:25 +0000 (16:12 -0600)] 
added "--rbduser" option in "lxc-create -B rbd"

Co-developed-by: Rahik Sikder <sikder.rahik@gmail.com>
Co-developed-by: Jake Chacko <chackoj1204@gmail.com>
Signed-off-by: Rahik-Sikder <sikder.rahik@gmail.com>
6 days agoMerge pull request #4621 from James-Featherston/issue-4577
Stéphane Graber [Mon, 8 Dec 2025 21:28:05 +0000 (16:28 -0500)] 
Merge pull request #4621 from James-Featherston/issue-4577

Add checks for "lxc-net fails when kernel has no IPv6"

11 days agoMerge pull request #4620 from yangh/run-dir-xdg
Stéphane Graber [Thu, 4 Dec 2025 09:14:37 +0000 (04:14 -0500)] 
Merge pull request #4620 from yangh/run-dir-xdg

Fallback to XDG_RUNTIME_DIR when /run not found

11 days agoFallback to XDG_RUNTIME_DIR when /run not found 4620/head
Hong YANG [Thu, 4 Dec 2025 03:43:37 +0000 (11:43 +0800)] 
Fallback to XDG_RUNTIME_DIR when /run not found

Instead of return null immediately when RUNTIME_PATH
not found, fallback to XDG_RUNTIME_DIR or HOME.

Signed-off-by: Hong YANG <hong.yang3@nio.com>
11 days agoMerge pull request #4618 from yangh/main
Stéphane Graber [Thu, 4 Dec 2025 03:32:56 +0000 (22:32 -0500)] 
Merge pull request #4618 from yangh/main

checkonfig: Fixed compatible with toybox/gunzip

11 days agocheckonfig: Fixed compatible with toybox/gunzip 4618/head
Hong YANG [Thu, 4 Dec 2025 03:03:04 +0000 (11:03 +0800)] 
checkonfig: Fixed compatible with toybox/gunzip

gunzip in Android/toybox has no -q option.

Signed-off-by: Hong YANG <hong.yang3@nio.com>
12 days agoMerge pull request #4617 from James-Featherston/issue-4580
Stéphane Graber [Wed, 3 Dec 2025 16:06:48 +0000 (11:06 -0500)] 
Merge pull request #4617 from James-Featherston/issue-4580

Fix "initializer-string for character array is too long, array size is 16 but initializer has size 17" compile error with clang 21

12 days agoInitial changes without testing 4621/head
jamesfeatherston [Wed, 3 Dec 2025 00:26:33 +0000 (18:26 -0600)] 
Initial changes without testing

Signed-off-by: jamesfeatherston <jamesfeatherston@utexas.edu>
12 days agoEnumerated all values in array 4617/head
jamesfeatherston [Wed, 3 Dec 2025 00:22:22 +0000 (18:22 -0600)] 
Enumerated all values in array

Signed-off-by: jamesfeatherston <jamesfeatherston@utexas.edu>
13 days agomeson: add meson option for running doxygen in build 4615/head
Jake Chacko [Sat, 29 Nov 2025 22:19:12 +0000 (16:19 -0600)] 
meson: add meson option for running doxygen in build

Co-developed-by: Jake Chacko <chackoj1204@gmail.com>
Co-developed-by: Rahik Sikder <sikder.rahik@gmail.com>
Signed-off-by: Jake Chacko <chackoj1204@gmail.com>
13 days agoMerge pull request #4601 from FernandoPicazo/unfreeze_fix
Stéphane Graber [Tue, 2 Dec 2025 03:38:41 +0000 (22:38 -0500)] 
Merge pull request #4601 from FernandoPicazo/unfreeze_fix

Ensure do_lxcapi_unfreeze returns false when getstate errors

2 weeks agoMerge pull request #4614 from jaeyoonjung/pr.musl2
Stéphane Graber [Sun, 30 Nov 2025 22:30:09 +0000 (17:30 -0500)] 
Merge pull request #4614 from jaeyoonjung/pr.musl2

build: Check if P_PIDFD is defined

2 weeks agobuild: Check if P_PIDFD is defined 4614/head
Jaeyoon Jung [Sun, 30 Nov 2025 02:51:13 +0000 (11:51 +0900)] 
build: Check if P_PIDFD is defined

It is defined in enum 'idtype_t' in some environment in which causes an
error like:
../git/src/lxc/process_utils.h:144:17: error: expected identifier before numeric constant
  144 | #define P_PIDFD 3
      |                 ^

Signed-off-by: Jaeyoon Jung <jaeyoon.jung@lge.com>
3 weeks agoMerge pull request #4610 from lxc/dependabot/github_actions/actions/checkout-6
Stéphane Graber [Mon, 24 Nov 2025 16:10:14 +0000 (11:10 -0500)] 
Merge pull request #4610 from lxc/dependabot/github_actions/actions/checkout-6

build(deps): bump actions/checkout from 5 to 6

3 weeks agobuild(deps): bump actions/checkout from 5 to 6 4610/head
dependabot[bot] [Mon, 24 Nov 2025 14:07:38 +0000 (14:07 +0000)] 
build(deps): bump actions/checkout from 5 to 6

Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
3 weeks agoEnsure do_lxcapi_unfreeze returns false when getstate errors 4601/head
Fernando Picazo [Thu, 30 Oct 2025 03:37:46 +0000 (22:37 -0500)] 
Ensure do_lxcapi_unfreeze returns false when getstate errors

Signed-off-by: Fernando Picazo <fernando.picazo@outlook.com>
3 weeks agoMerge pull request #4609 from ThomasLamprecht/apparmor-no-proc-sys-restrictions-if...
Stéphane Graber [Thu, 20 Nov 2025 20:00:26 +0000 (15:00 -0500)] 
Merge pull request #4609 from ThomasLamprecht/apparmor-no-proc-sys-restrictions-if-nested

apparmor: skip /proc and /sys restrictions if nesting is enabled

3 weeks agoapparmor: skip /proc and /sys restrictions if nesting is enabled 4609/head
Fabian Grünbichler [Thu, 13 Nov 2025 12:25:04 +0000 (13:25 +0100)] 
apparmor: skip /proc and /sys restrictions if nesting is enabled

If nesting is enabled, it's already possible to mount your own
instance of both procfs and sysfs inside the container, so protecting
the "original" ones at /proc and /sys makes no sense, but breaks
certain nested container setups.

See: https://github.com/lxc/incus/pull/2624/commits/1fbe4bffb9748cc3b07aaf5db310d463c1e827d0

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
5 weeks agoMerge pull request #4602 from arrowd/spec-fix
Stéphane Graber [Wed, 5 Nov 2025 17:43:54 +0000 (12:43 -0500)] 
Merge pull request #4602 from arrowd/spec-fix

Update lxc.spec.in to use meson

6 weeks agoUpdate lxc.spec.in to use meson 4602/head
Gleb Popov [Thu, 30 Oct 2025 13:02:45 +0000 (16:02 +0300)] 
Update lxc.spec.in to use meson

Signed-off-by: Gleb Popov <6yearold@gmail.com>
6 weeks agoMerge pull request #4598 from gibmat/fix-apparmor-abstraction-generation
Stéphane Graber [Tue, 28 Oct 2025 01:39:25 +0000 (21:39 -0400)] 
Merge pull request #4598 from gibmat/fix-apparmor-abstraction-generation

Fix meson build generation of apparmor container-base

6 weeks agoconfig/apparmor/abstractions: Drop manually generated container-base file 4598/head
Mathias Gibbens [Sun, 26 Oct 2025 20:03:15 +0000 (20:03 +0000)] 
config/apparmor/abstractions: Drop manually generated container-base file

Signed-off-by: Mathias Gibbens <gibmat@debian.org>
6 weeks agoconfig/apparmor/abstractions: Fix meson build generation of container-base
Mathias Gibbens [Sun, 26 Oct 2025 20:02:29 +0000 (20:02 +0000)] 
config/apparmor/abstractions: Fix meson build generation of container-base

Previously, abstractions/container-base was a hand-generated concatenation of
two different files, abstractions/container-base.in and container-rules. This
was confusing, since the meson configuration didn't actually create
abstractions/container-base from abstractions/container-base.in. Now, the
previously manual step of creating abstractions/container-base is part of the
meson configure step.

Signed-off-by: Mathias Gibbens <gibmat@debian.org>
7 weeks agoMerge pull request #4599 from lxc/dependabot/github_actions/actions/upload-artifact-5
Stéphane Graber [Mon, 27 Oct 2025 15:01:21 +0000 (11:01 -0400)] 
Merge pull request #4599 from lxc/dependabot/github_actions/actions/upload-artifact-5

build(deps): bump actions/upload-artifact from 4 to 5

7 weeks agobuild(deps): bump actions/upload-artifact from 4 to 5 4599/head
dependabot[bot] [Mon, 27 Oct 2025 14:43:09 +0000 (14:43 +0000)] 
build(deps): bump actions/upload-artifact from 4 to 5

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

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

Signed-off-by: dependabot[bot] <support@github.com>
7 weeks agoMerge pull request #4596 from hallyn/2025-10-25/packaging
Stéphane Graber [Mon, 27 Oct 2025 00:47:02 +0000 (20:47 -0400)] 
Merge pull request #4596 from hallyn/2025-10-25/packaging

builds workflow: make .orig.tar.gz unique per build

7 weeks agobuilds workflow: make .orig.tar.gz unique per build 4596/head
Serge Hallyn [Sat, 25 Oct 2025 20:50:05 +0000 (15:50 -0500)] 
builds workflow: make .orig.tar.gz unique per build

This way we can actually post the result to ppa for
various releases.

The package version previously was something like

6.0.0-0+daily~noble~202510260402

and now becomes

6.0.0~daily~noble~202510260402

So we s/-0+/~/ .  This way, we can use an orig tarball
named lxc_6.0.0~daily~jammy~202510260402.orig.tar.gz.
With the -0 after the version, debuild would only look
for lxc_6.0.0.orig.tar.gz.  6.0.0~daily will still be older
than any 6.0.0-0 or 6.0.0-1 that might legitimately get
pushed into the release.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
7 weeks agoMerge pull request #4569 from Container-On-Android/features
Stéphane Graber [Fri, 24 Oct 2025 13:14:49 +0000 (09:14 -0400)] 
Merge pull request #4569 from Container-On-Android/features

add MFD_NOEXEC_SEAL or MFD_EXEC by default if it‘s available

7 weeks agoMerge pull request #4595 from stgraber/main
Serge Hallyn [Wed, 22 Oct 2025 21:08:31 +0000 (16:08 -0500)] 
Merge pull request #4595 from stgraber/main

github: Drop focal source packages

7 weeks agogithub: Drop focal source packages 4595/head
Stéphane Graber [Wed, 22 Oct 2025 20:58:01 +0000 (16:58 -0400)] 
github: Drop focal source packages

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
7 weeks agoadd MFD_EXEC and MFD_NOEXEC_SEAL flag to memfd_create 4569/head
DreamConnected [Mon, 13 Oct 2025 11:48:21 +0000 (19:48 +0800)] 
add MFD_EXEC and MFD_NOEXEC_SEAL flag to memfd_create

Signed-off-by: DreamConnected <1487442471@qq.com>
Co-Authored-By: Danny Lin <danny@kdrag0n.dev>
2 months agoMerge pull request #4592 from stgraber/main
Serge Hallyn [Wed, 15 Oct 2025 01:35:03 +0000 (20:35 -0500)] 
Merge pull request #4592 from stgraber/main

start: Only include linux/landlock.h when landlock is enabled

2 months agostart: Only include linux/landlock.h when landlock is enabled 4592/head
Stéphane Graber [Wed, 15 Oct 2025 00:28:03 +0000 (20:28 -0400)] 
start: Only include linux/landlock.h when landlock is enabled

Closes #4591

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2 months agoMerge pull request #4590 from stribika/main
Stéphane Graber [Mon, 13 Oct 2025 22:31:14 +0000 (18:31 -0400)] 
Merge pull request #4590 from stribika/main

Automatically detect compression format in the lxc-local template

2 months agoAutomatically detect compression format in the lxc-local template 4590/head
Stribik András [Mon, 13 Oct 2025 10:51:23 +0000 (12:51 +0200)] 
Automatically detect compression format in the lxc-local template

Signed-off-by: Stribik András <andras@stribik.technology>
2 months agoMerge pull request #4581 from kadinsayani/fix/create-mount-target
Serge Hallyn [Sat, 4 Oct 2025 02:36:27 +0000 (21:36 -0500)] 
Merge pull request #4581 from kadinsayani/fix/create-mount-target

lxccontainer: check if target exists before remove in create_mount_target()

2 months agolxccontainer: check if target exists before remove in create_mount_target() 4581/head
Kadin Sayani [Wed, 3 Sep 2025 22:45:20 +0000 (16:45 -0600)] 
lxccontainer: check if target exists before remove in create_mount_target()

Signed-off-by: Kadin Sayani <kadin.sayani@canonical.com>
2 months agoMerge pull request #4589 from rsyring/log-file-perms
Serge Hallyn [Sat, 4 Oct 2025 00:53:30 +0000 (19:53 -0500)] 
Merge pull request #4589 from rsyring/log-file-perms

Standardize log file create mode to 0640

2 months agoStandardize log file create mode to 0640 4589/head
Randy Syring [Fri, 3 Oct 2025 19:17:50 +0000 (15:17 -0400)] 
Standardize log file create mode to 0640

refs: https://github.com/lxc/lxc/issues/4588
Signed-off-by: Randy Syring <randy@syrings.us>
2 months agoMerge pull request #4584 from tenforward/japanese
Stéphane Graber [Mon, 22 Sep 2025 13:38:02 +0000 (09:38 -0400)] 
Merge pull request #4584 from tenforward/japanese

doc: add lxc.environment.{runtime,hooks} in Japanese man page

2 months agodoc: add lxc.environment.{runtime,hooks} in Japanese man page 4584/head
KATOH Yasufumi [Mon, 22 Sep 2025 13:12:53 +0000 (22:12 +0900)] 
doc: add lxc.environment.{runtime,hooks} in Japanese man page

Update for e0290fa

Signed-off-by: KATOH Yasufumi <karma@jazz.email.ne.jp>
2 months agoMerge pull request #4583 from vishwasudupa/main
Stéphane Graber [Thu, 18 Sep 2025 14:33:11 +0000 (10:33 -0400)] 
Merge pull request #4583 from vishwasudupa/main

Enable systemd to create /var/lib/lxc at runtime with StateDirectory

2 months agoEnable systemd to create /var/lib/lxc at runtime with StateDirectory 4583/head
Vishwas Udupa [Wed, 17 Sep 2025 10:56:09 +0000 (03:56 -0700)] 
Enable systemd to create /var/lib/lxc at runtime with StateDirectory

This change adds the StateDirectory= directive in the systemd
unit file to ensure that the /var/lib/lxc directory is
automatically created and managed by systemd during service startup.

The StateDirectory= option instructs systemd to create a persistent
state directory under /var/lib/. This is particularly useful in
scenarios where the directory may be missing at first boot — such as
on OSTree-based Linux distributions, which typically ship with
empty /var directory as part of their immutable root filesystem.

By adding StateDirectory=lxc, systemd will handle the creation of
/var/lib/lxc on first boot, ensuring that the service can start
reliably even when the directory is not present initially.

Signed-off-by: Vishwas Udupa <vudupa@qti.qualcomm.com>
Co-developed-by: Raghuvarya S <raghuvar@qti.qualcomm.com>
2 months agoMerge pull request #4582 from Filiprogrammer/conf-env-split
Stéphane Graber [Tue, 16 Sep 2025 17:23:50 +0000 (13:23 -0400)] 
Merge pull request #4582 from Filiprogrammer/conf-env-split

conf: split `lxc.environment` into `runtime` and `hooks`

2 months agodoc: add lxc.environment.{runtime, hooks} 4582/head
Filip Schauer [Tue, 16 Sep 2025 09:52:27 +0000 (11:52 +0200)] 
doc: add lxc.environment.{runtime, hooks}

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
2 months agoapi_extensions: add environment_runtime_hooks extension
Filip Schauer [Tue, 16 Sep 2025 09:38:11 +0000 (11:38 +0200)] 
api_extensions: add environment_runtime_hooks extension

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
3 months agoconf: split `lxc.environment` into `runtime` and `hooks`
Filip Schauer [Mon, 8 Sep 2025 09:11:31 +0000 (11:11 +0200)] 
conf: split `lxc.environment` into `runtime` and `hooks`

Introduce `lxc.environment.runtime` to set environment variables only
for the container init process and `lxc.environment.hooks` to set
environment variables only for hooks. Leave the original
`lxc.environment` unchanged. It still applies to everything.

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
3 months agoMerge pull request #4579 from stgraber/main
Serge Hallyn [Mon, 8 Sep 2025 02:54:54 +0000 (21:54 -0500)] 
Merge pull request #4579 from stgraber/main

Implement initial protection of LXC monitor using Landlock

3 months agogithub: Enable landlock in tests 4579/head
Stéphane Graber [Sat, 30 Aug 2025 04:45:12 +0000 (00:45 -0400)] 
github: Enable landlock in tests

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
3 months agostart: Add Landlock restrictions to monitor
Stéphane Graber [Wed, 27 Aug 2025 04:22:55 +0000 (00:22 -0400)] 
start: Add Landlock restrictions to monitor

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
3 months agostart: Make lxc_handler mainloop to run in thread
Alexander Mikhalitsyn [Thu, 28 Aug 2025 10:11:34 +0000 (12:11 +0200)] 
start: Make lxc_handler mainloop to run in thread

This allows applying Landlock restrictions just to the monitor handler.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
3 months agomeson: Add optional landlock protection for monitor
Stéphane Graber [Sat, 30 Aug 2025 03:50:00 +0000 (03:50 +0000)] 
meson: Add optional landlock protection for monitor

This introduces a new optional security feature to the LXC monitor process.

With this enabled, the monitor API used for communication between the
CLI (or other clients) and the container monitor will now run in a
dedicated thread and have a Landlock policy applied to that thread.

The thread trick is required as the monitor process is also responsible
for running post-stop tasks (hooks) which need full privileges as well
as also handling full container reboots which similarly require full
privileges.

The policy is pretty simple at this point. It allows access to /dev/pts,
/dev/ptmx and /sys/fs/cgroup as those are the few paths that the monior
actually needs to open (as opposed to just handing out existing
filedescriptors).

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
3 months agocommands: Fix indent
Stéphane Graber [Tue, 26 Aug 2025 14:29:05 +0000 (10:29 -0400)] 
commands: Fix indent

Mix of tab and spaces was making things a bit hard to read.

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
3 months agoMerge pull request #4578 from kadinsayani/fix/broken-readme-link
Stéphane Graber [Wed, 27 Aug 2025 15:20:15 +0000 (11:20 -0400)] 
Merge pull request #4578 from kadinsayani/fix/broken-readme-link

README: update links

3 months agoREADME: update links 4578/head
Kadin Sayani [Wed, 27 Aug 2025 14:08:46 +0000 (08:08 -0600)] 
README: update links

Signed-off-by: Kadin Sayani <kadin.sayani@canonical.com>
4 months agoRename CONTRIBUTING to CONTRIBUTING.md
Alessio Attilio [Fri, 15 Aug 2025 09:20:13 +0000 (11:20 +0200)] 
Rename CONTRIBUTING to CONTRIBUTING.md

Signed-off-by: Alessio Attilio <226562783+SigAttilio@users.noreply.github.com>
4 months agoREADME: Fix CI links
Alessio Attilio [Fri, 15 Aug 2025 08:58:43 +0000 (10:58 +0200)] 
README: Fix CI links

Signed-off-by: Alessio Attilio <226562783+SigAttilio@users.noreply.github.com>
4 months agoMerge pull request #4571 from lxc/dependabot/github_actions/actions/checkout-5 4573/head
Stéphane Graber [Mon, 11 Aug 2025 18:40:38 +0000 (14:40 -0400)] 
Merge pull request #4571 from lxc/dependabot/github_actions/actions/checkout-5

build(deps): bump actions/checkout from 4 to 5

4 months agobuild(deps): bump actions/checkout from 4 to 5 4571/head
dependabot[bot] [Mon, 11 Aug 2025 18:14:32 +0000 (18:14 +0000)] 
build(deps): bump actions/checkout from 4 to 5

Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
4 months agoMerge pull request #4567 from mihalicyn/various_fixes_jul2025
Stéphane Graber [Tue, 29 Jul 2025 14:32:25 +0000 (10:32 -0400)] 
Merge pull request #4567 from mihalicyn/various_fixes_jul2025

A bunch of fixes (Jul 2025)

4 months agoMerge pull request #4565 from Container-On-Android/features
Stéphane Graber [Tue, 29 Jul 2025 14:30:56 +0000 (10:30 -0400)] 
Merge pull request #4565 from Container-On-Android/features

lxc/process_utils.h: use strsignal() or sys_siglist[] for Non-GNU dis…

4 months agolxc/conf: do not leak opts.data memory in __lxc_idmapped_mounts_child() 4567/head
Alexander Mikhalitsyn [Tue, 29 Jul 2025 10:41:11 +0000 (12:41 +0200)] 
lxc/conf: do not leak opts.data memory in __lxc_idmapped_mounts_child()

Fixes: Coverity 1641425
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
4 months agolxc/network: null-terminate ifname string in lxc_network_recv_name_and_ifindex_from_c...
Alexander Mikhalitsyn [Tue, 29 Jul 2025 10:39:34 +0000 (12:39 +0200)] 
lxc/network: null-terminate ifname string in lxc_network_recv_name_and_ifindex_from_child()

Fixes: Coverity 1486538
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
4 months agotests/lxc-test-snapdeps: try to load overlay kernel module
Alexander Mikhalitsyn [Tue, 29 Jul 2025 09:58:53 +0000 (11:58 +0200)] 
tests/lxc-test-snapdeps: try to load overlay kernel module

We don't want test to be skipped just because overlay module
isn't loaded yet.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
4 months agotests/lxc-test-rootfs: add idmapped rootfs testcase
Alexander Mikhalitsyn [Tue, 29 Jul 2025 09:32:13 +0000 (11:32 +0200)] 
tests/lxc-test-rootfs: add idmapped rootfs testcase

I've discovered that we have no test coverage for rootfs
"lxc.rootfs.options = idmap=container" at all.

Let's add this basic test at least.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
4 months agoMerge pull request #4566 from mihalicyn/enter_net_ns_errors_fix
Stéphane Graber [Mon, 28 Jul 2025 18:01:53 +0000 (14:01 -0400)] 
Merge pull request #4566 from mihalicyn/enter_net_ns_errors_fix

lxc/lxccontainer: stop printing misleading errors in enter_net_ns()

4 months agolxc/lxccontainer: stop printing misleading errors in enter_net_ns() 4566/head
Alexander Mikhalitsyn [Mon, 28 Jul 2025 17:00:29 +0000 (19:00 +0200)] 
lxc/lxccontainer: stop printing misleading errors in enter_net_ns()

In enter_net_ns() we try to enter network namespace at first, before
entering a user namespace to support inherited netns case properly.
It is expected to get EPERM for unprivileged container with non-shared
network namespace at first try. Let's take this into account
and stop misleading users with these error messages.

Link: https://discuss.linuxcontainers.org/t/lxc-ls-fancy-command-shows-operation-not-permitted/24080
Fixes: 3011e79f92ef ("lxccontainer: fix enter_net_ns helper to work when netns is inherited")
Fixes: #4560
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
4 months agolxc/process_utils.h: use strsignal() or sys_siglist[] for Non-GNU distros 4565/head
Li Lu [Mon, 28 Jul 2025 15:27:35 +0000 (23:27 +0800)] 
lxc/process_utils.h: use strsignal() or sys_siglist[] for Non-GNU distros

use strsignal() for Non-GNU and sys_siglist[] for nothing, even if sys_siglist[] has been marked as deprecated by Glibc

Signed-off-by: Li Lu <1487442471@qq.com>
4 months agoMerge pull request #4564 from Container-On-Android/fix/meson.build
Stéphane Graber [Mon, 28 Jul 2025 15:03:32 +0000 (11:03 -0400)] 
Merge pull request #4564 from Container-On-Android/fix/meson.build

meson.build: fix checks for fsconfig and calls

4 months agomeson.build: use has_header_symbol() instead of get_define() to improve compatibility 4564/head
DreamConnected [Fri, 25 Jul 2025 16:05:43 +0000 (00:05 +0800)] 
meson.build: use has_header_symbol() instead of get_define() to improve compatibility

Signed-off-by: DreamConnected <1487442471@qq.com>
4 months agomeson.build: fix checks for fsconfig and calls
Li Lu [Thu, 24 Jul 2025 02:06:41 +0000 (10:06 +0800)] 
meson.build: fix checks for fsconfig and calls

move Headers checks up to Calls. keep fsconfig checks on openSUSE #4176

Signed-off-by: Li Lu <1487442471@qq.com>
6 months agoMerge pull request #4557 from RomanGenexis/meson-specfile-distrosysconfdir
Stéphane Graber [Mon, 2 Jun 2025 15:22:02 +0000 (11:22 -0400)] 
Merge pull request #4557 from RomanGenexis/meson-specfile-distrosysconfdir

meson.build: set `LXC_DISTRO_SYSCONF` when `-Dspecfile=true`

6 months agomeson.build: set `LXC_DISTRO_SYSCONF` when `-Dspecfile=true` 4557/head
Roman Azarenko [Sat, 31 May 2025 12:55:01 +0000 (14:55 +0200)] 
meson.build: set `LXC_DISTRO_SYSCONF` when `-Dspecfile=true`

Before the change, the `setup` meson step would fail when disabling the
`install-init-files` option:

$ meson setup -Dinstall-init-files=false build
<snip>
meson.build:936:44: ERROR: Entry LXC_DISTRO_SYSCONF not in configuration data.

This is because setting the `LXC_DISTRO_SYSCONF` option is conditional
and requires `install-init-files` to be enabled.

Meanwhile the `specfile` option (default enabled) also requires the
variable above, resulting in a failure when it is unset.

Amend the conditional to also set `LXC_DISTRO_SYSCONF` when `specfile`
option is `true`.

Fixes: 872db5424363 ("build: add more options for customizing install")
Signed-off-by: Roman Azarenko <roman.azarenko+gh@genexis.eu>
6 months agoMerge pull request #4555 from gibmat/add-loong64-personality
Stéphane Graber [Thu, 22 May 2025 01:44:54 +0000 (21:44 -0400)] 
Merge pull request #4555 from gibmat/add-loong64-personality

Add loong64 to list of recognized architectures

6 months agoAdd loong64 to list of recognized architectures 4555/head
Mathias Gibbens [Wed, 21 May 2025 23:29:30 +0000 (23:29 +0000)] 
Add loong64 to list of recognized architectures

Debian refers to the loong architecture as "loong64".

Signed-off-by: Mathias Gibbens <gibmat@debian.org>
7 months agoMerge pull request #4554 from mihalicyn/no-new-privs-regression-fix
Stéphane Graber [Tue, 13 May 2025 17:39:58 +0000 (13:39 -0400)] 
Merge pull request #4554 from mihalicyn/no-new-privs-regression-fix

Revert (delay assumption of apparmor labels) to fix a regression

7 months agoRevert "re-add onexec for apparmor, move label assumption until after container has... 4554/head
Alexander Mikhalitsyn [Tue, 13 May 2025 12:59:35 +0000 (14:59 +0200)] 
Revert "re-add onexec for apparmor, move label assumption until after container has been setup for attach"

This reverts commit 50dee37cfe3201ed51f477356f81941c960a5511.

Fixes: #4553
Bisected-by: Simon Deziel <simon.deziel@canonical.com>
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
7 months agoMerge pull request #4552 from mihalicyn/fix_fuzzing_stuff
Stéphane Graber [Tue, 13 May 2025 03:19:16 +0000 (23:19 -0400)] 
Merge pull request #4552 from mihalicyn/fix_fuzzing_stuff

src/tests/oss-fuzz: pin meson to 1.7.2 to workaround build failures

7 months agosrc/tests/oss-fuzz: pin meson to 1.7.2 to workaround build failures 4552/head
Alexander Mikhalitsyn [Mon, 12 May 2025 10:05:59 +0000 (12:05 +0200)] 
src/tests/oss-fuzz: pin meson to 1.7.2 to workaround build failures

See also
https://github.com/google/oss-fuzz/pull/13286/commits/093b2480ce44c38c2418c20df2212f56b9e7fbd2

Thanks to Evgeny Vereshchagin

Fixes: #4551
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
7 months agoMerge pull request #4547 from mihalicyn/mnt_opts_parsing_impr
Stéphane Graber [Sat, 10 May 2025 16:42:28 +0000 (12:42 -0400)] 
Merge pull request #4547 from mihalicyn/mnt_opts_parsing_impr

Mount options (lxc.mount.entry) handling improvements

7 months agolxc/conf: support flag kind of mount options in lxc.mount.entry options 4547/head
Alexander Mikhalitsyn [Mon, 5 May 2025 16:03:10 +0000 (18:03 +0200)] 
lxc/conf: support flag kind of mount options in lxc.mount.entry options

Currently, if user wants to use a flag-like mount option in lxc.mount.entry,
for example "userxattr" with overlayfs then it will be silently ignored.

Let's fix that by making parse_vfs_attr() to process all mount options.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
7 months agolxc/conf: support nosymfollow mount flag
Alexander Mikhalitsyn [Mon, 5 May 2025 16:01:38 +0000 (18:01 +0200)] 
lxc/conf: support nosymfollow mount flag

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
7 months agoMerge pull request #4550 from stgraber/main
Serge Hallyn [Sat, 10 May 2025 02:27:51 +0000 (21:27 -0500)] 
Merge pull request #4550 from stgraber/main

conf: Add support for "move" mount flag

7 months agoconf: Add support for "move" mount flag 4550/head
Stéphane Graber [Sat, 10 May 2025 01:18:42 +0000 (21:18 -0400)] 
conf: Add support for "move" mount flag

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
7 months agoMerge pull request #4549 from mihalicyn/lxc-ci-enable-more-tests
Stéphane Graber [Fri, 9 May 2025 17:11:53 +0000 (13:11 -0400)] 
Merge pull request #4549 from mihalicyn/lxc-ci-enable-more-tests

re-enable some tests

7 months agosrc/tests/lxc-test-unpriv: prevent fail on cleanup path 4549/head
Alexander Mikhalitsyn [Fri, 9 May 2025 12:32:55 +0000 (14:32 +0200)] 
src/tests/lxc-test-unpriv: prevent fail on cleanup path

/run/user/$(id -u $TUSER) is a mountpoint for tmpfs, rm -rf
may fail with EBUSY errno. We should mask it and prevent test from marked
as failed because of this.

Also add set -x to make debugging easier in case of failures.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
7 months agosrc/tests/lxc-test-apparmor-mount: prevent fail on cleanup path
Alexander Mikhalitsyn [Fri, 9 May 2025 12:30:39 +0000 (14:30 +0200)] 
src/tests/lxc-test-apparmor-mount: prevent fail on cleanup path

/run/user/$(id -u $TUSER) is a mountpoint for tmpfs, rm -rf
may fail with EBUSY errno. We should mask it and prevent test from marked
as failed because of this.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
7 months agosrc/tests/lxc-test-apparmor-generated: enable test
Alexander Mikhalitsyn [Fri, 9 May 2025 12:29:07 +0000 (14:29 +0200)] 
src/tests/lxc-test-apparmor-generated: enable test

Remove "exit 0" at the beginning of a test to make it actually run.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
7 months agoMerge pull request #4548 from simondeziel/ubuntu-14.04
Stéphane Graber [Thu, 8 May 2025 21:07:47 +0000 (17:07 -0400)] 
Merge pull request #4548 from simondeziel/ubuntu-14.04

meson.build: remove quirk for Ubuntu 14.04 libcap-dev

7 months agomeson.build: remove quirk for Ubuntu 14.04 libcap-dev 4548/head
Simon Deziel [Thu, 8 May 2025 19:07:30 +0000 (15:07 -0400)] 
meson.build: remove quirk for Ubuntu 14.04 libcap-dev

After some research, it seems that Ubuntu 14.10's libcap-dev package corrected
the mistake and shiped the `.pc` file.

Both Ubuntu releases are very old now so remove the workaround.

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
7 months agoMerge pull request #4539 from ianmerin/main
Serge Hallyn [Sat, 3 May 2025 03:36:01 +0000 (22:36 -0500)] 
Merge pull request #4539 from ianmerin/main

delay assumption of apparmor labels

7 months agoapparmor test: add an overlay container start 4539/head
Serge Hallyn [Fri, 18 Apr 2025 03:51:45 +0000 (03:51 +0000)] 
apparmor test: add an overlay container start

make sure that when we start an overlay container, the
init pid is aa-confined.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
7 months agore-add onexec for apparmor, move label assumption until after container has been...
Ian Merin [Tue, 8 Apr 2025 16:27:26 +0000 (12:27 -0400)] 
re-add onexec for apparmor, move label assumption until after container has been setup for attach

Signed-off-by: Ian Merin <Ian.Merin@ncipher.com>
7 months agoMerge pull request #4544 from RomanGenexis/4198-fix-container-ttys-env
Serge Hallyn [Fri, 25 Apr 2025 20:39:17 +0000 (15:39 -0500)] 
Merge pull request #4544 from RomanGenexis/4198-fix-container-ttys-env

lxc/conf,start: fix setting container_ttys environment variable

7 months agolxc/conf,start: fix setting container_ttys environment variable 4544/head
Roman Azarenko [Tue, 22 Apr 2025 07:16:13 +0000 (09:16 +0200)] 
lxc/conf,start: fix setting container_ttys environment variable

Commit eae44ce19931 ("conf: fix append_ttyname()") changed the format
of `conf->ttys.tty_names`, where the `container_ttys=` prefix was
removed.

This seems to have been taken into account in `lxc_create_ttys()` in
`src/lxc/conf.c`, however that's not enough. `do_start()` in
`src/lxc/start.c` clears the environment, and then does `putenv(...)`
directly on the value of `tty_names`. As it no longer has the
`container_ttys=` prefix, this call doesn't have the intended effect.

This behaviour is also confirmed via `ltrace` when doing `lxc-start`:

[pid 53587] liblxc.so.1->setenv("container_ttys", "pts/1 pts/2 pts/3 pts/4", 1) = 0
[pid 53587] liblxc.so.1->clearenv(0, 1, 0, 0)                                   = 0
[pid 53587] liblxc.so.1->putenv("container=lxc")                                = 0
[pid 53587] liblxc.so.1->putenv("pts/1 pts/2 pts/3 pts/4")                      = 0

Given that `do_start()` clears the environment anyway, there is no
reason for another `setenv()` call in `lxc_create_ttys()`, and a fix
is required for `putenv()` in `do_start()`.

Change the `putenv()` call to `setenv()` in `do_start()` to account
for the change of format in `conf->ttys.tty_names`. Remove extraneous
`setenv()` from `lxc_create_ttys()`.

Fixes #4198

Fixes: eae44ce19931 ("conf: fix append_ttyname()")
Signed-off-by: Roman Azarenko <roman.azarenko+gh@genexis.eu>