]> git.ipfire.org Git - thirdparty/lxc.git/log
thirdparty/lxc.git
8 days agotests/lxc-attach: ensure no data corruption happens during heavy IO on pts 4633/head
Alexander Mikhalitsyn [Wed, 21 Jan 2026 17:20:30 +0000 (18:20 +0100)] 
tests/lxc-attach: ensure no data corruption happens during heavy IO on pts

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io>
8 days agolxc/{terminal, file_utils}: ensure complete data writes in ptx/peer io handlers
DreamConnected [Sun, 26 Oct 2025 05:28:13 +0000 (13:28 +0800)] 
lxc/{terminal, file_utils}: ensure complete data writes in ptx/peer io handlers

Previously, lxc_write_nointr could return without writing all data
when write() returned EAGAIN/EWOULDBLOCK due to buffer full conditions.

This change:
- Implements a loop to continue writing until all data is sent
- Handles EINTR, EAGAIN, and EWOULDBLOCK errors appropriately
- Uses poll() to wait for fd to become ready when blocked
- Maintains backward compatibility while fixing partial write issues

Signed-off-by: DreamConnected <1487442471@qq.com>
[ alex ]
- introduce a separate helper lxc_write_all and use it only in ptx/peer
  io handlers
- cleanup the code a bit
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io>
11 days agoMerge pull request #4631 from mihalicyn/io_uring_ci_test
Stéphane Graber [Mon, 19 Jan 2026 16:14:45 +0000 (11:14 -0500)] 
Merge pull request #4631 from mihalicyn/io_uring_ci_test

github: test io_uring-based event loop

11 days agogithub: test io_uring-based event loop 4631/head
Alexander Mikhalitsyn [Mon, 19 Jan 2026 14:21:03 +0000 (15:21 +0100)] 
github: test io_uring-based event loop

Previously, I've added https://github.com/lxc/lxc-ci/pull/714,
but this stuff was lost during our switch to GH Actions
from Jenkins.

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@futurfusion.io>
3 weeks agoMerge pull request #4574 from attil1o/main
Stéphane Graber [Thu, 8 Jan 2026 13:46:19 +0000 (08:46 -0500)] 
Merge pull request #4574 from attil1o/main

Improve build flow

3 weeks agobuild: update Makefile and meson.build 4574/head
Alessio Attilio [Wed, 7 Jan 2026 17:12:05 +0000 (18:12 +0100)] 
build: update Makefile and meson.build

Update Makefile to use 'build' directory and add helper targets. Fix syntax error in meson.build.

Signed-off-by: Alessio Attilio <alessio.attilio@engineer.com>
5 weeks agoMerge pull request #4629 from hallyn/2025-12-25/dbus-errors
Stéphane Graber [Fri, 26 Dec 2025 12:26:53 +0000 (07:26 -0500)] 
Merge pull request #4629 from hallyn/2025-12-25/dbus-errors

Improve the dbus scope creation error handling

5 weeks agoImprove the dbus scope creation error handling 4629/head
Serge Hallyn [Fri, 26 Dec 2025 03:50:53 +0000 (21:50 -0600)] 
Improve the dbus scope creation error handling

If there is an actual dbus error, then return an error.  If we
have gotten a message that isn't what we are expecting, then keep
waiting.

Also put a time limit on our wiating for a reply.  Until now, we
were waiting indefinitely, causing the lxc monitor to hang.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
5 weeks agoMerge pull request #4628 from hallyn/2025-12-23/fix-dbus-scope-reboot
Stéphane Graber [Tue, 23 Dec 2025 20:10:08 +0000 (15:10 -0500)] 
Merge pull request #4628 from hallyn/2025-12-23/fix-dbus-scope-reboot

cgfsng: fix reboots when using dbus

5 weeks agocgfsng: fix reboots when using dbus 4628/head
Serge Hallyn [Tue, 23 Dec 2025 19:56:31 +0000 (13:56 -0600)] 
cgfsng: fix reboots when using dbus

When using dbus on a systemd system, we ask systemd to create a
"scope" for us to run in.  We send a dbus message, and wait
for the reply saying it is created.

