Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
29cd84d
Add description for unprivileged containers to Japanese man page
tenforward Mar 1, 2026
a01f7b4
Add --rbuser to Japanese lxc-create(1)
tenforward Mar 1, 2026
f726606
Merge pull request #4653 from tenforward/japanese
stgraber Mar 1, 2026
e4d847b
build(deps): bump actions/upload-artifact from 6 to 7
dependabot[bot] Mar 2, 2026
159b554
Merge pull request #4654 from lxc/dependabot/github_actions/actions/u…
stgraber Mar 2, 2026
589981f
utils: Add quotes around exec arguments
stgraber Mar 10, 2026
c952cb7
Merge pull request #4659 from stgraber/main
hallyn Mar 10, 2026
7174f2e
utils: Update buffer size to account for quotes
stgraber Mar 10, 2026
2bc6bac
utils: Only single quote our own arguments
stgraber Mar 10, 2026
7c51596
Merge pull request #4660 from stgraber/main
stgraber Mar 10, 2026
f5641d6
Fix issue where pidfd_ functions were not being detected during meson…
alex14641 Mar 10, 2026
9a10e4e
Merge pull request #4658 from alex14641/main
stgraber Mar 12, 2026
110974e
Fix issue where memfd functions were not being detected during meson …
alex14641 Mar 14, 2026
2899de6
Merge pull request #4665 from alex14641/fix-memfd
stgraber Mar 14, 2026
cf5e950
tests: mount_injection: ensure cleanup on test failure
akash-hadke Feb 2, 2026
16e4670
Merge pull request #4639 from akash-hadke/patch-1
stgraber Mar 15, 2026
88b44a5
cgroups: Skip systemd dbus logic when not using systemd
alex14641 Mar 15, 2026
a6c80ff
Merge pull request #4666 from alex14641/fix-hang
stgraber Mar 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
mv ../lxc_* out/

- name: Upload resulting build
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
continue-on-error: true
with:
name: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fuzzing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
sanitizer: ${{ matrix.sanitizer }}

- name: Upload Crash
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
if: failure() && steps.build.outcome == 'success'
with:
name: ${{ matrix.sanitizer }}-artifacts
Expand Down
2 changes: 2 additions & 0 deletions doc/ja/lxc-create.sgml.in
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,12 @@
You can specify the following options :
<replaceable>&#045;&#045;rbdname RBDNAME</replaceable> will create a blockdevice named RBDNAME rather than the default, which is the container name.
<replaceable>&#045;&#045;rbdpool POOL</replaceable> will create the blockdevice in the pool named POOL, rather than the default, which is 'lxc'.
<replaceable>\-\-rbduser RBDUSER</replaceable> will specify the ceph user RBDUSER creating the blockdevice, rather than the default, which is 'admin'.
-->
backingstore が 'rbd' の場合、<filename>ceph.conf</filename> に有効な設定がされており、<filename>ceph.client.admin.keyring</filename> が定義されている必要があります。
<replaceable>--rbdname RBDNAME</replaceable> を指定すると、RBDNAME という名前のブロックデバイスを作成します。このオプションを指定しない場合のデフォルトのブロックデバイス名はコンテナ名です。
<replaceable>--rbdpool POOL</replaceable> を指定すると、POOL という名前のプール内にブロックデバイスを作成します。このオプションを指定しない場合のデフォルトのプール名は 'lxc' です。
<replaceable>--rbduser RBDUSER</replaceable> を指定すると、RBDUSER という ceph ユーザを指定してブロックデバイスを作成します。このオプションを指定しない場合のデフォルトのユーザ名は 'admin' です。
</para>
<para>
<!--
Expand Down
18 changes: 18 additions & 0 deletions doc/ja/lxc.sgml.in
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,24 @@ rootfs
で説明しています。
</refsect2>

<refsect2>
<title><!-- Unprivileged containers -->非特権コンテナ</title>
<para>
<!--
Unprivileged LXC containers run without root host-level privileges in a
user namespace, mapping container UID 0 to a non-root host ID, which
strictly limits the accessible devices and filesystems of the
container. In order to mount a rootfs in an unprivileged container, the
mapped host user must have execute permissions for all directories
along the path to and including the rootfs. Additionally, all files and
directories under the rootfs must be owned by the correct user ID and
group ID. The correct user ID and group ID are the host IDs mapped to
the container root(UID 0) in lxc.idmap.
-->
非特権 LXC コンテナは、ユーザ名前空間内で root のホストレベルの特権がない状態で実行されます。コンテナの UID 0 は、root ではないホストの ID にマッピングされ、コンテナのアクセス可能なデバイスとファイルシステムが厳密に制限されます。非特権コンテナ内で rootfs をマウントするためには、マッピングされたホストのユーザが、rootfs ディレクトリ自身を含む、rootfs までのパス上にあるすべてのディレクトリに対して実行権限を持っている必要があります。さらに、rootfs 以下のすべてのファイルとディレクトリは、正しいユーザ ID とグループ ID が所有している必要があります。正しいユーザ ID とグループ ID とは、lxc.idmap でコンテナの root(UID 0)にマッピングされているホストの ID です。
</para>
</refsect2>

