Commit Graph
87002 Commits
Author SHA1 Message Date
Frantisek Sumsal be0db50cad fuzz: add a fuzzer for user records
Add a simple fuzzer that verifies our machinery for parsing user records
from JSON works as intended.

The initial corpus was created with the help of Claude, so we have a
bunch of valid user records with as much fields as possible for the
initial corpus.
2026-03-06 19:03:14 +01:00
Frantisek Sumsal ad1c7df5f9 man: fix short option for userdbctl's --from-file= 2026-03-06 18:39:07 +01:00
Frantisek Sumsal 3c7bd947b2 shared: don't leak memory from array fields
The fido2_hmac_salt/fido2_hmac_credential/recovery_key fields kept
leaking memory as the array itself wasn't deallocated after deallocating
each of its elements data:

$ build-san/userdbctl -F fuzz-corpus-userdb/auth-fido2.json
...
=================================================================
==1292840==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 112 byte(s) in 1 object(s) allocated from:
    #0 0x7f56f00e5e4b in realloc.part.0 (/lib64/libasan.so.8+0xe5e4b) (BuildId: 25975f766867e9e604dc5a71a8befeaed3301942)
    #1 0x7f56ed869e42 in greedy_realloc ../src/basic/alloc-util.c:65
    #2 0x7f56ed7ff5e9 in dispatch_fido2_hmac_salt ../src/shared/user-record.c:836
    #3 0x7f56edd73cbc in sd_json_dispatch_full ../src/libsystemd/sd-json/sd-json.c:5204
    #4 0x7f56edd745fc in sd_json_dispatch ../src/libsystemd/sd-json/sd-json.c:5276
    #5 0x7f56ed80100b in dispatch_privileged ../src/shared/user-record.c:998
    #6 0x7f56edd73cbc in sd_json_dispatch_full ../src/libsystemd/sd-json/sd-json.c:5204
    #7 0x7f56edd745fc in sd_json_dispatch ../src/libsystemd/sd-json/sd-json.c:5276
    #8 0x7f56ed80622c in user_record_load ../src/shared/user-record.c:1697
    #9 0x000000408c15 in display_user ../src/userdb/userdbctl.c:447
    #10 0x7f56ed83cc9a in dispatch_verb ../src/shared/verbs.c:137
    #11 0x00000041df2b in run ../src/userdb/userdbctl.c:1908
    #12 0x00000041dfbe in main ../src/userdb/userdbctl.c:1911
    #13 0x7f56ec8105b4 in __libc_start_call_main (/lib64/libc.so.6+0x35b4) (BuildId: 2b5beec0fd24fe9c9f43eddfdd5facf0b8a1b805)
    #14 0x7f56ec810667 in __libc_start_main@@GLIBC_2.34 (/lib64/libc.so.6+0x3667) (BuildId: 2b5beec0fd24fe9c9f43eddfdd5facf0b8a1b805)
    #15 0x000000404a44 in _start (/home/fsumsal/repos/@systemd/systemd/build-san/userdbctl+0x404a44) (BuildId: 19e8b7e7b7038d2cea20bc18a55bea2a9e4406d5)

