Commit Graph

78604 Commits

Author SHA1 Message Date
Lennart Poettering
94634b4b03 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.
2025-01-08 15:27:25 +01:00
Lennart Poettering
59857b672c pid1: allow moving processes in a userns owned by the user, too
Let's liberalize process migration a bit. Previously, PID 1 would only
allow you to move processes into your own cgroups, if those processes
are owned by you too. This is now slightly relaxed: it's now also OK if
the processes are in a userns owned by you.

This makes process migration more useful in context of unpriv userns.
2025-01-08 15:27:25 +01:00
Lennart Poettering
dcb29a931c Simple pam_systemd clean-ups (#35919) 2025-01-08 15:03:36 +01:00
Daan De Meyer
8e3347f3bd fmf: Only mess with /etc/yum.repos.d when running within testing farm
If running tmt locally to debug the test script, make sure we don't
mess with /etc/yum.repos.d.
2025-01-08 13:37:23 +01:00
Daan De Meyer
7f1eceb168 Three fmf fixes (#35917) 2025-01-08 12:29:10 +01:00
Lennart Poettering
394a6ab68c logind: also potentially GC the session if we cannot send reply 2025-01-08 11:24:18 +01:00
Lennart Poettering
1b48aa3523 logind: indicate that 'error' parameter is input by making it const 2025-01-08 11:24:18 +01:00
Lennart Poettering
e79502cdfa logind: split out logic that finds free session ID into helper call
Just some refactoring to make an overly large function a bit smaller.
2025-01-08 11:24:18 +01:00
Lennart Poettering
1b58ba768a logind: normalize parameter to create_session()
We can pass a properly typed Manager object here, no reason to pass it
as void*.
2025-01-08 11:20:18 +01:00
Daan De Meyer
fc1b08dee2 fmf: Fix glob
Globs inside quotes aren't expanded and we need the glob to be more
specific to avoid matching multiple entries inside the tmt source
directory.
2025-01-08 11:15:43 +01:00
Daan De Meyer
0a85b37579 fmf: Fix dist-git example
All that's needed is dist-git-source: true so remove the other settings
that aren't required.
2025-01-08 10:25:50 +01:00
Daan De Meyer
0250db0139 fmf: Don't fail if we can't put selinux in permissive mode
The tests might be running unprivileged or in an environment without
selinux so let's not fail if we can't put it in permissive mode.
2025-01-08 10:25:05 +01:00
Luca Boccassi
6b61f34a46 Stop installing some markdown docs/ files
These files are rendered on systemd.io and targeted at contributors, not
users, so it's not really useful to install them on a running system.
2025-01-08 09:45:09 +01:00
Lennart Poettering
344376adb8 namespace-util: two new operations (#35833)
(This is preparation for #35685, but since it comes with nice test cases
should be safe to add on their own)
2025-01-08 09:35:21 +01:00
Lennart Poettering
2ade821859 namespace-util: add process_is_owned_by_uid() helper 2025-01-07 23:55:34 +01:00
Lennart Poettering
3d57b6692f namespace-util: add helper to get base UID from userns 2025-01-07 23:55:34 +01:00
Lennart Poettering
5b14690a39 namespace-util: slightly tweak proc_mounted() handling in namespace_is_init()
Let's not sloppily eat up errors here.
2025-01-07 23:51:28 +01:00
Lennart Poettering
adcc805929 namespace-util: return recognizable error if namespace_open_by_type() fails because ns type not supported
This makes sure the the codepath that derives an nsfd from a pid works
the same for the pidfd case and the non-pidfd case: if we can verify
that /proc/ is mounted but the /proc/$PID/ns/ files are missing, we can
assume the ns type is not supported by the kernel. Hence return the same
ENOPKG error in this case as we already do in the pidfd ioctl based
codepath.
2025-01-07 23:51:28 +01:00
Mike Yuan
16ac586e5a Bump minimum kernel baseline to 5.4, recommended version to 5.7
As requested, a list of kernel version to feature mapping
for kernels older than minimum baseline is also included,
in order to ease potential backport work.
2025-01-07 22:43:45 +01:00
Lennart Poettering
0dfd89fa32 udev: introduce io.systemd.Udev varlink interface (#35721)
Replaces #25523.
2025-01-07 16:49:37 +01:00
Tobias Klauser
9379b23be3 resolve: fix typo in DNS_EDE_RCODE_PROHIBITIED constant name
Drop the extra `I` and rename the constant to DNS_EDE_RCODE_PROHIBITED
in accordance with the error code string.
2025-01-07 16:48:44 +01:00
Daan De Meyer
6640466cec mkosi: Bump device timeout back to default value
Hopefully fixes #35302
2025-01-07 16:20:35 +01:00
Jacob McNamee
9d1c28b2d8 stdio-bridge: fix polled fds
Poll fds associated with the bus instead of hardcoding stdin/stdout.

This is consequential under socket activation, when the provided fd
should be used instead of stdin/stdout.
2025-01-07 15:51:16 +01:00
Daan De Meyer
3c9ffd2e4b fmf: Check out target branch in packit 2025-01-07 15:27:19 +01:00
Daan De Meyer
86a6d7cc5a packit: Simplify configuration 2025-01-07 15:18:50 +01:00
Luca Boccassi
5c4cb68390 obs: also trigger Fedora package builds
The package is logistically separated, as the rpm sources conflict from Fedora
conflict with the rpm sources from SUSE (some files have the same name and
location but different, incompatible content), so Fedora builds can't be
triggered from the same package. The result is the same.
2025-01-07 13:56:52 +01:00
Yu Watanabe
05db3fe7f9 ask-password: req must be non-NULL
After #35074, the parameter 'req' must be non-NULL.

Fixes CID#1586101, CID#1586102, and CID#1586103.
2025-01-07 13:12:08 +01:00
Daan De Meyer
414fe9629c mkosi: Install which in build image
Required by gdb-add-index to find gdb and not declared as a dependency
of the package.
2025-01-07 12:39:46 +01:00
Luca Boccassi
f2b34ce7f3 test: add test case for AddDependencyUnitFiles assert
Follow-up for d87dc74e8f
2025-01-07 11:35:03 +00:00
Yu Watanabe
2bc733d9b0 units: introduce systemd-udevd-varlink.socket
Co-authored-by: David Tardon <dtardon@redhat.com>
2025-01-07 20:31:15 +09:00
Yu Watanabe
3fed28b8cb udevadm: use varlink connection to send ping 2025-01-07 20:31:15 +09:00
Yu Watanabe
4e4c2fcfb6 udevadm-control: use varlink to send commands 2025-01-07 20:31:15 +09:00
Yu Watanabe
2f0aa9a804 udev-varlink: introduce io.systemd.Udev varlink interface
Co-authored-by: David Tardon <dtardon@redhat.com>
2025-01-07 20:31:15 +09:00
Yu Watanabe
d5c4c4d45c TEST-17-UDEV: wait for udevd being restarted after exit control command
Also wait for created devices being processed before running tests.
2025-01-07 20:31:15 +09:00
Daan De Meyer
83c0b95f63 docs: Remove VIRTUALIZED_TESTING.md
Let's nuke this out-of-date doc in favor of HACKING.md.
2025-01-07 11:13:31 +01:00
Daan De Meyer
ffcdaec632 repart: Use streq_ptr()
p->format is not guaranteed to be initialized.
2025-01-07 09:11:30 +01:00
Yu Watanabe
2bef5d187d machine: update log message and comments
Follow-up for 9af9d66184 and
453f2359ff.
2025-01-07 09:11:09 +01:00
Lennart Poettering
56a07d10a5 xopenat(): introduce new XO_REGULAR flag (#35834)
This is something I think we should have added a long time ago: a
flavour of open() that safely ensures the inode we are opening is a
regular file, before we open it. It does this by means of pinning the
inode via O_PATH first, and after verification actually opening it.

This ports some code over to this, but sooner or later we should
probably use this a lot more, so that we don't accidentally open weird
stuff such as device nodes or pipes, where we should not.
2025-01-07 08:55:56 +01:00
Lennart Poettering
20785351b1 pretty-print: drop extra ';' from progress reporting end sequence
This corrects the closing sequence for the ConEmu progress reporting
final sequence. We by mistake sent two final ;;, where only one was
expected. The terminals I tested this with didn't care, but Ghostty
apparently does. Let's fix things and generate the closing sequence as
per doc:

https://conemu.github.io/en/AnsiEscapeCodes.html#ConEmu_specific_OSC
2025-01-07 08:55:36 +01:00
Lennart Poettering
9ed2725867 process-util: a process from a foreign pidns is definitely not our child
Addresses: https://github.com/systemd/systemd/pull/35242#pullrequestreview-2531712318
2025-01-07 08:55:21 +01:00
Yu Watanabe
62e9cd6b09 basic/linux: update kernel headers from v6.13-rc6
This also removes README and moves the explanation about the header
modification to the script.
2025-01-06 23:35:14 +00:00
Lennart Poettering
bcd2764960 update TODO 2025-01-06 23:37:45 +01:00
Lennart Poettering
714b21da88 copy: port things over to XO_REGULAR 2025-01-06 23:37:45 +01:00
Lennart Poettering
237aca5fbe machine: switch to using cleanup handling for child process cleanup 2025-01-06 23:37:45 +01:00
Lennart Poettering
c0381ba6e8 machine: transition back to host mount ns before copying files from/to container
When copying files from or to a container we so far opened the host side
fd first, then entered the container (specifically, joined it's mount
namespace) in a forked off child process, and opened the other side
there, followed by the (potentially slow) copying from inside the
container mount namespace.

This commit changes this so that we rejoin the host mount namespace
before doing the copying routine. This is relevant, so that we can rely
on /proc/self/fd/… to work, which is not the case otherwise, as we'll
see /proc/ from a pidns that is not our own, in wich case
/proc/self/fd/… is refused. By moving back to the host mount namespace
our own pidns and the pidns the /proc/ mount belongs to will be in sync
again, and all is good.

This is in particular preparation for the next commit, that makes the
copy routine strictly depending on /proc/ being accessible and working.
2025-01-06 23:37:45 +01:00
Lennart Poettering
dffafa47ae fs-util: add XO_REGULAR flag for xopenat()
If this flag is set we guarantee that the fd returned refers to a
regular file. If the file exists and is not one, fails.
2025-01-06 23:20:09 +01:00
Daan De Meyer
2144b5dccf machine: introduce io.systemd.Machine.{CopyFrom, CopyTo} methods (#34913)
This PR introduces io.systemd.Machine.CopyFrom and CopyTo method which
are DBus alternatives of:
- CopyFromMachine
- CopyToMachine
- CopyFromMachineWithFlags
- CopyToMachineWithFlags

The PR also contain tests
2025-01-06 23:16:33 +01:00
Luca Boccassi
d87dc74e8f core: fix assert when AddDependencyUnitFiles is called with invalid parameter
unit_file_add_dependency() asserts, so check before calling it that the
type is expected, or return EINVAL to the caller.

root@localhost:~# busctl call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager AddDependencyUnitFiles "asssbb" 0 uwhatm8 After 1 1

Broadcast message from systemd-journald@localhost (Mon 2025-01-06 18:12:14 UTC):

systemd[1]: Caught <ABRT>, from our own process.

Fixes https://github.com/systemd/systemd/issues/35882
2025-01-06 21:38:55 +00:00
Arnaudv6
a7cdd7fe08 hwdb: WALTOP International Corp. Slim Tablet Stylus 2025-01-07 04:33:00 +09:00
Luca Boccassi
861d0c081a tree-wide: drop references to CentoS/RHEL 7 and 8 (#35881) 2025-01-06 18:38:05 +00:00