]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
10 months agonamespace-util: use pidref_namespace_open_by_type() where appropriate 35923/head
Mike Yuan [Wed, 8 Jan 2025 13:02:28 +0000 (14:02 +0100)] 
namespace-util: use pidref_namespace_open_by_type() where appropriate

Several logs are dropped, since all callers log loudly already.

10 months agouid-range: make uid_map_search_root() take UIDRangeUsernsMode
Mike Yuan [Wed, 8 Jan 2025 11:44:33 +0000 (12:44 +0100)] 
uid-range: make uid_map_search_root() take UIDRangeUsernsMode

10 months agonamespace-util: introduce userns_enter_and_pin() helper
Mike Yuan [Wed, 8 Jan 2025 11:43:05 +0000 (12:43 +0100)] 
namespace-util: introduce userns_enter_and_pin() helper

which generalizes forking a process into userns and freeze()

Addresses https://github.com/systemd/systemd/pull/35833/files#r1905508153

10 months agonamespace-util: group userns functions together
Mike Yuan [Sat, 11 Jan 2025 14:42:15 +0000 (15:42 +0100)] 
namespace-util: group userns functions together

10 months agoREADME: document kernel version for idmapped mounts
Mike Yuan [Sat, 11 Jan 2025 14:41:55 +0000 (15:41 +0100)] 
README: document kernel version for idmapped mounts

10 months agobasic: move nsfs ioctls from missing_fs to missing_namespace
Mike Yuan [Wed, 8 Jan 2025 11:25:04 +0000 (12:25 +0100)] 
basic: move nsfs ioctls from missing_fs to missing_namespace

Addresses https://github.com/systemd/systemd/pull/35833#discussion_r1905333757

10 months agoprocess-util: drop duplicate assertions
Mike Yuan [Wed, 8 Jan 2025 12:50:51 +0000 (13:50 +0100)] 
process-util: drop duplicate assertions