Direct leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7f56f00e5e4b in realloc.part.0 (/lib64/libasan.so.8+0xe5e4b) (BuildId: 25975f766867e9e604dc5a71a8befeaed3301942)
    #1 0x7f56ed869e42 in greedy_realloc ../src/basic/alloc-util.c:65
    #2 0x7f56ed7fe779 in dispatch_fido2_hmac_credential_array ../src/shared/user-record.c:775
    #3 0x7f56edd73cbc in sd_json_dispatch_full ../src/libsystemd/sd-json/sd-json.c:5204
    #4 0x7f56edd745fc in sd_json_dispatch ../src/libsystemd/sd-json/sd-json.c:5276
    #5 0x7f56ed80622c in user_record_load ../src/shared/user-record.c:1697
    #6 0x000000408c15 in display_user ../src/userdb/userdbctl.c:447
    #7 0x7f56ed83cc9a in dispatch_verb ../src/shared/verbs.c:137
    #8 0x00000041df2b in run ../src/userdb/userdbctl.c:1908
    #9 0x00000041dfbe in main ../src/userdb/userdbctl.c:1911
    #10 0x7f56ec8105b4 in __libc_start_call_main (/lib64/libc.so.6+0x35b4) (BuildId: 2b5beec0fd24fe9c9f43eddfdd5facf0b8a1b805)
    #11 0x7f56ec810667 in __libc_start_main@@GLIBC_2.34 (/lib64/libc.so.6+0x3667) (BuildId: 2b5beec0fd24fe9c9f43eddfdd5facf0b8a1b805)
    #12 0x000000404a44 in _start (/home/fsumsal/repos/@systemd/systemd/build-san/userdbctl+0x404a44) (BuildId: 19e8b7e7b7038d2cea20bc18a55bea2a9e4406d5)

SUMMARY: AddressSanitizer: 176 byte(s) leaked in 2 allocation(s).
2026-03-06 18:39:07 +01:00
Frantisek Sumsal 76ab7861ff shared: don't exclude valid min/max values for cgroup weight fields
1 and 10000 are valid cgroup weight values, but the condition was
incorrectly excluding them:

$ echo '{"userName":"crashhostarray","cpuWeight":1}' | userdbctl -F -
<stdin>:1:42: JSON field 'cpuWeight' is not in valid range 1…10000.

$ echo '{"userName":"crashhostarray","cpuWeight":10000}' | userdbctl -F -
<stdin>:1:42: JSON field 'cpuWeight' is not in valid range 1…10000.
2026-03-06 18:39:01 +01:00
Frantisek Sumsal 1e2517bf2e shared: fix segfault when processing matchHostname field
Fix a typo which causes a segfault when processing a user record
with matchHostname when it's an array instead of a simple string:

$ echo '{"userName":"crashhostarray","perMachine":[{"matchHostname":["host1","host2"],"locked":false}]}' | userdbctl -F -
Segmentation fault         (core dumped)

$ coredumpctl info
...
       Message: Process 1172301 (userdbctl) of user 1000 dumped core.

                Module libz.so.1 from rpm zlib-ng-2.3.3-1.fc43.x86_64
                Module libcrypto.so.3 from rpm openssl-3.5.4-2.fc43.x86_64
                Stack trace of thread 1172301:
                #0  0x00007fded7b3a656 __strcmp_evex (libc.so.6 + 0x159656)
                #1  0x00007fded7e95397 per_machine_hostname_match (libsystemd-shared-260.so + 0x295397)
                #2  0x00007fded7e955b5 per_machine_match (libsystemd-shared-260.so + 0x2955b5)
                #3  0x00007fded7e957c6 dispatch_per_machine (libsystemd-shared-260.so + 0x2957c6)
                #4  0x00007fded7e96c97 user_record_load (libsystemd-shared-260.so + 0x296c97)
                #5  0x000000000040572d display_user (/home/fsumsal/repos/@systemd/systemd/build/userdbctl + 0x572d)
                #6  0x00007fded7ea9727 dispatch_verb (libsystemd-shared-260.so + 0x2a9727)
                #7  0x000000000041077c run (/home/fsumsal/repos/@systemd/systemd/build/userdbctl + 0x1077c)
                #8  0x00000000004107ce main (/home/fsumsal/repos/@systemd/systemd/build/userdbctl + 0x107ce)
                #9  0x00007fded79e45b5 __libc_start_call_main (libc.so.6 + 0x35b5)
                #10 0x00007fded79e4668 __libc_start_main@@GLIBC_2.34 (libc.so.6 + 0x3668)
                #11 0x00000000004038d5 _start (/home/fsumsal/repos/@systemd/systemd/build/userdbctl + 0x38d5)
                ELF object binary architecture: AMD x86-64