When we reboot, we were re-sending the request to create the
scope.  However, the scope still exists, because or single
lxc-monitor (originally lxc-start) thread is still under the
'lxc.pivot' sub-directory of the scope.

But, on reboot, our lxc_conf already has our scope recorded!
So, just check whether that is set, and skip scope creation
if so.

With this patch, i can reboot ad nauseum with no apparent
problems.

We could probably move this check to the top of the function,
but for now this fixes the bug.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
6 weeks agoMerge pull request #4616 from chackoj-1204/doc/unprivileged-containers-section
Stéphane Graber [Tue, 16 Dec 2025 04:08:36 +0000 (23:08 -0500)] 
Merge pull request #4616 from chackoj-1204/doc/unprivileged-containers-section

Added documentation on unprivileged LXC containers

6 weeks agoMerge pull request #4626 from Filiprogrammer/fix-init-groups-in-userns
Stéphane Graber [Tue, 16 Dec 2025 02:46:04 +0000 (21:46 -0500)] 
Merge pull request #4626 from Filiprogrammer/fix-init-groups-in-userns

Do not ignore lxc.init.groups when using userns

6 weeks agoMerge pull request #4624 from James-Featherston/issue-4514
Stéphane Graber [Tue, 16 Dec 2025 02:28:24 +0000 (21:28 -0500)] 
Merge pull request #4624 from James-Featherston/issue-4514

Fix "lxc-copy with overlayfs throws an error"

6 weeks agocopy_rdepends: Don't fail on missing source file 4624/head
jamesfeatherston [Sun, 14 Dec 2025 00:49:57 +0000 (18:49 -0600)] 
copy_rdepends: Don't fail on missing source file

Signed-off-by: jamesfeatherston <jamesfeatherston@utexas.edu>
6 weeks agostart: Respect lxc.init.groups also in new user namespace 4626/head
Filip Schauer [Mon, 15 Dec 2025 15:03:43 +0000 (16:03 +0100)] 
start: Respect lxc.init.groups also in new user namespace

Fix supplementary groups defined in 'lxc.init.groups' being ignored when
the container uses a new user namespace.

In other words: Fix lxc.init.groups for unprivileged containers.

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
6 weeks agostart: Remove outdated comment about group dropping
Filip Schauer [Mon, 15 Dec 2025 14:59:31 +0000 (15:59 +0100)] 
start: Remove outdated comment about group dropping

Commit b58214ac30bd (tree-wide: improve setgroups() dropping) moved the
group dropping code to occur before lxc_switch_uid_gid. Therefore this
comment is no longer correct.

Signed-off-by: Filip Schauer <f.schauer@proxmox.com>
6 weeks agoMerge pull request #4615 from chackoj-1204/meson-build-enable-api-docs
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

6 weeks 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

6 weeks 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>
7 weeks agoAdded documentation on unprivileged LXC containers 4616/head
Jake Chacko [Tue, 2 Dec 2025 02:47:53 +0000 (20:47 -0600)] 
Added documentation on unprivileged LXC containers

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>
7 weeks 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"

7 weeks 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>
7 weeks 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>
7 weeks 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"

8 weeks 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

8 weeks 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>
8 weeks 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

8 weeks 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>
8 weeks 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

8 weeks 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>
8 weeks 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>
8 weeks 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>
8 weeks 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 months 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 months 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>
2 months 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

2 months 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>
2 months 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>
2 months 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

2 months 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>
2 months 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

3 months 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>
3 months 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

3 months 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>
3 months 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>
3 months 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

3 months 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>
3 months 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

3 months 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>
3 months 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

3 months 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

3 months 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>
3 months 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>
3 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

3 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>
3 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

3 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>
3 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()

3 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>
3 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

3 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>
4 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

4 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>
4 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

4 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>
4 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`

4 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>
4 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>
4 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>
4 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

5 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>
5 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>
5 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>
5 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>
5 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>
5 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

5 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>
5 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>
5 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>
5 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

5 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>
6 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)

6 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…

6 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>
6 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>
6 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>
6 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>
6 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()

6 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>
6 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>
6 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

6 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>
6 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>
7 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`

8 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>
8 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

8 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>
8 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

8 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>
8 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