Commit Graph

84193 Commits

Author SHA1 Message Date
Lennart Poettering
1f3f40f0ff networkd: call networkd a "network management" rather "network configuration" tool
This has irked me for a while. For me network configuration is the stuff
we store on disk in configuration file. And networkd then *applies* the
configuration. But the units so far claimed that networkd was the
"configuration" itself. Which I guess might make sense to some, but to
me sounds a bit unprecise. Let's clean this up, and call what networkd
is doing "Network Management".
2025-10-20 18:17:29 +02:00
Daan De Meyer
cbbc7e51ec core: adding cgroup/invocationid lookups to io.systemd.Unit.List (#38032) 2025-10-20 17:15:34 +02:00
Yu Watanabe
97d38155db Several preparations for supporting new coredump interface (#39350) 2025-10-20 20:44:22 +09:00
Yu Watanabe
94a23e9c44 coredumpctl: fix condition for checking coredump journal entry
If one of PID, UID, GID, or SIGNAL is missing, then parse_uid() and
friends in the below will trigger assertion. This fixes that.

Also, only PID, UID, GID, SIGNAL, and COMM are mandatory fields, but
others are not, hence this drops others from the condition.

Moreover, this mekes 'coredumpctl --list' not fail even if there exists a
broken coredump entry in journal.
2025-10-20 20:43:45 +09:00
Lennart Poettering
342084b035 loop-util: explain why we propagate discard_max_bytes from backing block device to loopback block device
Follow-up for: 29ee9c6fb7
2025-10-20 12:33:50 +01:00
Yu Watanabe
20332d7caf network/dhcp-server: several follow-ups for domain option (#39380)
Follow-ups for 3eb7b881bd (#39260).
2025-10-20 20:17:59 +09:00
Ivan Kruglov
959a8e49f4 core: enable SELinux checks in io.systemd.Unit.List 2025-10-20 03:58:55 -07:00
Ivan Kruglov
8b1f7f13f0 test: lookup a unit by cgroup and invocationID in TEST-74-AUX-UTILS.varlinkctl 2025-10-20 03:58:55 -07:00
Ivan Kruglov
6c2c2e0598 core: io.systemd.Unit.List can lookup by InvocationID 2025-10-20 03:58:53 -07:00
Ivan Kruglov
6b78d931cd core: io.systemd.Unit.List can lookup unit by CGroup 2025-10-20 03:58:39 -07:00
nkraetzschmar
29ee9c6fb7 loop-util: mirror discard limits from backing device 2025-10-20 12:49:39 +02:00
Yu Watanabe
d19294e92a sd-dhcp-server: fix conditions for checking if static address is assigned to another host
Even if a static lease may be configured for a host, another address may
be previously assigned to the host. Let's not refuse to assign the
static lease to the host even in that case.

Fixes an issue reported at
https://github.com/systemd/systemd/issues/35781#issuecomment-3369545753.
2025-10-20 11:45:45 +01:00
jouyouyun
85eae6ba35 gitignore: add aider
Aider is an open-source AI coding assistant. When used, it generates history,
cache, and other files in the project. To prevent these files from being committed, you need to add .aider* to your .gitignore file
2025-10-20 11:39:25 +01:00
Daan De Meyer
9c3359f28a ptyfwd: Always prioritize $SYSTEMD_TINT_BACKGROUND
By giving priority to --background= we prevent users from opting
out of coloring if an explicit color is chosen by a tool wrapping
one of our own tools. Instead, let's give priority to the environment
variable, so that even if our tools are wrapped by another tool with
a different background, users can still opt out of coloring just by
setting the environment variable, which has a high chance of being
forwarded to the invocation of our own tools which makes it easy to
use to disable color tinting globally if requested by the user.
2025-10-20 12:20:35 +02:00
Daan De Meyer
5c54ffa208 resolved: move DNS RR/key/naswer/question/packet code to shared/ + other tweaks (#39324) 2025-10-20 12:20:10 +02:00
Ivan Kruglov
4ddd3fe1fb core: make name/pid lookup params use AND logic in io.systemd.Unit.List 2025-10-20 02:10:57 -07:00
Ivan Kruglov
366f57bff4 basic: pidref_is_set_or_automatic() 2025-10-20 02:10:00 -07:00
Lennart Poettering
e5dc5821ff dns-domain: make dns_name_change_suffix() work with an empty/null suffix 2025-10-20 10:35:23 +02:00
Lennart Poettering
970bedb6d8 dns-rr: when decoding an RR from json, make class optional
The DNS RR class is a weird thing, and IRL always set to IN (i.e. 0x1).
Let's hence make it something that can be specified optionally, and
imply IN if not specified.

This makes it a bit nicer to put together suitable json resource record
keys from the command line.
2025-10-20 10:35:23 +02:00
Lennart Poettering
5751b236a5 resolved: move DNS RR/key/answer/question/packet tools to shared/
We want to reuse these generic DNS concepts in resolved hook
implementations, hence move them to shared code.

(This also enables us to immediately remove som SVCB record handling
duplicate definitions.)

No real code changes, just some moving around of things.
2025-10-20 10:35:23 +02:00
Thomas Mühlbacher
226e050a0d stub: check load options a little more carefully
This can lead to booting with a completely garbled command line with characters
being interpreted as miscellaneous CJK or symbols.

According to the UEFI spec, the optional data of the load option is just a
binary data buffer.
2025-10-20 10:28:41 +02:00
Nick Labich
942ad8503a sysext: Configure overlayfs mount options via envvar
Implements #39314
2025-10-20 09:59:02 +02:00
Yu Watanabe
5b09b43106 Don't tag i2c mice as pointing sticks (#39264)
There are no real i2c mice but there are i2c `FooBar Mouse` devices that
are an artifact of how the HID kernel drivers split up event nodes.
These nodes will be seen for some i2c keyboards and touchpads, depending
on the HID report descriptor.

Let's not tag those as pointing sticks.

Closes #36677
2025-10-20 15:04:27 +09:00
Yu Watanabe
b200f57bfa man: fix position of </para> tag
Follow-up for 65664bba40.
2025-10-20 14:26:46 +09:00
Peter Hutterer
c4f072aaad hwdb: don't tag a named Mouse device as pointingstick
The generic kernel hid drivers split up devices based on the application
collection, appending a suffix for each collection (e.g. Touchpad,
Mouse, ...). Many i2c touchpads get a "... Mouse" event node which is
mislabelled as pointingstick by the input_id builtin, see commit
3d7ac1c655.

Closes: https://github.com/systemd/systemd/issues/36677
2025-10-20 14:14:39 +10:00
Peter Hutterer
5b647b84a9 rules: extend 60-input-id.rules to allow for bus/vid/pid/name matches
Same approach as used in 70-mouse.rules, allow for a name-based match
optionally combined with bus/vid/pid (which the existing modalias rule
would already allow us anyway). Note that ID_BUS isn't assigned until
after this rule has run so we need to use the id/bustype attribute
directly.

Related to https://github.com/systemd/systemd/issues/36677
2025-10-20 14:14:39 +10:00
Yu Watanabe
b25fac6776 network/dhcp-server: several cleanups for setting domain to DHCP server
- use dns_name_parent(),
- only ignore errors when the current hostname does not have domain
  part, but make other errors like ENOMEM critical.

Follow-ups for 3eb7b881bd.
2025-10-20 12:21:04 +09:00
Yu Watanabe
c6d97d9e08 test: add unit test for dns_name_parent() 2025-10-20 12:01:22 +09:00
Yu Watanabe
aeef3c313b man: fix typo
Follow-up for 938f7fea7c.
2025-10-20 11:25:46 +09:00
Marien Zwart
1599b6fbe2 docs: fix conversion / calculation errors
0x1770 is 6000, not 60000. It looks like 60000 is intended (the next
range starts at 60000 in both decimal and hex), so use that.

1000 to 60000 is 59001 users, as the range is inclusive on both sides.
Similar off-by-one for one of the "unused" ranges. After these changes,
the sizes of the ranges up to and including the "-1" ID sum up to 65536,
as expected.

I'm not sure where the size of the unused range after the container UID
range came from, but it is not correct (the "Container UID" and this
reserved range combined would be larger than the "HIC SVNT LEONES" 2^31
to 2^32-2 range...). Fix it.

It is unfortunate that the first half of this table makes more sense in
decimal while the second half makes more sense in hex (which would also
make the size in 65536 chunks easy to obtain): I'm tempted to add a
"sizes in hex" column...
2025-10-20 10:36:08 +09:00
Yu Watanabe
64595f1cb3 hostname-setup: introduce pidref_gethostname_full() 2025-10-19 10:01:46 +09:00
Yu Watanabe
d10596a6e0 iovec-wrapper: introduce iovw_put_string_fieldf() 2025-10-19 10:01:46 +09:00
Yu Watanabe
a5cdc2be70 iovec-wrapper: introduce iovw_replace_string_field() 2025-10-19 10:01:46 +09:00
Yu Watanabe
0c37508494 pidfd-util: expose pidfd_get_info() 2025-10-19 10:01:46 +09:00
Yu Watanabe
208f88def3 include: update struct pidfd_info and relevant constants 2025-10-19 10:01:46 +09:00
Yu Watanabe
b31a571849 include: import linux/coredump.h from kernel v6.17.1 2025-10-19 10:01:46 +09:00
Luca Boccassi
d29f181cf0 ci: add bpftool workaround to coverity too 2025-10-18 15:43:06 +01:00
Yu Watanabe
a6836cfa0b ci: fix workaround about bpftool for codeql
Follow-up for e9fd2bbfff.
2025-10-18 09:10:35 +02:00
Luca Boccassi
5ee8ffb5c5 Assorted coverity fixes (#39355) 2025-10-17 20:30:09 +01:00
Luca Boccassi
dc567bc406 mkosi: install new knot-keymgr in Fedora rawhide
52aa1c6b27

TEST-75-RESOLVED.sh[116]: + keymgr . generate algorithm=ECDSAP256SHA256 ksk=yes zsk=yes
TEST-75-RESOLVED.sh[454]: /usr/lib/systemd/tests/testdata/units/TEST-75-RESOLVED.sh: line 153: keymgr: command not found
2025-10-17 18:35:29 +01:00
Luca Boccassi
b62c681b11 log: add underflow assert guard
We often use ssize_t in log_error macros, but typically return int
which confuses coverity, as technically there is no guarantee that
int and ssize_t have the same range. Add an assert to enforce it.
2025-10-18 01:11:49 +09:00
Luca Boccassi
e9fd2bbfff ci: add bpftool workaround to codeql job too 2025-10-18 01:11:11 +09:00
Luca Boccassi
d0a066a1a4 test: avoid divide-by-zero coverity warning
CID#1587762
2025-10-17 16:44:15 +01:00
Luca Boccassi
8112069be0 bpf: do not leak dlopen object
CID#1609833
2025-10-17 16:44:15 +01:00
Luca Boccassi
05d45875f7 efivars: fix potential memory leak
If 'ret' is not passed, 'x' is leaked

Follow-up for c8d60ae79d

CID#1621673
2025-10-17 16:44:15 +01:00
Luca Boccassi
8240a0942b blockdev-list: add overflow check assert
Fixes coverity warning

CID#1630794
2025-10-17 16:44:15 +01:00
Luca Boccassi
d275410086 dissect: drop leftover assert
This was refactored, and the assert is now wrongly placed. Drop
it to fix coverity warning.

Follow-up for dfdeb0b1cb

CID#1639975
2025-10-17 16:42:24 +01:00
Luca Boccassi
3b11139c0d ci: re-enable bpf-framework option for build and unit test jobs
Use the same trickery we do in the package build and search for
the actual bpftool binary. For the CI job any one we find is
good enough.
When we switch all jobs to 26.04 we can drop all of this.

This reverts commit cc814110af.
2025-10-17 15:08:54 +01:00
Frantisek Sumsal
1ec5d43a0e test: let kernel OOM-kill a child process instead of the main one
This test occasionally fails due to a race where systemd processes
kernel's SIGKILL before the OOM notification, so the test service dies
with Result=signal instead of the expected Result=oom-kill:

[   51.008765] TEST-55-OOMD.sh[906]: + systemd-run --wait --unit oom-kill -p OOMPolicy=kill -p Delegate=yes -p DelegateSubgroup=init.scope /tmp/script.sh
[   51.048747] TEST-55-OOMD.sh[907]: Running as unit: oom-kill.service; invocation ID: 456645347d554ea2878463404b181bd8
[   51.066296] sysrq: Manual OOM execution
[   51.066596] kworker/1:0 invoked oom-killer: gfp_mask=0xcc0(GFP_KERNEL), order=-1, oom_score_adj=0
[   51.066915] CPU: 1 UID: 0 PID: 27 Comm: kworker/1:0 Not tainted 6.17.1-arch1-1 #1 PREEMPT(full)  d2b229857b2eb4001337041f41d3c4f131433540
[   51.066919] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS Arch Linux 1.17.0-2-2 04/01/2014
[   51.066921] Workqueue: events moom_callback
[   51.066928] Call Trace:
[   51.066931]  <TASK>
[   51.066936]  dump_stack_lvl+0x5d/0x80
[   51.066942]  dump_header+0x43/0x1aa
<...snip...>
[   51.087814] 47583 pages reserved
[   51.087969] 0 pages cma reserved
[   51.088208] 0 pages hwpoisoned
[   51.088519] Out of memory: Killed process 908 (sleep) total-vm:3264kB, anon-rss:256kB, file-rss:1916kB, shmem-rss:0kB, UID:0 pgtables:44kB oom_score_adj:1000
[   51.090263] TEST-55-OOMD.sh[907]:           Finished with result: signal
[   51.094416] TEST-55-OOMD.sh[907]: Main processes terminated with: code=killed, status=9/KILL
[   51.094898] TEST-55-OOMD.sh[907]:                Service runtime: 58ms
[   51.095436] TEST-55-OOMD.sh[907]:              CPU time consumed: 22ms
[   51.095854] TEST-55-OOMD.sh[907]:                    Memory peak: 1.6M (swap: 0B)
[   51.096722] TEST-55-OOMD.sh[912]: ++ systemctl show oom-kill -P Result
[   51.106549] TEST-55-OOMD.sh[879]: + assert_eq signal oom-kill
[   51.107394] TEST-55-OOMD.sh[913]: + set +ex
[   51.108256] TEST-55-OOMD.sh[913]: FAIL: expected: 'oom-kill' actual: 'signal'
[FAILED] Failed to start TEST-55-OOMD.service.

To mitigate this, let's spawn a child process and move it to the
subcgroup to get killed instead of the main process, so systemd has more
time to react to the OOM notification and terminate the service with the
expected oom-kill result.
2025-10-17 15:19:16 +02:00
Daan De Meyer
b8ee7c2206 tree-wide: Various forward header cleanups
- Make sure forward headers have the iwyu pragma to always keep them
- Make sure we always include the daemon specific forward header
  instead of shared-forward.h
- Remove shared-forward.h include where the daemon specific forward
  header is already included
2025-10-17 21:11:23 +09:00