2026-03-06 17:24:53 +01:00
Frantisek Sumsal 45830bc8d2 test: drop some extraneous whitespaces 2026-03-06 16:09:21 +01:00
Daan De Meyer c7c0ea91aa ci: Fix missing parentheses in claude review workflow 2026-03-06 15:31:29 +01:00
Daan De Meyer a67cb44287 ci: React to issue_comment in claude review workflow
issue_comment is the trigger that fires on regular pull request comments,
so we have to trigger the review workflow on that as well.
2026-03-06 15:27:30 +01:00
Daan De Meyer d2fec49b55 Two claude fixes/improvements (#40971) 2026-03-06 15:18:26 +01:00
Daan De Meyer 5d223ff468 ci: Make claude action review PRs only and fix the instructions
Turns out the claude code action has issues reviewing PRs from forks
(https://github.com/anthropics/claude-code-action/issues/939). Let's
reuse the approach from https://github.com/pzmarzly/demo--claude-bot-reviews
instead (which I've explicitly asked permission for to reuse).

Unlike the linked demo, we still insist on a comment by a maintainer
before claude reviews the PR.
2026-03-06 15:11:54 +01:00
Lennart Poettering dfb1fa0197 sd-varlink: pin error message while we invoke a reply callback
Let's make sure the parameters/error pointers into the message remain
valid as long as the reply callback is running, even if the reply
otherwise resets the pending message.
2026-03-06 14:51:35 +01:00
Antonio Alvarez Feijoo 4ef56f30b8 mkosi/opensuse: fix package name systemd-network -> systemd-networkd
```
'systemd-network' not found in package names. Trying capabilities.
```

Follow-up for 00f7afebb4
2026-03-06 10:10:53 +00:00
Daan De Meyer 83e872b4c2 agent: Minimize the amount of instructions in AGENTS.md
Let's only keep instructions for stuff that we've seen the AI
mess up in practice rather than having a bunch of AI generated
text that it can figure out for itself these days (given it was
trained on systemd's source code in the first place).

Also add a rule to use git worktrees and check out PRs locally when
reviewing them, since I've seen it mess that up in practice.
2026-03-06 10:20:25 +01:00
Zbigniew Jędrzejewski-Szmek f0691ad697 ci: Add claude code github action (#40966)
This will allow maintainers to mention claude in comments on issues and
prs to do stuff like review something or try to reproduce a bug or other
stuff. Let's give it a try and see whether we like it or not.
2026-03-06 09:06:58 +01:00
Daan De Meyer 89f5f01caf Move AI instructions to AGENTS.md
This seems to be what all the tools are standardizing on, except
claude (https://github.com/anthropics/claude-code/issues/6235) so
add a symlink from CLAUDE.md to AGENTS.md for now until they support
it as well.

I also had claude extend the instructions a bit.

Co-developed-by: Claude <claude@anthropic.com>
2026-03-06 08:55:55 +01:00
Luca Boccassi acce28884d man: add tags for the next few versions 2026-03-06 09:52:37 +09:00
Luca Boccassi 1925c9975b Translations update from Fedora Weblate (#40968)
Translations update from [Fedora
Weblate](https://translate.fedoraproject.org) for
[systemd/main](https://translate.fedoraproject.org/projects/systemd/main/).



Current translation status:

![Weblate translation
status](https://translate.fedoraproject.org/widget/systemd/main/horizontal-auto.svg)
2026-03-06 00:29:03 +00:00
Américo Monteiro 02b2014a24 po: Translated using Weblate (Portuguese)
Currently translated at 100.0% (266 of 266 strings)

Co-authored-by: Américo Monteiro <a_monteiro@gmx.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/pt/
Translation: systemd/main
2026-03-06 00:17:10 +00:00
Salvatore Cocuzza d213b85b79 po: Translated using Weblate (Italian)
Currently translated at 100.0% (266 of 266 strings)

Co-authored-by: Salvatore Cocuzza <info@salvatorecocuzza.it>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/it/
Translation: systemd/main
2026-03-06 00:17:10 +00:00
Ronan Pigott 0fc5c9ef2e zsh: fixup some recent zsh completers
These two completers are written in a stacked _arguments style, and some
generic options are valid before or after the verb. If the toplevel
_arguments is permitted to match options after the verb, it will halt
completion prematurely, so stop toplevel matching after the verb.

This corrects the following error:

$ userdbctl --output=class user <TAB> # completes users
$ userdbctl user --output=class <TAB> # completes nothing
2026-03-06 00:17:02 +00:00
Yu Watanabe 802906bbbe po: update Japanese translation 2026-03-06 07:06:59 +09:00
Daan De Meyer e2c418d528 ci: Add claude code github action
This will allow maintainers to mention claude in comments on issues
and prs to do stuff like review something or try to reproduce a bug
or other stuff. Let's give it a try and see whether we like it or
not.
2026-03-05 22:13:51 +01:00
Hosted Weblate 307391b297 po: Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Co-authored-by: Hosted Weblate <hosted@weblate.org>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/
Translation: systemd/main
2026-03-06 04:48:58 +09:00
Yu Watanabe 2f32c49a18 network: slightly reword polkit message 2026-03-06 04:43:30 +09:00
Yu Watanabe 8903e6b5f7 tree-wide: suppress misc-use-internal-linkage warnings
Suppress warnings like the following from clang tidy:
```
../src/boot/addon.c:11:19: error: function 'efi_main' can be made static to enforce internal linkage [misc-use-internal-linkage,-warnings-as-errors]
   11 | EFIAPI EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *system_table);
      |                   ^
```

Some warnings are suppressed simply by setting comments to ignore the warning,
some are by making global variables static, or include a suitable header.
2026-03-05 20:23:24 +01:00
Mike Yuan e65a6e26ad core/varlink-unit: distinguish PIDREF_AUTOMATIC from unset
Follow-up for ab73333c43

Methods that take numeric pid values use 0 to denote the peer,
hence let's log about 0 on PIDREF_AUTOMATIC, -1 if truly unset.
2026-03-06 04:05:28 +09:00
Mike Yuan ae4c3904af boot/pe: remove unneeded parens
Follow-up for f8ed94ea99
2026-03-06 04:05:28 +09:00
Luca Boccassi 88ed85137c libcrypt: also try to dlopen libcrypt.so.1.1
On top of libcrypt.so.2 and libcrypt.so.1, also try libcrypt.so.1.1
as a third fallback. This is used on debian alpha, and it was
reported that it is intended to ship like that, with a different
SONAME than other architectures:

https://packages.debian.org/sid/alpha/libcrypt1/filelist
2026-03-06 04:04:29 +09:00
Fergus Dall d73dc51fbd pcrlock: Record predictions at start of component range
Currently pcrlock won't predict PCR values that would be present at the start
of the requested location range (unless there are no events for that PCR in the
location range). This means predictions for the default range 760:940, which is
intended to start just after entering the initrd, are not actually possible to
fulfill until after the initrd is exited (or possibly even later, depending on
what other events are recorded).

Fix this by recording predictions immediately prior to processing components
after the start point.

Fixes #39946
2026-03-06 04:03:25 +09:00
Yu Watanabe 535c6ef393 po: update Japanese translations 2026-03-06 03:11:39 +09:00
Yu Watanabe 3e5a865c3f gitignore: ignore new default mkosi tools directories
The default place has been changed since
https://github.com/systemd/mkosi/commit/e9abfab744340dd2f608b589a9252a3e53b071c3
2026-03-05 18:12:09 +00:00
Mike Yuan df51a04a75 path-util: drop unused paths_check_timestamp() 2026-03-06 02:39:39 +09:00
Hans de Goede f8ed94ea99 boot: Make missing CHID DTB match a debug message instead of an error
With distributions like Ubuntu and Fedora using systemd-stub to auto load
DTB's on Windows on ARM laptops, the CHID DTB match failing is expected
when that same UKI is instead booted on an ARM SystemReady system where
no DTB is necessary.

In the ARM SystemReady case showing a big red error message is undesirable
and leads to confused users and bug-reports. Lower the message to debug
level when the status is EFI_NOT_FOUND to avoid these false positive error
messages.

Link: https://bugzilla.redhat.com/show_bug.cgi?id=2444759
2026-03-05 18:29:16 +01:00
Mike Yuan 909108163f tree-wide: various Coccinelle-suggested tweaks and related fixes (#40950) 2026-03-05 17:07:39 +01:00
Michal Sekletar 0c98e432d1 core: cleanup unit's dropin directories from global cache
When user creates dropin files via API (e.g. systemctl set-property ...)
we put the dropin directory path into unit_path_cache. Drop those
directories from the cache in unit_free() and prevent memory leak.

Follow-up for fce94c5c56.
2026-03-05 16:50:25 +01:00
Lennart Poettering c6b2ab09e7 update TODO 2026-03-05 16:34:16 +01:00
Lennart Poettering 8e48881f75 update TODO 2026-03-05 16:31:28 +01:00
Lennart Poettering f2b1010d99 update TODO 2026-03-05 14:30:04 +01:00
Frantisek Sumsal ab73333c43 core: drop unused errno from debug message
And properly guard unset parameters.
2026-03-05 10:27:59 +01:00
Frantisek Sumsal 90f5d2a202 tree-wide: various fixlets suggested by Coccinelle 2026-03-05 10:27:58 +01:00
Frantisek Sumsal a8335fb91f tree-wide: use typed SD_JSON_BUILD_PAIR_* macros more 2026-03-05 10:27:58 +01:00
Frantisek Sumsal 41d9419562 coccinelle: work around a bug in zlib.h parsing
Currently, parsing zlib.h on Fedora (and possibly others) causes spatch
to fail with an assertion. Let's work around that by defining two extra
macros in our Coccinelle parsing hacks.
2026-03-05 10:27:58 +01:00
Frantisek Sumsal 77ee36a740 coccinelle: simplify the SD_JSON_BUILD_PAIR_* transformations
And also disable them on test-json.c, since there we use the macros
intentionally in a "non-optimal" way to actually test them.
2026-03-05 10:27:58 +01:00
Frantisek Sumsal f8d0ab46cf coccinelle: update the list of excluded directories
- src/boot/efi/ was moved to src/boot/ in 97318131fd
  - src/basic/include/linux/ was moved to src/include/uapi/linux/ in
    1a60b97524
2026-03-05 10:27:58 +01:00
Frantisek Sumsal 86867d1240 coccinelle: ignore our own BPF programs
Since they don't have access to systemd code, so we can't use our custom
functions/macros in them anyway.
2026-03-05 10:27:58 +01:00
Luca Boccassi 240675efeb man: clarify requirements around creds null sealing 2026-03-05 09:53:43 +01:00
Mike Yuan ab7d40ff0c machine-varlink: reference the right struct in VARLINK_DISPATCH_MACHINE_LOOKUP_FIELDS
This practically shouldn't matter, as the layout for name
and pidref fields are identical for all the structs. But
let's get things right.
2026-03-05 08:56:34 +01:00
Mike Yuan c8f764e40d hwdb/60-tpm2: correct prefix in comment (tpm -> tpm2)
Follow-up for f2eed3fa25
2026-03-05 01:03:47 +01:00
Mike Yuan 568dbbd5a9 journalctl-filter: drop doubled newline
Follow-up for d8302c2fd9
2026-03-05 01:01:33 +01:00
Luca Boccassi a76e70c359 Translations update from Fedora Weblate (#40952)
Translations update from [Fedora
Weblate](https://translate.fedoraproject.org) for
[systemd/main](https://translate.fedoraproject.org/projects/systemd/main/).



Current translation status:

![Weblate translation
status](https://translate.fedoraproject.org/widget/systemd/main/horizontal-auto.svg)
2026-03-04 20:11:59 +00:00