<refsect2>
<title><!-- Creating / Destroying containers -->コンテナの作成と削除</title>
<para>
Expand Down
4 changes: 3 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -576,10 +576,12 @@ foreach ident: [
['personality', '''#include <sys/personality.h>'''],
['pidfd_open', '''#include <stdlib.h>
#include <unistd.h>
#include <sys/pidfd.h>
#include <signal.h>
#include <sys/wait.h>'''],
['pidfd_send_signal', '''#include <stdlib.h>
#include <unistd.h>
#include <sys/pidfd.h>
#include <signal.h>
#include <sys/wait.h>'''],
['pivot_root', '''#include <stdlib.h>
Expand Down Expand Up @@ -809,7 +811,7 @@ found_headers = []
missing_headers = []
foreach tuple: [
['sys/resource.h'],
['sys/memfd.h'],
['linux/memfd.h'],
['sys/personality.h'],
['sys/pidfd.h'],
['sys/signalfd.h'],
Expand Down
3 changes: 3 additions & 0 deletions src/lxc/cgroups/cgfsng.c
Original file line number Diff line number Diff line change
Expand Up @@ -1521,6 +1521,9 @@ static int unpriv_systemd_create_scope(struct cgroup_ops *ops, struct lxc_conf *
__attribute__((__cleanup__(_dbus_connection_free))) DBusConnection *connection = NULL;
unsigned int len;

if (!file_exists("/run/systemd/system"))
return log_info(SYSTEMD_SCOPE_UNSUPP, "Not a systemd system or systemd not running");

if (geteuid() == 0)
return log_info(SYSTEMD_SCOPE_UNSUPP, "Running privileged, not using a systemd unit");

Expand Down
12 changes: 6 additions & 6 deletions src/lxc/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,13 +600,13 @@ int run_script_argv(const char *name, unsigned int hook_version,

if (hook_version == 0) {
size += strlen(hookname);
size++;
size += 3;

size += strlen(name);
size++;
size += 3;

size += strlen(section);
size++;
size += 3;

if (size > INT_MAX)
return -EFBIG;
Expand All @@ -617,7 +617,7 @@ int run_script_argv(const char *name, unsigned int hook_version,
return -ENOMEM;

if (hook_version == 0)
buf_pos = strnprintf(buffer, size, "exec %s %s %s %s", script, name, section, hookname);
buf_pos = strnprintf(buffer, size, "exec %s '%s' '%s' '%s'", script, name, section, hookname);
else
buf_pos = strnprintf(buffer, size, "exec %s", script);
if (buf_pos < 0)
Expand Down Expand Up @@ -706,13 +706,13 @@ int run_script(const char *name, const char *section, const char *script, ...)
size += strlen(script);
size += strlen(name);
size += strlen(section);
size += 4;
size += 8;

if (size > INT_MAX)
return -1;

buffer = must_realloc(NULL, size);
ret = strnprintf(buffer, size, "exec %s %s %s", script, name, section);
ret = strnprintf(buffer, size, "exec %s '%s' '%s'", script, name, section);
if (ret < 0)
return -1;

Expand Down
12 changes: 8 additions & 4 deletions src/tests/mount_injection.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,20 +409,24 @@ static void lxc_teardown_shmount(char *shmount_path)

int main(int argc, char *argv[])
{
int ret = EXIT_SUCCESS;

if (!lxc_setup_shmount("/tmp/mount_injection_test"))
exit(EXIT_FAILURE);

if (do_priv_container_test()) {
fprintf(stderr, "Privileged mount injection test failed\n");
exit(EXIT_FAILURE);
ret = EXIT_FAILURE;
goto out;
}

if (do_unpriv_container_test()) {
fprintf(stderr, "Unprivileged mount injection test failed\n");
exit(EXIT_FAILURE);
ret = EXIT_FAILURE;
goto out;
}

out:
lxc_teardown_shmount("/tmp/mount_injection_test");

exit(EXIT_SUCCESS);
exit(ret);
}