]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
9 months agocryptenroll/repart/creds: no longer default to binding against literal PCR 7
Lennart Poettering [Tue, 28 Jan 2025 08:48:48 +0000 (09:48 +0100)] 
cryptenroll/repart/creds: no longer default to binding against literal PCR 7

PCR 7 covers the SecureBoot policy, in particular "dbx", i.e. the
denylist of bad actors. That list is pretty much as frequently updated
as firmware these days (as fwupd took over automatic updating). This
means literal PCR 7 policies are problematic: they likely break soon,
and are as brittle as any other literal PCR policies.

hence, pick safer defaults, i.e. exclude PCR 7 from the default mask.
This means the mask is now empty.

Generally, people should really switch to signed PCR policies covering
PCR 11, in combination with systemd-pcrlock for the other PCRs.

9 months agodocs: fix plural form
Lennart Poettering [Wed, 29 Jan 2025 12:13:31 +0000 (13:13 +0100)] 
docs: fix plural form

Addresses: https://github.com/systemd/systemd/pull/36133#discussion_r1932816287

9 months agouserdb: move filter of user/group records to the varlink server side (#36133)
Lennart Poettering [Wed, 29 Jan 2025 12:11:38 +0000 (13:11 +0100)] 
userdb: move filter of user/group records to the varlink server side (#36133)

In v257 userdbctl gained support for filtering user records with fuzzy
matching and some other parameters. It was done on the client side only.
This PR adds server-side matching, by exendting the generic userdb
varlink api.

The api is generic any may have many other implementors, hence care is
taken to fallback to exclusively client side filtering in case the
service does not support the new parameters.

In fact I even opted to not actually implement server-side filtering in
any services but systemd-userdbd.service, because it's probably not too
much an optimization in relevant services (we might want to revisit this
later). By implementing it in userdbd the primary entrypoint for userdb
is however covered: the multiplexer interface which provides a single
interface for the multitude of backends. Or in other words: the
multiplexer itself supports server-side filtering even if its own
backends don't, and will hide this neatly away.

One nice side effect from not implementing server side filtering for all
our backends is that the fallback codepaths are comprehensively tested.

Note that this adds some unit tests but not new integration test for all
this, as the filtering tests for userdbctl already existed before, we
just move their implementation from the client to the server side.

9 months agoupdate TODO
Lennart Poettering [Tue, 28 Jan 2025 16:41:13 +0000 (17:41 +0100)] 
update TODO

9 months agoman: Update nss-myhostname.xml to reflect files
AndreFerreiraMsc [Tue, 28 Jan 2025 13:11:58 +0000 (14:11 +0100)] 
man: Update nss-myhostname.xml to reflect files

9 months agonetwork: bridge: add support for configuring locked ports (#36150)
Yu Watanabe [Tue, 28 Jan 2025 19:16:20 +0000 (04:16 +0900)] 
network: bridge: add support for configuring locked ports (#36150)

"Recently" (as of 5.18) the Linux kernel gained the ability of locking
bridge ports to restrict network access to authenticated hosts only.

This is implemented by disabling automated learning and dropping
incoming traffic from unknown hosts. User space is then expected to add
fdb entries for authenticated hosts. Once a fdb entry exist, traffic for
that host will be forwarded as expected.

This was later extended with "Mac Authentication Bypass", where the
locking was extended to fdb entries. In this mode the kernel adds fdb
entries again automatically, but they are locked by default.

To properly configure this, add two network options and one netdev
option:

* `LinkLocalLearning=` to prevent the kernel from creating unlocked
entries based on link-local traffic, which would bypass any
authentication. Needed when enabling learning on a locked port.
* `Locked=` to allow setting a bridge port to locked.
* `MACAuthenticationBypass=` to allow enabling Mac Authentication
 Bypass on a port. Requires learning to be enabled on the port as well
 (and consequently `LinkLocalLearning` disabled on the bridge).

An authenticator (e.g. hostapd) is still needed to do the actual
authentication, the kernel only provides the access control.

9 months agoMinor fixes for ukify tests (#36197)
Luca Boccassi [Tue, 28 Jan 2025 18:49:42 +0000 (18:49 +0000)] 
Minor fixes for ukify tests (#36197)

9 months agowait-online: add initial support for waiting for DNS (#34640)
Luca Boccassi [Tue, 28 Jan 2025 17:33:39 +0000 (17:33 +0000)] 
wait-online: add initial support for waiting for DNS (#34640)

Add a new flag, `--dns`, to systemd-networkd-wait-online to allow
waiting for DNS to be configured. The `--dns` flag respects the `--ipv4`
and `--ipv6` flags, as well as `--interface=` and `--any`.

9 months agotest: support slow test-ukify on Debian/Ubuntu 36197/head
Luca Boccassi [Sun, 26 Jan 2025 17:35:06 +0000 (17:35 +0000)] 
test: support slow test-ukify on Debian/Ubuntu

Kernels are installed in /boot/ so find them there too

9 months agotest: use local stub if available in test-ukify
Luca Boccassi [Sun, 26 Jan 2025 19:50:22 +0000 (19:50 +0000)] 
test: use local stub if available in test-ukify

It might not be available on a CI system in the system
path, so use the local one if it was built

9 months agoukify: Add --sign-profile
Daan De Meyer [Tue, 28 Jan 2025 08:38:26 +0000 (09:38 +0100)] 
ukify: Add --sign-profile

Let's allow configuring which UKI profiles we generate signed PCR
measurements for since there are various types of profiles for
which we do not want to generate signed PCR measurements so that they
can not unlock the encrypted rootfs.

Fixes #36173.

9 months agobootctl: move print block device path calls to command section of its own
Lennart Poettering [Tue, 28 Jan 2025 14:24:51 +0000 (15:24 +0100)] 
bootctl: move print block device path calls to command section of its own

9 months agotest: install stub package for test-ukify unit test
Luca Boccassi [Sun, 26 Jan 2025 20:06:36 +0000 (20:06 +0000)] 
test: install stub package for test-ukify unit test

9 months agonetworkd-test: add basic tests for systemd-networkd-wait-online --dns 34640/head
Nick Rosbrook [Tue, 22 Oct 2024 14:00:49 +0000 (10:00 -0400)] 
networkd-test: add basic tests for systemd-networkd-wait-online --dns

9 months agotest: add test for resolved SubscribeDNSConfiguration API
Nick Rosbrook [Tue, 22 Oct 2024 14:06:11 +0000 (10:06 -0400)] 
test: add test for resolved SubscribeDNSConfiguration API

9 months agotest: cleanup after testcase_12_resolvectl2
Nick Rosbrook [Wed, 23 Oct 2024 20:31:00 +0000 (16:31 -0400)] 
test: cleanup after testcase_12_resolvectl2

9 months agowait-online: add support for waiting for DNS configuration
Nick Rosbrook [Thu, 19 Sep 2024 19:59:50 +0000 (15:59 -0400)] 
wait-online: add support for waiting for DNS configuration

Add a new flag to systemd-networkd-wait-online, --dns, to allow waiting
for DNS to be configured.

DNS is considered configured when at least one DNS server is accessible.
If a link has the property DefaultRoute=yes (either by explicit
configuration, or because there are no routing-only domains), or if the
search domain '.' is configured, wait for link-specific DNS to be
configured. Otherwise, global DNS servers may be considered.

9 months agonetwork: bridge: add support for IFLA_BRPORT_MAB 36150/head
Jonas Gorski [Fri, 24 Jan 2025 12:15:06 +0000 (13:15 +0100)] 
network: bridge: add support for IFLA_BRPORT_MAB

Since linux commit a35ec8e38cdd1766f29924ca391a01de20163931 ("bridge:
Add MAC Authentication Bypass (MAB) support"), included since v6.2, it
is possible to enable MAC Authentication Bypass for bridge ports. In
this mode the locked port learns again, but the learned fdb entries are
locked, allowing user space to unlock hosts based seen MAC addresses.

This requires learning to be enabled on the port, and link-local
learning disabled for the bridge.

Add support to systemd-network for setting the new attribute for bridge
ports.

9 months agonetwork: bridge: add support for IFLA_BRPORT_LOCKED
Jonas Gorski [Mon, 2 Dec 2024 10:54:09 +0000 (11:54 +0100)] 
network: bridge: add support for IFLA_BRPORT_LOCKED

Since linux commit a21d9a670d81103db7f788de1a4a4a6e4b891a0b ("net:
bridge: Add support for bridge port in locked mode"), included since
v5.18,  it is possible to set bridge ports to locked.

Locked ports do not learn automatically, and discard any traffic from
unknown source MACs. To allow traffic, the userspace authenticator is
expected to create fdb entries for authenticated hosts.

Add support to systemd-network for setting the new attribute for bridge
ports.

9 months agonetwork: bridge: add support for NO_LL_LEARN
Jonas Gorski [Tue, 10 Dec 2024 15:45:20 +0000 (16:45 +0100)] 
network: bridge: add support for NO_LL_LEARN

When using locked ports on a bridge link-local learning needs to be
disabled to prevent the kernel from learning and automatically unlocking
hosts based on link-local traffic.

So add support for enabling NO_LL_LEARN for bridges.

9 months agocore: add trigger to path unit debug log
Luca Boccassi [Mon, 27 Jan 2025 20:30:16 +0000 (20:30 +0000)] 
core: add trigger to path unit debug log

Useful for debugging, given it's already logging and the trigger
is known, add it

9 months agokbd-model-map: add a georgian mapping
Adam Williamson [Fri, 10 Jan 2025 21:01:47 +0000 (13:01 -0800)] 
kbd-model-map: add a georgian mapping

https://github.com/legionus/kbd/pull/127 adds a Georgian mapping
to kbd. console-setup already has one. Let's support it here, so
it's used for Georgian installs on distros that use this table.

Signed-off-by: Adam Williamson <awilliam@redhat.com>
9 months agotty-ask-password-agent: use free_and_strdup_warn() for arg_device (#36198)
Lennart Poettering [Tue, 28 Jan 2025 06:22:17 +0000 (07:22 +0100)] 
tty-ask-password-agent: use free_and_strdup_warn() for arg_device (#36198)

9 months agotty-ask-password-agent: use free_and_strdup_warn() for arg_device 36198/head
Mike Yuan [Tue, 28 Jan 2025 01:07:16 +0000 (02:07 +0100)] 
tty-ask-password-agent: use free_and_strdup_warn() for arg_device

Follow-up for 68cf1fc34d3e86a664fb948d413e1db4a24e16dd

Fixes CID#1590840

9 months agotty-ask-password-agent: assert that ask_on_consoles() is called without arg_device
Mike Yuan [Tue, 28 Jan 2025 01:09:52 +0000 (02:09 +0100)] 
tty-ask-password-agent: assert that ask_on_consoles() is called without arg_device

9 months agoresolved: add SubscribeDNSConfiguration to varlink API
Nick Rosbrook [Fri, 11 Oct 2024 18:44:44 +0000 (14:44 -0400)] 
resolved: add SubscribeDNSConfiguration to varlink API

Add a new method to io.systemd.Resolve.Monitor that allows subscribing
to changes in the systemd-resolved DNS configuration. The new method
emits the full DNS configuration (one entry for global configuration,
and one entry for each interface), any time the configuration is
updated.

9 months agoupdate TODO 36133/head
Lennart Poettering [Wed, 22 Jan 2025 22:27:54 +0000 (23:27 +0100)] 
update TODO

9 months agohomectl: port has_regular_user() + acquire_group_list() to use server-side filtering
Lennart Poettering [Wed, 22 Jan 2025 15:53:01 +0000 (16:53 +0100)] 
homectl: port has_regular_user() + acquire_group_list() to use server-side filtering

9 months agouserdbd: implement server side filtering in the Multiplexer API
Lennart Poettering [Wed, 22 Jan 2025 15:45:52 +0000 (16:45 +0100)] 
userdbd: implement server side filtering in the Multiplexer API

This impelements server side filtering in userdbd's multiplexer logic.
Note thta this means that even if some backend doesn't support it
natively the multiplexer will deal with it and apply the filtering as
necessary.

9 months agouserdb: move UserDBMatch handling from userdbctl into generic userdb code to allow...
Lennart Poettering [Wed, 22 Jan 2025 15:40:47 +0000 (16:40 +0100)] 
userdb: move UserDBMatch handling from userdbctl into generic userdb code to allow it to be done server side

This moves around the UserDBMatch handling, moves it out of userdbctl
and into generic userdb code, so that it can be passed to the server
side, to allow server side filtering.

This is preparation for one day allowing complex software to do such
filtering server side, and thus reducing the necessary traffic.

Right now no server side actually knows this, hence care is taken to
downgrade to the userdb varlink API as it was in v257 in case the new
options are not understood. This retains compatibility with any
implementation hence.

9 months agovarlink: add new calls for server-side user record filtering to varlink IDL + to...
Lennart Poettering [Wed, 22 Jan 2025 15:27:14 +0000 (16:27 +0100)] 
varlink: add new calls for server-side user record filtering to varlink IDL + to spec

This is preparation for adding server side filtering to the userdb
logic: it adds some fields for this to the userdb varlink API. This only
adds the IDL for it, no client will use it for now, no server implement
it. That's added in later commits.

9 months agouser-record: add some helpers for working with UserDBMatch
Lennart Poettering [Wed, 22 Jan 2025 15:26:53 +0000 (16:26 +0100)] 
user-record: add some helpers for working with UserDBMatch

9 months agouser-record: rename USER_DISPOSITION_MASK_MAX → USER_DISPOSITION_MASK_ALL
Lennart Poettering [Fri, 24 Jan 2025 21:15:29 +0000 (22:15 +0100)] 
user-record: rename USER_DISPOSITION_MASK_MAX → USER_DISPOSITION_MASK_ALL

On request by yuwata.

9 months agouser-record: add helper for dispatching a disposition mask
Lennart Poettering [Tue, 21 Jan 2025 11:53:02 +0000 (12:53 +0100)] 
user-record: add helper for dispatching a disposition mask

9 months agomkosi: add loongarch64 to Debian's list of EFI arches
Luca Boccassi [Sat, 25 Jan 2025 01:21:30 +0000 (01:21 +0000)] 
mkosi: add loongarch64 to Debian's list of EFI arches

9 months agoudev: add input/by-{id,path} symlinks for hidraw devices
Nick Rosbrook [Fri, 24 Jan 2025 20:42:38 +0000 (15:42 -0500)] 
udev: add input/by-{id,path} symlinks for hidraw devices

Take some of the same rule structure from 60-persistent-input.rules, and
apply it to hidraw devices in 60-persistent-hidraw.rules.

Since one of the motivations for this is being able to easily reference
FIDO tokens, add a special case when ID_FIDO_TOKEN==1, and add 'fido'
to the symlink.

9 months agoFix typo
ver4a [Mon, 27 Jan 2025 18:20:44 +0000 (19:20 +0100)] 
Fix typo

9 months agoresolved: add link_get_default_route helper
Nick Rosbrook [Thu, 14 Nov 2024 19:31:07 +0000 (14:31 -0500)] 
resolved: add link_get_default_route helper

The dbus property getter for DefaultRoute does not simply check
link->default_route. Instead, if l->default_route is not explicitly
configured, it checks dns_scope_is_default_route(l->unicast_scope).

Add a link_get_default_route() helper with this logic so that it can be
used for consistency.

9 months agoresolved: add a helper to check if DNS server is accessible
Nick Rosbrook [Tue, 15 Oct 2024 20:30:52 +0000 (16:30 -0400)] 
resolved: add a helper to check if DNS server is accessible

We check this by opening a UDP socket and attempting to connect. We do
not send any traffic on it, but this will tell us if there are routes to
the DNS server.

This will be used in a later commit.

9 months agovarlink-util: add varlink_many_notify
Nick Rosbrook [Tue, 8 Oct 2024 14:19:42 +0000 (10:19 -0400)] 
varlink-util: add varlink_many_notify

We already have varlink_many_notifyb. Just re-factor it slightly and add
a plain varlink_many_notify.

9 months agoresolve: rename varlink_subscription -> varlink_query_results_subscription
Nick Rosbrook [Mon, 7 Oct 2024 15:39:57 +0000 (11:39 -0400)] 
resolve: rename varlink_subscription -> varlink_query_results_subscription

No functional change. Make it more clear that these varlink connections
are subscribed to query results. This prepares for adding SubscribeDNS
to the varlink API.

9 months agoCleanups around tty_is_vc() and get_kernel_consoles() (#36171)
Daan De Meyer [Mon, 27 Jan 2025 13:43:39 +0000 (14:43 +0100)] 
Cleanups around tty_is_vc() and get_kernel_consoles() (#36171)

Prompted by #36167
Replaces #36167 and #36175

9 months agomkosi: Update to latest (#36190)
Daan De Meyer [Mon, 27 Jan 2025 13:15:37 +0000 (14:15 +0100)] 
mkosi: Update to latest  (#36190)

9 months agoAdds asus T103HAF rotation matrix to 60-sensor.hwdb (#36177)
16mc1r [Mon, 27 Jan 2025 13:01:05 +0000 (14:01 +0100)] 
Adds asus T103HAF rotation matrix to 60-sensor.hwdb (#36177)

Rotation Matrix to enable correct auto-rotation with
[iio-sensor-proxy](https://gitlab.freedesktop.org/hadess/iio-sensor-proxy/)
on an Asus Transformer Mini T103HAF with iio-sensor `HID-SENSOR-200073`.
- Tested on KDE Plasma Mobile (Fedora 41), details see inxi report.

Device Details:
- low powered 2in1 convertible with 10.1" screen size, 4core atom cpu
and 4gb ram. Usefull as x86 based tablet with stylus for annotation and
reading.
- [official asus website for the
device](https://www.asus.com/us/laptops/for-home/everyday-use/asus-transformer-mini-t103/)

#### inxi device report
```sh
System:
  Host: ------ Kernel: 6.12.10-200.fc41.x86_64 arch: x86_64 bits: 64
  Console: pty pts/3 Distro: Fedora Linux 41 (KDE Plasma Mobile)
Machine:
  Type: Detachable System: ASUSTeK product: T103HAF v: 1.0 serial: J1N0CX212087050
  Mobo: ASUSTeK model: T103HAF v: 1.0 serial: ---------- UEFI: American Megatrends
    v: T103HAF.306 date: 12/05/2017
CPU:
  Info: quad core model: Intel Atom x5-Z8350 bits: 64
Info:
  Memory: total: 4 GiB
```

### udevadm info output for iio-device
```sh
# iio-device / accelerometer
P: /devices/pci0000:00/0000:00:0a.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001F:8086:0001.0004/HID-SENSOR-200073.3.auto/iio:device0
M: iio:device0
R: 0
U: iio
T: iio_device
D: c 234:0
N: iio:device0
L: 0
E: DEVPATH=/devices/pci0000:00/0000:00:0a.0/{33AECD58-B679-4E54-9BD9-A04D34F0C226}/001F:8086:0001.0004/HID-SENSOR-200073.3.auto/iio:device0
E: DEVNAME=/dev/iio:device0
E: DEVTYPE=iio_device
E: MAJOR=234
E: MINOR=0
E: SUBSYSTEM=iio
E: USEC_INITIALIZED=18119681
E: ACCEL_MOUNT_MATRIX=0, -1, 0; 1, 0, 0; 0, 0, -1
E: IIO_SENSOR_PROXY_TYPE=iio-poll-accel iio-buffer-accel
E: SYSTEMD_WANTS=iio-sensor-proxy.service
E: TAGS=:systemd:
E: CURRENT_TAGS=:systemd:
```
### Full `udevadm info  --export-db`
- as requested in
[60-sensor.hwdb](https://github.com/systemd/systemd/blob/ba0266b376d7cc5205d8a4a3d999aec13c24fe5d/hwdb.d/60-sensor.hwdb#L35)
-
[udevadm-info_103HAF.txt](https://github.com/user-attachments/files/18550448/udevadm-info_103HAF.txt)

9 months agocore/dbus-manager: make output argument of transient_unit_from_message() optional
Yu Watanabe [Mon, 27 Jan 2025 00:24:16 +0000 (09:24 +0900)] 
core/dbus-manager: make output argument of transient_unit_from_message() optional

9 months agomkosi: Add VCS_TAG to PassEnvironment= 36190/head
Daan De Meyer [Mon, 27 Jan 2025 10:27:49 +0000 (11:27 +0100)] 
mkosi: Add VCS_TAG to PassEnvironment=

9 months agomkosi: Bump minimum version to 25
Daan De Meyer [Mon, 27 Jan 2025 10:26:29 +0000 (11:26 +0100)] 
mkosi: Bump minimum version to 25

Let's require everyone to be on the now officially released mkosi 25.

9 months agomkosi: Update to latest
Daan De Meyer [Mon, 27 Jan 2025 10:26:13 +0000 (11:26 +0100)] 
mkosi: Update to latest

9 months agomachine: revert type change of "leader" in io.systemd.Machine.Register method
Yu Watanabe [Fri, 24 Jan 2025 19:05:51 +0000 (04:05 +0900)] 
machine: revert type change of "leader" in io.systemd.Machine.Register method

The varlink method io.systemd.Machine.Register() is in v256, hence type
of "leader" cannot be changed.
Let's revert the change by 755cb018c9b3e93245afb86ec94223756ddd70e4, and
introduce another field "leaderProcessId", which takes detailed information
of the process.

Fixes a regression caused by 755cb018c9b3e93245afb86ec94223756ddd70e4.
Fixes #36155.

9 months agojournal-remote: coding style fixlets
Yu Watanabe [Sun, 26 Jan 2025 23:59:05 +0000 (08:59 +0900)] 
journal-remote: coding style fixlets

Co-authored-by: Andrii Chubatiuk <andrew.chubatiuk@gmail.com>
9 months agoman: insert missing varname tag
Ivan Trubach [Sun, 26 Jan 2025 23:49:55 +0000 (08:49 +0900)] 
man: insert missing varname tag

9 months agostrv: drop redundant string_strv_hash_ops
Yu Watanabe [Mon, 27 Jan 2025 03:17:19 +0000 (12:17 +0900)] 
strv: drop redundant string_strv_hash_ops

It is completely equivalent to string_hash_ops_free_strv_free.

9 months agomount-util: make path_get_mount_info_at() also read utab (#36154)
Yu Watanabe [Sun, 26 Jan 2025 23:45:13 +0000 (08:45 +0900)] 
mount-util: make path_get_mount_info_at() also read utab (#36154)

As "_netdev" is only stored in utab.

Fixes a bug introduced by 5261c521e3a98932241f36e91cf6f7823c578aca.
Fixes #35949.

9 months agosystemctl: fix memleak
Yu Watanabe [Sun, 26 Jan 2025 19:17:27 +0000 (04:17 +0900)] 
systemctl: fix memleak

Fixes a bug introduced by adb6cd9be2b7e9e614d2b5835c7b70cf8eacc852.

Fixes #36178.

9 months agohwdb: add MSI Claw 8 AT Keyboard Scancodes (#36180)
honjow [Sun, 26 Jan 2025 19:22:19 +0000 (03:22 +0800)] 
hwdb: add MSI Claw 8 AT Keyboard Scancodes (#36180)

This change maps the right face button to F15 and the left one to F16.
Similar to #33669.

9 months agogetty-generator: port to get_kernel_consoles() 36171/head
Mike Yuan [Sat, 25 Jan 2025 19:42:58 +0000 (20:42 +0100)] 
getty-generator: port to get_kernel_consoles()

9 months agogetty-generator: use generator_add_symlink() where appropriate
Mike Yuan [Sat, 25 Jan 2025 19:58:47 +0000 (20:58 +0100)] 
getty-generator: use generator_add_symlink() where appropriate

9 months agotty-ask-password-agent: do not needlessly spawn subprocesses if there's only one...
Mike Yuan [Sat, 25 Jan 2025 19:30:10 +0000 (20:30 +0100)] 
tty-ask-password-agent: do not needlessly spawn subprocesses if there's only one console

9 months agoterminal-util: make get_kernel_consoles() return > 0 if /dev/console is resolved
Mike Yuan [Sat, 25 Jan 2025 19:19:26 +0000 (20:19 +0100)] 
terminal-util: make get_kernel_consoles() return > 0 if /dev/console is resolved

9 months agologin/pam_systemd: drop redundant vtnr == 0 handling
Mike Yuan [Sat, 25 Jan 2025 21:32:16 +0000 (22:32 +0100)] 
login/pam_systemd: drop redundant vtnr == 0 handling

vtnr_from_tty() treats 0 as invalid.

9 months agoterminal-util: stop doing 0/upper bound check in tty_is_vc()
Mike Yuan [Sun, 26 Jan 2025 00:32:42 +0000 (01:32 +0100)] 
terminal-util: stop doing 0/upper bound check in tty_is_vc()

tty_is_vc() is more often than not used for simple "categorization"
than validity check. E.g. in logind, we first recognize the tty
"looks like vc", and then use vtnr_from_tty() where range check
is performed and vtnr is extracted. In such cases, we want to reject
invalid vtnr from clients rather than silently carry on, hence
let's remove bound check in tty_is_vc().

Fixes #36166
Replaces #36167 and #36175

9 months agonetwork: fix offset of preference in backward compat option
Yu Watanabe [Sun, 26 Jan 2025 00:41:25 +0000 (09:41 +0900)] 
network: fix offset of preference in backward compat option

Fixes a bug introduced by a10d6e0124bb6e202baef9170b019e2e6a7af1fd.

Fixes oss-fuzz#391916479 (https://issues.oss-fuzz.com/issues/391916479).
Fixes #36172.

9 months agoboot: Improve log message
Daan De Meyer [Sat, 25 Jan 2025 19:42:54 +0000 (20:42 +0100)] 
boot: Improve log message

9 months agoAdd loong64 as an option in a few more places (#36163)
Yu Watanabe [Sun, 26 Jan 2025 00:35:42 +0000 (09:35 +0900)] 
Add loong64 as an option in a few more places (#36163)

9 months agoresolved: do not disable mdns/llmnr globally if it's enabled on any link (#36158)
Luca Boccassi [Sat, 25 Jan 2025 10:49:44 +0000 (10:49 +0000)] 
resolved: do not disable mdns/llmnr globally if it's enabled on any link (#36158)

Fixes a regression caused by 2976730a4d34749bfb7a88da341464f1834ab1c6.
Fixes #36078.
Fixes #36126.

Replaces #36153.
Replaces #36156.

9 months agotools: add loongarch64 to debug-sd-boot script 36163/head
Luca Boccassi [Sat, 25 Jan 2025 01:20:47 +0000 (01:20 +0000)] 
tools: add loongarch64 to debug-sd-boot script

9 months agoukify: add riscv32 to --efi-arch
Luca Boccassi [Sat, 25 Jan 2025 01:25:28 +0000 (01:25 +0000)] 
ukify: add riscv32 to --efi-arch

It is supported in the arch mapping at the top and in elf2efi, so add it here too

9 months agoukify: add loongarch64 to --efi-arch
Luca Boccassi [Sat, 25 Jan 2025 01:19:53 +0000 (01:19 +0000)] 
ukify: add loongarch64 to --efi-arch

9 months agoresolved: stop mdns/llmnr if no interface request it after bus method 36158/head
Yu Watanabe [Fri, 24 Jan 2025 19:48:00 +0000 (04:48 +0900)] 
resolved: stop mdns/llmnr if no interface request it after bus method

9 months agoresolved: do not disable mdns/llmnr globally if it's enabled on any link
Yu Watanabe [Fri, 24 Jan 2025 19:48:00 +0000 (04:48 +0900)] 
resolved: do not disable mdns/llmnr globally if it's enabled on any link

Fixes a regression caused by 2976730a4d34749bfb7a88da341464f1834ab1c6.

Fixes #36078.
Fixes #36126.

Co-authored-by: Luca Boccassi <luca.boccassi@gmail.com>
9 months agoman: fix reference to non-existing ukify parameter
Luca Boccassi [Fri, 24 Jan 2025 23:37:33 +0000 (23:37 +0000)] 
man: fix reference to non-existing ukify parameter

The --extend parameter was removed by https://github.com/systemd/systemd/pull/34608
and a --join-profile was added instead, fix leftover reference in manpage

Follow-up for 3891d57c4f768cb648e1a85483216eadae0b101e

9 months agolibmount-util: introduce two helper functions 36154/head
Yu Watanabe [Sat, 25 Jan 2025 00:33:58 +0000 (09:33 +0900)] 
libmount-util: introduce two helper functions

This introduces libmount_parse_mountinfo() and libmount_parse_with_utab().
The former one parses only mountinfo, but the latter one also parse
utab. Hopefully this avoids pitfalls like issue #35949.

9 months agomount-util: make path_get_mount_info_at() also read utab
Yu Watanabe [Fri, 24 Jan 2025 17:35:21 +0000 (02:35 +0900)] 
mount-util: make path_get_mount_info_at() also read utab

As "_netdev" is only stored in utab.

Fixes a bug introduced by 5261c521e3a98932241f36e91cf6f7823c578aca.
Fixes #35949.

9 months agohomed: when setting up an idmapping map foreign UID range on itself
Lennart Poettering [Fri, 24 Jan 2025 15:54:05 +0000 (16:54 +0100)] 
homed: when setting up an idmapping map foreign UID range on itself

Now that nspawn can run unprivileged off directory trees owned by
the new "foreign" UID range let's make sure homed actually allows
files owned by that range in the home directories.

This is not enough to make nspawn just work in homed home dirs
unfortunately though. that's because homed applies an idmapping, and
nspawn would need to then to take that idmapped mount and apply another
one, and the kernel simply doesn't support stacked idmapped mounts.
There's work ongoing to address that in the kernel.

However, this is a first step, and should be enough to make things just
work should the kernel eventually support stacked idmapped mounts.

9 months agosd-json: silence false positive warning by coverity
Yu Watanabe [Fri, 24 Jan 2025 13:53:13 +0000 (22:53 +0900)] 
sd-json: silence false positive warning by coverity

An object json is a set of key and value pair, hence has its number of
element is multiple of two, and we know at least two elements there.

Follow-up for b6a2df630701de0bcf77850ced213d7fc3d0c4de.
Fixes CID#1590724

9 months agodelta: cleanup coding style and add missing error check (#36146)
Yu Watanabe [Fri, 24 Jan 2025 20:30:58 +0000 (05:30 +0900)] 
delta: cleanup coding style and add missing error check (#36146)

9 months agoudev-rules: use sd_device_set_sysattr_value() to write sysfs attribute (#36142)
Yu Watanabe [Fri, 24 Jan 2025 20:30:21 +0000 (05:30 +0900)] 
udev-rules: use sd_device_set_sysattr_value() to write sysfs attribute (#36142)

Then, we can avoid that files outside of sysfs are written by udev ATTR
key.

9 months agotree-wide: insert a space at the end of comments
Yu Watanabe [Fri, 24 Jan 2025 20:16:27 +0000 (05:16 +0900)] 
tree-wide: insert a space at the end of comments

9 months agoTwo HACKING.md improvements (#36152)
Daan De Meyer [Fri, 24 Jan 2025 17:12:10 +0000 (18:12 +0100)] 
Two HACKING.md improvements (#36152)

9 months agoHACKING: Drop run0 from mkosi boot invocation 36152/head
Daan De Meyer [Fri, 24 Jan 2025 16:29:58 +0000 (17:29 +0100)] 
HACKING: Drop run0 from mkosi boot invocation

mkosi will itself use run0 or sudo when not running as root to invoke
systemd-nspawn, so no need to do it in HACKING.md.

9 months agoHACKING: Move OBS section further down
Daan De Meyer [Fri, 24 Jan 2025 16:28:15 +0000 (17:28 +0100)] 
HACKING: Move OBS section further down

HACKING.md should first and foremost tell someone how to hack on
systemd, installing packages from OBS isn't the most likely section
a new contributor will be interested in, so let's move it further
down.

9 months agoudev-rules: use sd_device_set_sysattr_value() to write sysfs attribute 36142/head
Yu Watanabe [Sat, 11 Jan 2025 23:22:53 +0000 (08:22 +0900)] 
udev-rules: use sd_device_set_sysattr_value() to write sysfs attribute

Then, we can avoid that files outside of sysfs are written by udev ATTR key.

This also makes
- logs failure in udev_resolve_subsys_kernel(),
- failure in sd_device_get_syspath() critical, as that should not happen,
- cache the value to be write when running on test mode, to make it
  shown by OPTIONS="dump" or obtained by ATTR match token.

9 months agosd-device: move the check if sysattr entry should be cached into device_cache_sysattr...
Yu Watanabe [Fri, 24 Jan 2025 14:58:02 +0000 (23:58 +0900)] 
sd-device: move the check if sysattr entry should be cached into device_cache_sysattr_value()

No functional change. Preparation for the next commit.

9 months agosd-device: make device_get_cached_sysattr_value() static
Yu Watanabe [Fri, 24 Jan 2025 14:47:44 +0000 (23:47 +0900)] 
sd-device: make device_get_cached_sysattr_value() static

9 months agohomectl: minor man page improvements (#36148)
Lennart Poettering [Fri, 24 Jan 2025 14:32:27 +0000 (15:32 +0100)] 
homectl: minor man page improvements (#36148)

9 months agohomectl: move --umask=/--access-mode= help/man sections 36148/head
Lennart Poettering [Fri, 24 Jan 2025 12:34:16 +0000 (13:34 +0100)] 
homectl: move --umask=/--access-mode= help/man sections

These don't really have much to do about resource mgmt, but are more
about security, hence let's move them away from the resource mgmt
section.

9 months agoman: add some sections to homectl man page
Lennart Poettering [Fri, 24 Jan 2025 12:31:51 +0000 (13:31 +0100)] 
man: add some sections to homectl man page

This adds the same sections we already have in the homectl --help blurb
also to the man page.

While we are at it, let's also add a new section for Authentication
related switches.

9 months agodelta: add missing error check 36146/head
Yu Watanabe [Fri, 24 Jan 2025 13:46:55 +0000 (22:46 +0900)] 
delta: add missing error check

Fixes CID#1590726.

9 months agodelta: use r for storing error code
Yu Watanabe [Fri, 24 Jan 2025 13:46:35 +0000 (22:46 +0900)] 
delta: use r for storing error code

9 months agomkosi: update debian commit reference
Luca Boccassi [Fri, 24 Jan 2025 12:09:52 +0000 (12:09 +0000)] 
mkosi: update debian commit reference

4447d2974d Update changelog for 257.2-3 release
4b1c65b905 libudev1: add udeb back to shlibs
1974e3d06e systemd-boot: always check that the boot entry is set, even with Shim is already installed
9a5eea9823 systemd-boot: use boot entry argument instead of installing as grub.efi on ESP
df6efeed46 libsystemd-dev/libudev-dev: depend on libcap-dev
5673b771e1 signing template: add override for executable-not-elf-or-script
3f109637c4 Update changelog for 257.2-2 release
42f4afa605 Drop udeb packages
c04f7f2b16 signing template: always set urgency to 'high'
9bd8b5228b Set SBAT info for upstream build
257ba8563b udev: link to libsystemd-shared when building with noudeb profile
8ca2b26678 Link systemctl against libsystemd-shared
1a4a8af0c2 Install jq for pkg.systemd.upstream too since the template packages are now built
6fd0d2698d signing template: fix Lintian warnings and errors
c79d10bbaa Build template packages for pkg.systemd.upstream profile, for OBS builds
485a867438 d/t/upstream: take into account autopkgtest pinning
c1b6e565e3 Update README.source in the signing-template
17d1b92d9f d/t/control: remove 'flaky' from tests-in-lxd
2a36f6f5e1 Do not install sd-resolved and drop breaks-testbed from fast tests
a3cb52f8d0 Enable UEFI on loong64
ad7a943023 Enable libseccomp on loong64 and hppa
9d24f84ed5 Update changelog for 257.2-1 release
f47619c9f4 Drop all patches, merged upstream
d4aa6545a6 Install new files for upstream CI
5775daa46e d/rules: support building in OBS from git

9 months agosd-device: fix typo
Yu Watanabe [Fri, 24 Jan 2025 13:13:00 +0000 (22:13 +0900)] 
sd-device: fix typo

Follow-up for 8d89667abaa8b569c2ac9e37752c404cebdfaaaa.

9 months agomntfsd: fix typo
Yu Watanabe [Fri, 24 Jan 2025 13:12:01 +0000 (22:12 +0900)] 
mntfsd: fix typo

Follow-up for d6f8e1ae879ed1676406b61b6f4dba1bdd3749ae.

9 months agopam_systemd: fix typo
Yu Watanabe [Fri, 24 Jan 2025 13:10:33 +0000 (22:10 +0900)] 
pam_systemd: fix typo

Follow-up for 30de5691744781277f992a25afa268518f3fe711.

9 months agostrv: fix typo
Yu Watanabe [Fri, 24 Jan 2025 13:08:53 +0000 (22:08 +0900)] 
strv: fix typo

Follow-up for 5072f4268b89a71e47e59c434da0222f722c7f0e.

9 months agoEnforce per-user quota on /tmp/ and /dev/shm/ as user logs in (#36010)
Lennart Poettering [Fri, 24 Jan 2025 11:52:27 +0000 (12:52 +0100)] 
Enforce per-user quota on /tmp/ and /dev/shm/ as user logs in (#36010)

There's finally quota on tmpfs, hence let's use it to make it harder for
users to DoS the system by consuming all disk space in /tmp/ and
/dev/shm/.

This enforces a default limit of 80% quota of the backing fs for these
two dirs for users, but this can be overriden in the user record, if
desired.

This also adds two other interesting features:

1. mount units gain GracefulOptions= which takes optional mount options
that are added only if supported by the kernel. (this is used to enable
usrquota on /tmp/, if available.)
2. The PAM logic in service management now supports reading passwords
from service credentials and via the askpw logic. This used for make
testing easy (so that we can run0 into a homed user which strictly
requires a password).

9 months agomkosi: Drop usage of _systemd_QUIET in arch build script
Daan De Meyer [Fri, 24 Jan 2025 09:54:51 +0000 (10:54 +0100)] 
mkosi: Drop usage of _systemd_QUIET in arch build script

We dropped the variable in the packaging specs for Arch to keep the
integration points as minimal as possible so let's stop using it in
the build script as well.

9 months agotest: split VM-only subtests from TEST-74-AUX-UTILS to new VM-only test
Luca Boccassi [Thu, 21 Nov 2024 09:51:14 +0000 (09:51 +0000)] 
test: split VM-only subtests from TEST-74-AUX-UTILS to new VM-only test

TEST-74-AUX-UTILS covers many subtests, as it's a catch-all job, and a few
need a VM to run. The job is thus marked VM-only. But that means in settings
where we can't run VM tests (no KVM available), the entire thing is skipped,
losing tons of coverage that doesn't need skipping.

Move the VM-only subtests to TEST-87-AUX-UTILS-VM that is configured to only
run in VMs under both runners. This way we keep the existing tests as-is, and
we can add new VM-only tests without worrying. This is how the rest of the
tests are organized.

Follow-up for f4faac20730cbb339ae05ed6e20da687a2868e76

9 months agonspawn: support unpriv directory-tree containers (#35685)
Lennart Poettering [Thu, 23 Jan 2025 22:34:37 +0000 (23:34 +0100)] 
nspawn: support unpriv directory-tree containers (#35685)

So far nspawn supported unpriv containers only if backed by a DDI. This
adds dir-based unpriv containers too.

To make this work this introduces a new UID concept to systemd: the
"foreign UID range". This is a high UID range of size 64K. The idea is
that disk images that are "foreign" to the local system can use that,
and when a container or similar is invoked from it, a transiently
allocated dynamic UID range is mapped from that foreign UID range via id
mapped mounts.

This means the fully dynamic, transient UID ranges never hit the disk,
which should vastly simplify management, and does not require that uid
"subranges" are persistently delegated to any users.

The mountfsd daemon gained a new method call for acquiring an idmapped
mount fd for an mount tree owned by the foreign UID range. Access is
permitted to unpriv clients – as long as the referenced inode is located
within a dir owned by client's own uid range.

9 months agoThree minor refactorings for userdb code (#36141)
Lennart Poettering [Thu, 23 Jan 2025 22:04:48 +0000 (23:04 +0100)] 
Three minor refactorings for userdb code (#36141)

Nothing earth shattering, but some minor refactorings split out of and
preparation for #36133

9 months agosd-varlink/sd-json: add two new API calls (#36137)
Lennart Poettering [Thu, 23 Jan 2025 21:40:19 +0000 (22:40 +0100)] 
sd-varlink/sd-json: add two new API calls (#36137)

These are kinda no-brainers, should have always existed.

Split out of #36133 which needs them.