1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-04 09:18:12 +03:00
Commit Graph

78332 Commits

Author SHA1 Message Date
Lennart Poettering
a8f6814be8 update TODO 2024-12-20 22:17:06 +01:00
Lennart Poettering
1fa2c9ed26 test: test comprehensive tests for new (and old) nspawn userns modes 2024-12-20 22:17:06 +01:00
Lennart Poettering
327daea5e9 man: document new nspawn functionality around unpriv support 2024-12-20 22:17:06 +01:00
Lennart Poettering
29df5667c3 nspawn: add support for 'managed' userns mode even when we run privileged 2024-12-20 22:17:06 +01:00
Lennart Poettering
9eef1fe103 nspawn: drop duplicate logic for moving to an alternative root to operate on
We actually already have this logic in run(), that under
various conditions uses a different root fs to operate on. No need to do
this twice.

(Or to say this in stronger words: this is dead code, because run()
aleady moved the root fs to something else if it sees "/" being used.
2024-12-20 22:17:06 +01:00
Lennart Poettering
26a48aee01 nspawn: close root mount fd when we don't need it anymore 2024-12-20 22:17:06 +01:00
Lennart Poettering
f48026f74a nspawn: drop some redundant {} 2024-12-20 22:17:06 +01:00
Lennart Poettering
7fb9144e65 nspawn: improve log messages a bit 2024-12-20 22:17:06 +01:00
Lennart Poettering
a440d138a5 nspawn: support foreign mappings also when nspawn doing the mapping itself 2024-12-20 22:17:06 +01:00
Lennart Poettering
5f1ac9e3c0 cgroup: when we fail to clean up a cgroup, let's ask PID 1 for help 2024-12-20 22:17:06 +01:00
Lennart Poettering
dd0b3a9215 pid1: add D-Bus API for removing delegated subcgroups
When running unprivileged containers, we run into a scenario where an
unpriv owned cgroup has a subcgroup delegated to another user (i.e. the
container's own UIDs). When the owner of that cgroup dies without
cleaning it up then the unpriv service manager might encounter a cgroup
it cannot delete anymore.

Let's address that: let's expose a method call on the service manager
(primarly in PID1) that can be used to delete a subcgroup of a unit one
owns. This would then allow the unpriv service manager to ask the priv
service manager to get rid of such a cgroup.

This commit only adds the method call, the next commit then adds the
code that makes use of this.
2024-12-20 22:17:06 +01:00
Lennart Poettering
6bfbdd3110 pid1: allow moving processes in a userns owned by the user, too 2024-12-20 22:17:06 +01:00
Lennart Poettering
02ab91301c namespace-util: add process_is_owned_by_uid() helper 2024-12-20 22:17:06 +01:00
Lennart Poettering
a23142a361 namespace-util: add helper to get base UID from userns 2024-12-20 22:17:06 +01:00
Lennart Poettering
fedc35489b dissect: employ vpick also if we operate on a directory-based image 2024-12-20 22:17:06 +01:00
Lennart Poettering
655265526a dissect: add a bit of color to --discover table 2024-12-20 22:17:06 +01:00
Lennart Poettering
90b730eacc dissect: show all kinds of images in --discover
Given that systemd-dissect can nowadays operate on plain directories,
let's include directory images in the --discover output too.

Replace the filter with a filter for hidden images instead, as suddenly
the root fs image (which is a directory image ".host") otherwise shows up.
2024-12-20 22:17:05 +01:00
Lennart Poettering
fd7266383a nspawn: allow to run unpriv from dir 2024-12-20 22:15:21 +01:00
Lennart Poettering
7149009417 dissect: add new --shift command 2024-12-20 22:15:18 +01:00
Lennart Poettering
f979247bb9 nspawn: move uid shift/chown() code into shared/ 2024-12-20 22:13:05 +01:00
Lennart Poettering
1703d200f8 dissect-image: add client side API wrapper for MountDirectory() varlink call 2024-12-20 22:13:05 +01:00
Lennart Poettering
6e50124e24 mntfsd: add api to mount dirs for containers
Note that we have to drop various sandboxing knobs from the mountfsd
service file for this to work, since the kernel's security checks that
try to ensure than an obstructued /proc/ cannot be circumvented via
mounting a new procfs will otherwise prohibit mountfsd to duplicate the
mounts properly.
2024-12-20 22:13:05 +01:00
Lennart Poettering
a0b9d4d296 userdb: synthesize stub user records for the foreign UID 2024-12-20 22:13:05 +01:00
Lennart Poettering
19634b0c69 user-classification: add new "foreign" UID range
This makes the UID range configurable via build time options, but of
course it really shouldn't be changed. The default range I picked is
outside even of IPAs current (ridiculously large) allocation ranges,
hence hopefully minimizes conflicts.
2024-12-20 22:13:05 +01:00
Lennart Poettering
796d87aa73 dissect: minor simplifications 2024-12-20 22:13:05 +01:00
Lennart Poettering
4ee940f5e2 dissect-image: rename ReplyParameters → MountImageReplyParameters 2024-12-20 22:13:05 +01:00
Lennart Poettering
c448f9c015 nsresourced: add ability to mangle specified name if necessary
Let's optionally mangle any passed name on the server side so that it is
useful for identifying a userns, if it isn't suitable for that
right-away. This mostl means truncating it if too long.

It's just too nasty to leave this to the client side, since they'd have
to understand the precise rules for naming userns then.

While we are at it, add full Varlink IDL comments.
2024-12-20 22:13:05 +01:00
Lennart Poettering
86895e29c8 nspawn: rework userns_mkdir() around chase() 2024-12-20 22:13:05 +01:00
Lennart Poettering
56ffb40ad4 fs-util: fail xopenat() when called with O_EXCL but without file name with EEXIST 2024-12-20 22:13:05 +01:00
Lennart Poettering
674f29d402 fs-util: teach xopenat_full() to pick automatically if given as MODE_INVALID 2024-12-20 22:13:05 +01:00
Lennart Poettering
ccaa76ac48
image-discovery: add per-user scope (#35510) 2024-12-20 22:12:35 +01:00
Lennart Poettering
2232038187
pid1: complete per-user credentials support (#35536)
Fixes: #33887 #33796 #33318
2024-12-20 22:12:08 +01:00
Lennart Poettering
1563404159
analyze: extend CHID support to more types (#35699)
Let's implement the spec more comprehensively.

This is piece by piece work, There's more to do on the EFI side before
all CHID types are supported, but in userspace it should be reasonably
complete now.
2024-12-20 22:11:39 +01:00
Daan De Meyer
2138278d25
Various mkosi improvements (#35684) 2024-12-20 21:24:51 +01:00
Daan De Meyer
34b5a27b0b docs: Simplify hacking documentation
Let's use "mkosi sandbox" in the docs so that users can build systemd
without having to install anything except mkosi. Using mkosi sandbox
will use tools and dependencies from the tools tree which is also used
in CI and thus has a higher chance of working from the first try compared
to whatever tools might be installed on the host system of a new contributor.
2024-12-20 20:09:36 +01:00
Daan De Meyer
ba3f148307 mkosi.clangd: Fail on command errors 2024-12-20 20:09:36 +01:00
Daan De Meyer
b133f57544 mkosi.clangd: Don't pass --host if we're not using flatpak-spawn 2024-12-20 20:09:36 +01:00
Daan De Meyer
8c5b4df543 mkosi: Use build/ as extra search path by default
Building systemd with mkosi generally requires a very recent version
of systemd which might not be installed on the host. Let's configure
mkosi to look for extra executables in the build/ directory by default
so that we prefer systemd executables from the build directory over those
on the host as those on the host are likely to be too old.
2024-12-20 20:09:36 +01:00
Daan De Meyer
1995084a9e mkosi: Use tools tree by default
Let's enable usage of a tools tree by default to simplify the setup
for new contributors and save them from having to install or upgrade
a bunch of extra tools to get mkosi working as expected.
2024-12-20 20:09:35 +01:00
Daan De Meyer
ac1a711d9a mkosi: Enable EPEL for CentOS Stream tools tree
We need packages from EPEL to be able to build CentOS Stream images
with a CentOS Stream tools tree so enable it. This is broken on CentOS
Stream 10 but given using a CentOS Stream tools tree is broken without
EPEL as well, we might as well enable it and just wait until the packages
are added to EPEL 10.
2024-12-20 20:09:35 +01:00
Daan De Meyer
d4dda34854 mkosi: Add libz1 to opensuse tools tree
Without meson fails to configure properly.
2024-12-20 20:09:35 +01:00
Daan De Meyer
7337f4b197 mkosi: Add gdb to tools tree 2024-12-20 20:09:35 +01:00
Daan De Meyer
3ee5cab490 docs: Move fuzzers documentation to test README.md 2024-12-20 20:09:35 +01:00
Daan De Meyer
3add2d73b3 coverage: Run on pull request in a few cases
If we're changing the integration test wrapper or coverage.yml, let's
run the coverage workflow on PRs as well to make sure it doesn't break.
2024-12-20 20:09:35 +01:00
Daan De Meyer
1dd345b00d mkosi: Update to latest 2024-12-20 20:09:35 +01:00
Lennart Poettering
8ca50bde48 analyze-chid: fully support all CHID types
This adds logic to read the missing SMBIOS fields from userspace, too.
With this we should have full CHID coverage now, matching fwupd's output
fully.
2024-12-20 18:13:18 +01:00
Lennart Poettering
0eb51d9913 analyze-chid: split out code that reads smbios into helper 2024-12-20 18:13:18 +01:00
Lennart Poettering
6b99f3ba5a analyze: C escape weird chars in SMBIOS fields
just in case, let's not write garbled crap to the TTY but escape and
potential weird chars before output.
2024-12-20 18:13:18 +01:00
Lennart Poettering
95cd07e772 chid: add missing CHID type definitions
This add he missing CHID types to our tables, but doesn't add all
necessary code to calculate them yet.

This brings us closer to what the CHID spec documents, and what
"fupwdtool hwids" outputs.
2024-12-20 18:13:18 +01:00
Lennart Poettering
0f55038c84 analyze-chid: show friendly smbios field names
Some of the field names between kernel and smbios spec differ. Kinda
confusing. Let's use the smbios field names, to match the CHID spec,
which also uses them, and thus be least confusing, treating kernel
attribute fields as an internal Linux thing only.
2024-12-20 18:13:18 +01:00