10 months agoExtend elf package metadata to pe/coff files (#35681)
Zbigniew Jędrzejewski-Szmek [Sat, 11 Jan 2025 12:12:39 +0000 (13:12 +0100)] 
Extend elf package metadata to pe/coff files (#35681)

10 months agoREADME: add OBS status icon and link to instructions to add bleeding edge repo
Luca Boccassi [Sat, 11 Jan 2025 00:53:49 +0000 (00:53 +0000)] 
README: add OBS status icon and link to instructions to add bleeding edge repo

10 months agohomectl: fix minor spelling mistake (#35963)
Eaterminer [Sat, 11 Jan 2025 05:17:05 +0000 (18:17 +1300)] 
homectl: fix minor spelling mistake (#35963)

10 months agostub: drop PE sections parsing cap
Luca Boccassi [Fri, 10 Jan 2025 21:02:55 +0000 (21:02 +0000)] 
stub: drop PE sections parsing cap

This was added originally as it was thought that Windows applied
the same cap. Nowadays the specs do not mention it, and it is
believed Windows no longer applies it either, so drop it in order
to allow an arbitrary number of DTBs to be included

Fixes https://github.com/systemd/systemd/issues/35943

10 months agomachine: follow ups for varlink PRs recently merged (#35940)
Lennart Poettering [Fri, 10 Jan 2025 21:12:22 +0000 (22:12 +0100)] 
machine: follow ups for varlink PRs recently merged (#35940)

Follow ups for:
- https://github.com/systemd/systemd/pull/35880
- https://github.com/systemd/systemd/pull/35066

10 months agoTest improvements (#35955)
Daan De Meyer [Fri, 10 Jan 2025 20:30:58 +0000 (21:30 +0100)] 
Test improvements (#35955)

10 months agofmf: Skip TEST-21-DFUZZER 35955/head
Daan De Meyer [Fri, 10 Jan 2025 14:29:28 +0000 (15:29 +0100)] 
fmf: Skip TEST-21-DFUZZER

Similar to Github Actions, since we don't build with sanitizers in
the packit job, let's skip TEST-21-DFUZZER.

10 months agofmf: Use different heuristic on beefy systems
Daan De Meyer [Fri, 10 Jan 2025 14:26:54 +0000 (15:26 +0100)] 
fmf: Use different heuristic on beefy systems

If we save journals in /tmp, we can run a larger number of tests in
parallel so let's make use of the larger number of CPUs if the tests
run on a beefy machine.

10 months agofmf: Bump inotify limits to avoid systemd-nspawn failures
Daan De Meyer [Fri, 10 Jan 2025 14:26:37 +0000 (15:26 +0100)] 
fmf: Bump inotify limits to avoid systemd-nspawn failures

10 months agotest: Move StateDirectory= directive into dropin
Daan De Meyer [Fri, 10 Jan 2025 13:51:24 +0000 (14:51 +0100)] 
test: Move StateDirectory= directive into dropin

The integration-test-setup calls require StateDirectory= but some
tests override the test unit used which then won't have StateDirectory=
so let's move StateDirectory= into the dropin as well to avoid this
issue.

10 months agotest: Don't register machines with machined unless we're in interactive mode
Daan De Meyer [Fri, 10 Jan 2025 13:29:58 +0000 (14:29 +0100)] 
test: Don't register machines with machined unless we're in interactive mode

10 months agotest: Add option to save in progress test journals to /tmp
Daan De Meyer [Fri, 10 Jan 2025 13:27:33 +0000 (14:27 +0100)] 
test: Add option to save in progress test journals to /tmp

The journal isn't the best at being fast, especially when writing
to disk and not to memory, which can cause integration tests to
grind to a halt on beefy systems due to all the systemd-journal-remote
instances not being able to write journal entries to disk fast enough.

Let's introduce an option to allow writing in progress test journals
to use /tmp which can be used on beefy systems with lots of memory to
speed things up.

10 months agovarlink: send linux errno name along with errno number in generic system error replie...
Lennart Poettering [Fri, 10 Jan 2025 14:40:48 +0000 (15:40 +0100)] 
varlink: send linux errno name along with errno number in generic system error replies (#35912)

Let's make things a bit less Linux specific, and more debuggable, by
including not just the error number but also the error name in the
generic io.systemd.System errors we generate when all we have is an
"errno".

10 months agopam_systemd: two refactorings (#35924)
Lennart Poettering [Fri, 10 Jan 2025 14:04:10 +0000 (15:04 +0100)] 
pam_systemd: two refactorings (#35924)

This is prepartion (and split out of) for #35264. The refactors make a
ton of sense on their own however, too I htink.

10 months agotest-varlink: add superficial test that validates varlink/errno translation both... 35912/head
Lennart Poettering [Tue, 7 Jan 2025 17:54:39 +0000 (18:54 +0100)] 
test-varlink: add superficial test that validates varlink/errno translation both ways

10 months agovarlink: tweak what we include in "system error" messages
Lennart Poettering [Tue, 7 Jan 2025 17:51:10 +0000 (18:51 +0100)] 
varlink: tweak what we include in "system error" messages

We so far only included the numeric Linux errno. That's pretty Linux
specific however. Hence, let's improve things and include an origin
string, that clearly marks Linux as origin. Also, include the string
name of the error.

Take these two fields into account when translating back, too. So that
we prefer going by symbolic name rather than by numeric id.

10 months agosd-json: make it safe to call sd_json_dispatch_full() with a NULL table
Lennart Poettering [Tue, 7 Jan 2025 13:41:22 +0000 (14:41 +0100)] 
sd-json: make it safe to call sd_json_dispatch_full() with a NULL table

This is useful for generating good errors when dispatching varlink
methods that take no parameters, as we'll still generate precise errors
in that case, taking a NULL table as equivalent as one with no
entries.

10 months agologind: split create session reply handling in two 35924/head
Lennart Poettering [Tue, 19 Nov 2024 22:25:31 +0000 (23:25 +0100)] 
logind: split create session reply handling in two

This prepares ground so that later on we can reply with either D-Bus or
Varlink depending on the client's request.

10 months agologind: rework session creation logic, to be more reusable for varlink codepaths
Lennart Poettering [Tue, 19 Nov 2024 21:16:25 +0000 (22:16 +0100)] 
logind: rework session creation logic, to be more reusable for varlink codepaths

This separates the preparatory checks that generate D-Bus errors from
the code that actually allocates the session. This make the logic easier
to follow and prepares ground so that we can reuse the 2nd part later
when exposing session creation via Varlink.

10 months agouserdb: define new 64K "foreign UID" range (#35932)
Lennart Poettering [Fri, 10 Jan 2025 12:49:11 +0000 (13:49 +0100)] 
userdb: define new 64K "foreign UID" range (#35932)

This is establish the basic concepts for #35685, in the hope to get this
merged first.

This defines a special, fixed 64K UID range that is supposed to be used
by directory container images on disk, that is mapped to a dynamic UID
range at runtime (via idmapped mounts).

This enables a world where each container can run with a dynamic UID
range, but this in no way leaks onto the disk, thus making supposedly
dynamic, transient UID range assignments persistent.

This is infrastructure later used for the primary part of #35685: unpriv
container execution with directory images inside user's home dirs, that
are assigned to this special "foreign UID range".

This PR only defines the ranges, synthesizes NSS records for them via
userdb, and then exposes them in a new "systemd-dissect --shift" command
that can re-chown a container directory tree into this range (and in
fact any range).

This comes with docs. But no tests. There are tests in #35685 that cover
all this, but they are more comprehensive and also test nspawn's hook-up
with this, hence are excluded from this PR.

10 months agomachine: VARLINK_ERROR_MACHINE_IMAGE_* defines 35940/head
Ivan Kruglov [Thu, 9 Jan 2025 14:24:58 +0000 (15:24 +0100)] 
machine: VARLINK_ERROR_MACHINE_IMAGE_* defines

10 months agomachine: VARLINK_ERROR_MACHINE_* defines
Ivan Kruglov [Thu, 9 Jan 2025 14:13:22 +0000 (15:13 +0100)] 
machine: VARLINK_ERROR_MACHINE_* defines

10 months agomachine: fix logging of errno in machine_open_root_directory()
Ivan Kruglov [Fri, 10 Jan 2025 10:48:39 +0000 (11:48 +0100)] 
machine: fix logging of errno in machine_open_root_directory()

10 months agobasic: fixes in read_errno()
Ivan Kruglov [Thu, 9 Jan 2025 14:02:08 +0000 (15:02 +0100)] 
basic: fixes in read_errno()

follow ups for https://github.com/systemd/systemd/pull/35880

10 months agoprocess-util: do not unblock unrelated signals while forking
Lennart Poettering [Thu, 9 Jan 2025 10:15:49 +0000 (11:15 +0100)] 
process-util: do not unblock unrelated signals while forking

This makes sure when we are blocking signals in preparation for fork()
we'll not temporarily unblock any signals previously set, by mistake.

It's safe for us to block more, but not to unblock signals already
blocked. Fix that.

Fixes: #35470
10 months agorepart: modernize set_gpt_flags()
Lennart Poettering [Thu, 9 Jan 2025 10:17:40 +0000 (11:17 +0100)] 
repart: modernize set_gpt_flags()

10 months agomeson: add install tags for udev and hwdb
Luca Boccassi [Thu, 9 Jan 2025 21:37:26 +0000 (21:37 +0000)] 
meson: add install tags for udev and hwdb

Allows building and installing them individually, like
other existing components

10 months agotree-wide: Fix python formatting
Daan De Meyer [Thu, 9 Jan 2025 15:24:22 +0000 (16:24 +0100)] 
tree-wide: Fix python formatting

The new release of ruff formats a few more things which causes linter
failures in CI so let's fix those formatting nits.

10 months agofmf: Move meson logs and failed test journals to test artifacts dir (#35939)
Yu Watanabe [Fri, 10 Jan 2025 05:57:57 +0000 (14:57 +0900)] 
fmf: Move meson logs and failed test journals to test artifacts dir (#35939)

10 months agofmf: Use one fewer than number of available CPUs again 35939/head
Daan De Meyer [Thu, 9 Jan 2025 14:45:41 +0000 (15:45 +0100)] 
fmf: Use one fewer than number of available CPUs again

This effectively reverts b8582198ca1e6fe390f7169e623a9130b68a6b36
as I can not get the testing farm bare metal machines working
downstream and even if I managed to, without also using the testing
farm bare metal machines upstream (for which there is no capacity),
the setup would very quickly bitrot anyway so we'll just run the
container based tests for now.

10 months agofmf: Log clock source
Daan De Meyer [Thu, 9 Jan 2025 14:24:51 +0000 (15:24 +0100)] 
fmf: Log clock source

10 months agofmf: Move meson logs and failed test journals to test artifacts dir
Daan De Meyer [Thu, 9 Jan 2025 14:13:18 +0000 (15:13 +0100)] 
fmf: Move meson logs and failed test journals to test artifacts dir

10 months agoupdate TODO
Lennart Poettering [Thu, 9 Jan 2025 13:40:17 +0000 (14:40 +0100)] 
update TODO

10 months agoupdate TODO
Lennart Poettering [Thu, 9 Jan 2025 13:36:27 +0000 (14:36 +0100)] 
update TODO

10 months agoStash the subscriber list when we disconenct from the bus (#35406)
Lennart Poettering [Thu, 9 Jan 2025 13:34:55 +0000 (14:34 +0100)] 
Stash the subscriber list when we disconenct from the bus (#35406)

If we unexpectly disconnect from the bus, systemd would end up dropping
the list of subscribers, which breaks the ability of clients like logind
to monitor the state of units.

Stash the list of subscribers into the deserialized state in the event
of a disconnect so that when we recover we can renew the broken
subscriptions.

---

Fixes: #8672 #26744
10 months agopam: add session class "none" to disable logind sessions (#35171)
Lennart Poettering [Thu, 9 Jan 2025 13:08:06 +0000 (14:08 +0100)] 
pam: add session class "none" to disable logind sessions (#35171)

pam_systemd is used to create logind sessions and to apply extended
attributes from json user records. Not every application that creates a
pam session expects a login scope, but may be interested in the extended
attributes of json user records. Session class "none" implements this
service by disabling logind for this session altogether.

---

Closes: #34988
10 months agomachine: introduce io.systemd.Machine.OpenRootDirectory method (#35880)
Daan De Meyer [Thu, 9 Jan 2025 12:06:38 +0000 (13:06 +0100)] 
machine: introduce io.systemd.Machine.OpenRootDirectory method (#35880)

This PR introduces io.systemd.Machine.OpenRootDirectory method which is
DBus's alternative to OpenMachineRootDirectory.

10 months agomkosi: Re-enable TEST-21-DFUZZER when running with sanitizers
Daan De Meyer [Tue, 7 Jan 2025 14:01:02 +0000 (15:01 +0100)] 
mkosi: Re-enable TEST-21-DFUZZER when running with sanitizers

Similar to how CentOS CI did it previously, let's only run
TEST-21-DFUZZER when built with sanitizers for maximum effect.

10 months agoTwo integration test fixes (#35937)
Daan De Meyer [Thu, 9 Jan 2025 11:25:41 +0000 (12:25 +0100)] 
Two integration test fixes (#35937)

10 months agoTEST-06-SELINUX: Add knob to allow checking for AVCs (#35921)
Daan De Meyer [Thu, 9 Jan 2025 10:59:58 +0000 (11:59 +0100)] 
TEST-06-SELINUX: Add knob to allow checking for AVCs (#35921)

When running the integration tests downstream, it's useful to be able to
test that a new systemd version doesn't introduce any AVC denials, so
let's add a knob to make that possible.

10 months agofmf: Force SELinux relabel when running within testing farm 35921/head
Daan De Meyer [Wed, 8 Jan 2025 15:03:06 +0000 (16:03 +0100)] 
fmf: Force SELinux relabel when running within testing farm

We expect to run as root within testing farm and to have permissions
to do selinux relabelling so let's enable it explicitly.

10 months agoTEST-06-SELINUX: Add knob to allow checking for AVCs
Daan De Meyer [Wed, 8 Jan 2025 12:31:11 +0000 (13:31 +0100)] 
TEST-06-SELINUX: Add knob to allow checking for AVCs

When running the integration tests downstream, it's useful to be
able to test that a new systemd version doesn't introduce any AVC
denials, so let's add a knob to make that possible.

10 months agotest: Only plug in integration-test-setup.sh in interactive mode 35937/head
Daan De Meyer [Thu, 9 Jan 2025 10:28:15 +0000 (11:28 +0100)] 
test: Only plug in integration-test-setup.sh in interactive mode

If we're not running interactively, there's no point in the features
from integration-test-setup.sh which are intended for interactive
development and debugging so lets skip adding it in that case.

10 months agotest: Drop set -x from integration-test-setup.sh
Daan De Meyer [Thu, 9 Jan 2025 10:27:51 +0000 (11:27 +0100)] 
test: Drop set -x from integration-test-setup.sh

10 months agomachine: set SD_VARLINK_SERVER_ALLOW_FD_PASSING_OUTPUT for varlink server 35880/head
Ivan Kruglov [Tue, 7 Jan 2025 10:10:44 +0000 (11:10 +0100)] 
machine: set SD_VARLINK_SERVER_ALLOW_FD_PASSING_OUTPUT for varlink server

10 months agomachine: tests for io.systemd.Machine.OpenRootDirectory
Ivan Kruglov [Mon, 6 Jan 2025 15:43:28 +0000 (16:43 +0100)] 
machine: tests for io.systemd.Machine.OpenRootDirectory

10 months agomachine: introduce io.systemd.Machine.OpenRootDirectory
Ivan Kruglov [Mon, 6 Jan 2025 15:31:02 +0000 (16:31 +0100)] 
machine: introduce io.systemd.Machine.OpenRootDirectory

10 months agomachine: use machine_open_root_directory() in dbus
Ivan Kruglov [Mon, 6 Jan 2025 15:15:57 +0000 (16:15 +0100)] 
machine: use machine_open_root_directory() in dbus

10 months agomachine: machine_open_root_directory()
Ivan Kruglov [Mon, 6 Jan 2025 15:15:36 +0000 (16:15 +0100)] 
machine: machine_open_root_directory()

10 months agoprocess-util: read_errno()
Ivan Kruglov [Tue, 7 Jan 2025 11:58:46 +0000 (12:58 +0100)] 
process-util: read_errno()

10 months agohostname: use sd_device to acquire fallback chassis
Yu Watanabe [Wed, 8 Jan 2025 20:01:26 +0000 (05:01 +0900)] 
hostname: use sd_device to acquire fallback chassis

This makes
- also cache sd_device for ACPI device.
- split fallback_chassis() into small pieces,
- use sd_device to reading sysfs attributes.

No functional change, just refactoring.

10 months agosd-device: make sd_device_new_from_path() accept relative path to device node
Yu Watanabe [Tue, 7 Jan 2025 18:23:29 +0000 (03:23 +0900)] 
sd-device: make sd_device_new_from_path() accept relative path to device node

Even though udevadm accepts relative syspath, previously, udevadm
could not use relative path to device node:
===
$ cd /dev
$ udevadm info sda
Bad argument "sda", expected an absolute path in /dev/ or /sys/ or a unit name: Invalid argument
$ udevadm info /usr/../dev/sda
Unknown device "/usr/../dev/sda": No such device
===
With this change, both the above cases work fine.

Note, still sd_device_new_from_devname() requires absolute path starts
with /dev/, for safety.

10 months agofmf: Use different heuristic for number of process with many CPUs
Daan De Meyer [Wed, 8 Jan 2025 21:20:42 +0000 (22:20 +0100)] 
fmf: Use different heuristic for number of process with many CPUs

Downstream we sometimes end up with machines with lots of CPUs which
leads to running out of memory when trying to run the tests in VMs.
So let's switch to a different heuristic when we have lots of CPUs to
avoid running out of memory.

10 months agomanager: s/deserialized_subscribed/subscribed_as_strv 35406/head
Ronan Pigott [Wed, 11 Dec 2024 19:47:10 +0000 (12:47 -0700)] 
manager: s/deserialized_subscribed/subscribed_as_strv

Now that this field may get populated at runtime, the deserialized name
is misleading. Change the name to reflect its updated purpose.

10 months agodbus: stash the subscriber list when we disconenct from the bus
Ronan Pigott [Thu, 28 Nov 2024 19:53:32 +0000 (12:53 -0700)] 
dbus: stash the subscriber list when we disconenct from the bus

If we unexpectly disconnect from the bus, systemd would end up dropping
the list of subscribers, which breaks the ability of clients like logind
to monitor the state of units.

Stash the list of subscribers into the deserialized state in the event
of a disconnect so that when we recover we can renew the broken
subscriptions.

10 months agohwids: add a new efi firmware type of device entry (#35747)
Lennart Poettering [Wed, 8 Jan 2025 21:31:48 +0000 (22:31 +0100)] 
hwids: add a new efi firmware type of device entry (#35747)

This change adds a new firmware type device entry for the .hwids
section.
It also adds compile time validations and appropriate unit tests for
them.
chid_match() and related helpers have been updated accordingly.

Duplicate of https://github.com/systemd/systemd/pull/35281
Last review feedback's from this above PR has been incorporated and
merged.

@anonymix007

10 months agoRemove no longer needed login-options override. Fixes agetty autologin.
Pontus Lundkvist [Thu, 2 Jan 2025 23:20:59 +0000 (00:20 +0100)] 
Remove no longer needed login-options override. Fixes agetty autologin.

The need for -o was introduced in db6aeda to set the -p flag for login.
Setting -o overrides agettys built-in handling of arguments, so "-- \\u" was needed to mimic it.

This broke the autologin-feature, since the -f (noauth) flag is not passed to login [1].

But with 3d2157e, the -p flag is dropped, but the full change wasn't reverted,
leaving autologin still broken - But for no reason since agetty does the right thing.

Reference:
[1]: https://github.com/util-linux/util-linux/blob/4e14b57/term-utils/agetty.c#L529-L550

10 months agoupdate TODO
Lennart Poettering [Wed, 8 Jan 2025 21:24:39 +0000 (22:24 +0100)] 
update TODO

10 months agodissect: add new --shift command 35932/head
Lennart Poettering [Tue, 12 Nov 2024 08:44:48 +0000 (09:44 +0100)] 
dissect: add new --shift command

10 months agouserdb: synthesize stub user records for the foreign UID
Lennart Poettering [Tue, 12 Nov 2024 16:04:11 +0000 (17:04 +0100)] 
userdb: synthesize stub user records for the foreign UID

10 months agouser-classification: add new "foreign" UID range
Lennart Poettering [Fri, 8 Nov 2024 11:14:16 +0000 (12:14 +0100)] 
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.

10 months agoudev/net: add three settings for ethtool features (#35906)
Lennart Poettering [Wed, 8 Jan 2025 20:37:21 +0000 (21:37 +0100)] 
udev/net: add three settings for ethtool features (#35906)

Closes #31415.
Closes #32979.

10 months agonsresource: optionally mangle userns names passed to nsresourced (#35900)
Lennart Poettering [Wed, 8 Jan 2025 20:36:37 +0000 (21:36 +0100)] 
nsresource: optionally mangle userns names passed to nsresourced (#35900)

We enforce quite strict rules on naming userns we assign uid ranges to
for users. So strict that they are hard to get right for clients. hence,
let's optionally mangle provided strings so that they work for us.

This should make it much easier to work with the API, as something
reasonable happens regarldess what kind of garbage a client sets as
name.

mangling the name is opt-in for clients, so that there's tight control
for the client on the name, but also "fire and forget".

10 months agopid1: allow removal of foreign-owned subcgroups of cgroups owned by some user (#35922)
Lennart Poettering [Wed, 8 Jan 2025 20:36:16 +0000 (21:36 +0100)] 
pid1: allow removal of foreign-owned subcgroups of cgroups owned by some user (#35922)

This improves operation in unprivileged userns environments, where
unpriv user code might invoke a container with a delegated userns UID
range, and thus ends up with a subcgroup owned by another UID. With this
patch any user is always allowed to remove their own cgroups even if it
has subcgroups owned by other users.

This removes a DoS of sorts, and enforces the rule that users strictly
own everything below cgroups they own.

10 months agofmf: Dump CPU and memory information
Daan De Meyer [Wed, 8 Jan 2025 15:41:46 +0000 (16:41 +0100)] 
fmf: Dump CPU and memory information

10 months agoudev/net: add PartialGenericSegmentationOffload= setting 35906/head
Yu Watanabe [Tue, 7 Jan 2025 14:06:17 +0000 (23:06 +0900)] 
udev/net: add PartialGenericSegmentationOffload= setting

Closes #32979.

10 months agoudev/net: add ReceiveFCS= and ReceiveAll= settings
Yu Watanabe [Tue, 7 Jan 2025 14:05:38 +0000 (23:05 +0900)] 
udev/net: add ReceiveFCS= and ReceiveAll= settings

Closes #31415.

10 months agotwo pidref tweaks (#35918)
Mike Yuan [Wed, 8 Jan 2025 17:58:20 +0000 (18:58 +0100)] 
two pidref tweaks (#35918)

10 months agotest: add testcase that verifies we can safely delete subcgroups owned by other users... 35922/head
Lennart Poettering [Wed, 8 Jan 2025 12:55:07 +0000 (13:55 +0100)] 
test: add testcase that verifies we can safely delete subcgroups owned by other users if we own the parent

This is a test for the previous commits: we create an unpriv, delegated cgroup in
--user mode, then create a subcgroup that is owned by some other user
(to mimic the case where an unpriv user got a userns with delegated UIDs
assigned), and then try to stop the unit. traditionally this would fail,
because our unpriv systemd --user instance can't remove the subcrroup
owned by someone else. With the earlier patches this is addressed.

10 months agocgroup: when we fail to clean up a cgroup, let's ask PID 1 for help
Lennart Poettering [Tue, 12 Nov 2024 11:03:05 +0000 (12:03 +0100)] 
cgroup: when we fail to clean up a cgroup, let's ask PID 1 for help

10 months agopid1: add D-Bus API for removing delegated subcgroups
Lennart Poettering [Tue, 12 Nov 2024 10:59:40 +0000 (11:59 +0100)] 
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.

10 months agopid1: allow moving processes in a userns owned by the user, too
Lennart Poettering [Wed, 27 Nov 2024 09:19:21 +0000 (10:19 +0100)] 
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.

10 months agodissect-image: mount the ESP with fmask=0177 (#35871)
nl6720 [Wed, 8 Jan 2025 14:19:33 +0000 (16:19 +0200)] 
dissect-image: mount the ESP with fmask=0177 (#35871)

Avoid showing the files on the ESP (i.e. a FAT formatted volume) as
executable by removing the execute permission from them.

IMO this makes the colored output of `ls` more sensible since the file
system will be mounted with `noexec` anyway.

Add a `fstype_can_fmask_dmask` function that checks if a file system
type can use the `fmask` and `dmask` mount options.

This replaces `fstype_can_umask` since it was only used in
`partition_pick_mount_options` which only cares about the file system
support for fmask & dmask now.

It somewhat reduces the coverage of the feature since there are more file
systems that support umask as opposed to those supporting dmask & dmask,
but it should not be much of an issue since fmask & dmask are supported
by vfat, exfat and ntfs3.

10 months agotest: make sure the userns long name mangling codepaths are tested 35900/head
Lennart Poettering [Tue, 7 Jan 2025 10:53:18 +0000 (11:53 +0100)] 
test: make sure the userns long name mangling codepaths are tested

10 months agonsresourced: add ability to mangle specified name if necessary
Lennart Poettering [Wed, 27 Nov 2024 09:23:02 +0000 (10:23 +0100)] 
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 mostly 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.

10 months agouserns: refuse empty userns names
Lennart Poettering [Tue, 7 Jan 2025 10:46:06 +0000 (11:46 +0100)] 
userns: refuse empty userns names

Let's tighten rules a bit.

10 months agoSimple pam_systemd clean-ups (#35919)
Lennart Poettering [Wed, 8 Jan 2025 14:03:36 +0000 (15:03 +0100)] 
Simple pam_systemd clean-ups (#35919)

10 months agopidref: drop support for kernels lacking waitid(P_PIDFD, …) 35918/head
Lennart Poettering [Wed, 8 Jan 2025 09:57:50 +0000 (10:57 +0100)] 
pidref: drop support for kernels lacking waitid(P_PIDFD, …)

Our baseline is not 5.4, which is where P_PIDFD was introduced.

10 months agopidref: copy fd id in pidref_copy() too
Lennart Poettering [Wed, 8 Jan 2025 09:53:00 +0000 (10:53 +0100)] 
pidref: copy fd id in pidref_copy() too

10 months agofmf: Only mess with /etc/yum.repos.d when running within testing farm
Daan De Meyer [Wed, 8 Jan 2025 11:12:15 +0000 (12:12 +0100)] 
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.

10 months agoThree fmf fixes (#35917)
Daan De Meyer [Wed, 8 Jan 2025 11:29:10 +0000 (12:29 +0100)] 
Three fmf fixes (#35917)

10 months agologind: also potentially GC the session if we cannot send reply 35919/head
Lennart Poettering [Tue, 19 Nov 2024 22:23:21 +0000 (23:23 +0100)] 
logind: also potentially GC the session if we cannot send reply

10 months agologind: indicate that 'error' parameter is input by making it const
Lennart Poettering [Tue, 19 Nov 2024 21:42:26 +0000 (22:42 +0100)] 
logind: indicate that 'error' parameter is input by making it const

10 months agologind: split out logic that finds free session ID into helper call
Lennart Poettering [Tue, 19 Nov 2024 19:46:55 +0000 (20:46 +0100)] 
logind: split out logic that finds free session ID into helper call

Just some refactoring to make an overly large function a bit smaller.

10 months agologind: normalize parameter to create_session()
Lennart Poettering [Tue, 19 Nov 2024 14:55:03 +0000 (15:55 +0100)] 
logind: normalize parameter to create_session()

We can pass a properly typed Manager object here, no reason to pass it
as void*.

10 months agofmf: Fix glob 35917/head
Daan De Meyer [Wed, 8 Jan 2025 09:38:21 +0000 (10:38 +0100)] 
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.

10 months agofmf: Fix dist-git example
Daan De Meyer [Wed, 8 Jan 2025 09:25:50 +0000 (10:25 +0100)] 
fmf: Fix dist-git example

All that's needed is dist-git-source: true so remove the other settings
that aren't required.

10 months agofmf: Don't fail if we can't put selinux in permissive mode
Daan De Meyer [Wed, 8 Jan 2025 09:25:05 +0000 (10:25 +0100)] 
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.

10 months agoStop installing some markdown docs/ files
Luca Boccassi [Sat, 4 Jan 2025 14:33:03 +0000 (14:33 +0000)] 
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.

10 months agonamespace-util: two new operations (#35833)
Lennart Poettering [Wed, 8 Jan 2025 08:35:21 +0000 (09:35 +0100)] 
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)

10 months agonamespace-util: add process_is_owned_by_uid() helper 35833/head
Lennart Poettering [Wed, 27 Nov 2024 09:17:00 +0000 (10:17 +0100)] 
namespace-util: add process_is_owned_by_uid() helper

10 months agonamespace-util: add helper to get base UID from userns
Lennart Poettering [Thu, 14 Nov 2024 08:55:26 +0000 (09:55 +0100)] 
namespace-util: add helper to get base UID from userns

10 months agonamespace-util: slightly tweak proc_mounted() handling in namespace_is_init()
Lennart Poettering [Tue, 7 Jan 2025 09:55:29 +0000 (10:55 +0100)] 
namespace-util: slightly tweak proc_mounted() handling in namespace_is_init()

Let's not sloppily eat up errors here.