]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
23 months agogpt: add PARISC UUIDs 23181/head
Sam James [Tue, 28 Jun 2022 03:25:38 +0000 (04:25 +0100)] 
gpt: add PARISC UUIDs

Not doing PARISC64 for now as no userland exists for it yet.

23 months agoseccomp: add PARISC (HPPA support)
Sam James [Sun, 24 Apr 2022 01:55:41 +0000 (02:55 +0100)] 
seccomp: add PARISC (HPPA support)

We have to skip the W^X protections as we need executable
memory on PARISC for now. Kernel work is in progress (started
w/ 5.18).

Closes: https://github.com/systemd/systemd/issues/23180
23 months agobasic/missing-syscalls: add PARISC (HPPA support)
Sam James [Sun, 24 Apr 2022 01:55:11 +0000 (02:55 +0100)] 
basic/missing-syscalls: add PARISC (HPPA support)

Bug: https://github.com/systemd/systemd/issues/23180

23 months agogithub: add more components to RFE issue template
Jan Macku [Mon, 27 Jun 2022 16:57:02 +0000 (18:57 +0200)] 
github: add more components to RFE issue template

Follow-up to: #23838

23 months agopo: add a false positive to POTFILES.skip
Piotr Drąg [Sun, 12 Jun 2022 12:48:04 +0000 (14:48 +0200)] 
po: add a false positive to POTFILES.skip

Scripts used to detect files that should be in POTFILES.in, like
intltool-update -m used on https://l10n.gnome.org/module/systemd/,
falsely detect this file as containing translations. Avoid this
behavior by putting the file in POTFILES.skip.

23 months agonetwork: grouping elements in network_free()
Yu Watanabe [Tue, 14 Jun 2022 06:44:42 +0000 (15:44 +0900)] 
network: grouping elements in network_free()

23 months agoMerge pull request #23842 from medhefgo/boot-std
Yu Watanabe [Mon, 27 Jun 2022 13:32:31 +0000 (22:32 +0900)] 
Merge pull request #23842 from medhefgo/boot-std

boot: Use standard types

23 months agotest-sd-hwdb: adjust the test to actually do anything
Zbigniew Jędrzejewski-Szmek [Thu, 23 Jun 2022 14:21:18 +0000 (16:21 +0200)] 
test-sd-hwdb: adjust the test to actually do anything

Without the terminating colon we wouldn't match anything, so the loop over
properties was skipped.

23 months agoboot: Use stdbool 23842/head
Jan Janssen [Mon, 27 Jun 2022 09:04:57 +0000 (11:04 +0200)] 
boot: Use stdbool

The way the UEFI spec defines BOOLEAN is fully compatible to stdbool, so
it is perfectly safe to switch to it. Although any other values than 0/1
are undefined by the spec, we could theoretically have cases where a
sloppy firmware hands us a bad BOOLEAN (since gnu-efi/edk2 declare it
as uint8_t). So any uses where we pass a pointer to BOOLEAN are left
untouched.

23 months agoboot: Use char
Jan Janssen [Mon, 27 Jun 2022 08:42:31 +0000 (10:42 +0200)] 
boot: Use char

This also switches to _cleanup_free_. Otherwise no code changes.

23 months agoboot: Use char16_t
Jan Janssen [Fri, 24 Jun 2022 09:37:15 +0000 (11:37 +0200)] 
boot: Use char16_t

This also switches to _cleanup_free_. Otherwise no code changes.

23 months agoboot: Use stdint types
Jan Janssen [Fri, 24 Jun 2022 09:25:36 +0000 (11:25 +0200)] 
boot: Use stdint types

23 months agoboot: Remove use of EFI_ERROR
Jan Janssen [Fri, 24 Jun 2022 09:00:43 +0000 (11:00 +0200)] 
boot: Remove use of EFI_ERROR

The macro is ugly and annoying to use and provides no real benefit. The
only reason to use it would be to allow warnings to go through. But any
EFI APIs we call do not return warning status codes or we do not check
the return value anyway. The only other case would be BS->StartImage,
where we already treat anything other than EFI_SUCCESS as an error
anyway.

This also helps the compiler and code analyzers to better reason about
the code. In particular, this can help reduce use of uninitialized
variable warnings.

23 months agoboot: Rename remaining EFI_STATUS vars to err for consistency
Jan Janssen [Fri, 24 Jun 2022 08:49:19 +0000 (10:49 +0200)] 
boot: Rename remaining EFI_STATUS vars to err for consistency

23 months agofundamental: Remove types-fundamental.h
Jan Janssen [Fri, 24 Jun 2022 08:45:52 +0000 (10:45 +0200)] 
fundamental: Remove types-fundamental.h

This removes the fundamental typedefs in favor of just using standard C
types. These are all used internally anyway and also do not do anything
special to warrant any redefinition to EFI types.

Even for BOOLEAN we can safely use stdbool. The defition from the EFI
specification is fully compatible, including making any other values
than 0/1 as undefined.

The exception is sd_char as those need to be char16_t. The typedef is
moved to string-util-fundamental.h instead.

23 months agogithub: add more components to issue template
Yu Watanabe [Mon, 27 Jun 2022 04:19:24 +0000 (13:19 +0900)] 
github: add more components to issue template

23 months agomeson: show default nspawn locale in summary
Yu Watanabe [Mon, 27 Jun 2022 03:46:57 +0000 (12:46 +0900)] 
meson: show default nspawn locale in summary

Follow-up for a22f5186761a437d8845397bbbfeaf9a7d590ec2.

23 months agoemacs: ignore .dir-locals-2.el (personal customization) versioning
Jacek Migacz [Sun, 26 Jun 2022 14:22:25 +0000 (16:22 +0200)] 
emacs: ignore .dir-locals-2.el (personal customization) versioning

23 months agohwdb: Add Lenovo ThinkPad C13 Yoga
Akihiko Odaki [Fri, 10 Jun 2022 22:58:52 +0000 (07:58 +0900)] 
hwdb: Add Lenovo ThinkPad C13 Yoga

23 months agoMerge pull request #23834 from mrc0mmand/dfuzzer-in-a-container
Evgeny Vereshchagin [Sun, 26 Jun 2022 22:55:36 +0000 (01:55 +0300)] 
Merge pull request #23834 from mrc0mmand/dfuzzer-in-a-container

A couple of tweaks to allow running TEST-21-DFUZZER in a container

23 months agotest: drop unnecessary `|| :` 23834/head
Frantisek Sumsal [Sun, 26 Jun 2022 19:00:43 +0000 (21:00 +0200)] 
test: drop unnecessary `|| :`

since we use `set +e` in the cleanup handler.

23 months agotest: run TEST-21 in nspawn only if $TEST_PREFER_NSPAWN is set
Frantisek Sumsal [Sun, 26 Jun 2022 18:57:31 +0000 (20:57 +0200)] 
test: run TEST-21 in nspawn only if $TEST_PREFER_NSPAWN is set

so we can run it under nspawn in CIs which don't support nested KVM, but
avoid running it twice (both under nspawn and qemu) in CIs which support
both methods.

23 months agotest: make TEST-21-DFUZZER work in containers
Frantisek Sumsal [Sun, 26 Jun 2022 18:52:12 +0000 (20:52 +0200)] 
test: make TEST-21-DFUZZER work in containers

by avoiding fuzzing networkd and timesyncd when running in a container.

23 months agosha256: Use stdbool and uintptr_t
Jan Janssen [Fri, 24 Jun 2022 08:04:30 +0000 (10:04 +0200)] 
sha256: Use stdbool and uintptr_t

This also syncs the copyright blurb with current glibc sources. The
written by line does not appear in upstream, so it should be okay to
remove.

23 months agomkosi: Pull in fix that solves action mirror issue
Daan De Meyer [Fri, 24 Jun 2022 12:36:31 +0000 (14:36 +0200)] 
mkosi: Pull in fix that solves action mirror issue

23 months agoudev: allow to execute longer command line
Yu Watanabe [Fri, 24 Jun 2022 04:49:15 +0000 (13:49 +0900)] 
udev: allow to execute longer command line

Fixes #23607.

23 months agoci: set top-level permissions as well
Evgeny Vereshchagin [Thu, 23 Jun 2022 14:09:36 +0000 (14:09 +0000)] 
ci: set top-level permissions as well

It should turn on the "restricted" mode by default regardless of
whether the global setting is on or not. New jobs in this action
should have to overwrite it explicitly to gain write access in any
way.

It should also make the action consistent with the other actions
writing various stuff like 'labeler' and 'codeql'.

23 months agoci: remove links to "codeless contribution" actions
Evgeny Vereshchagin [Thu, 23 Jun 2022 08:55:28 +0000 (08:55 +0000)] 
ci: remove links to "codeless contribution" actions

They refer to actions with script injections running with full
access to repositories.

23 months agoboot: Fix calls to ResetSystem
Jan Janssen [Thu, 23 Jun 2022 12:48:13 +0000 (14:48 +0200)] 
boot: Fix calls to ResetSystem

gnu-efi falsely declares a return type for ResetSystem when it should be
void. The spec also says that it never returns, so just assert.

23 months agologind: simplify code
Zbigniew Jędrzejewski-Szmek [Thu, 23 Jun 2022 07:56:33 +0000 (09:56 +0200)] 
logind: simplify code

Follow-up for 4885d7490b23e08d8444e5a68927ce9ce8727e5a.

23 months agogithub: Issue forms - fix GA `SHA1` ref
Jan Macku [Thu, 23 Jun 2022 14:37:50 +0000 (16:37 +0200)] 
github: Issue forms - fix GA `SHA1` ref

Fix `SHA1` reference for github action `stefanbuck/github-issue-parser` to
point to correct commit.

Follow-up to: #23811

23 months agogithub: Issue forms templates follow-up
Jan Macku [Thu, 23 Jun 2022 12:16:43 +0000 (14:16 +0200)] 
github: Issue forms templates follow-up

- Use `SHA1` for actions versioning
- Fix typo: `github-issue-praser` -> `github-issue-parser`
- Define exact permissions

Follow-up to: #23693

23 months agoMerge pull request #23802 from yuwata/core-watchdog-follow-ups
Zbigniew Jędrzejewski-Szmek [Thu, 23 Jun 2022 07:59:24 +0000 (09:59 +0200)] 
Merge pull request #23802 from yuwata/core-watchdog-follow-ups

core: cleanups for watchdog

23 months agogithub: Update issue templates to issue forms
Jan Macku [Fri, 10 Jun 2022 05:30:42 +0000 (07:30 +0200)] 
github: Update issue templates to issue forms

Issue forms templates allow us to add automation in place.
This patch replaces old markdown issue templates with new issue forms.
It also adds workflow to automatically mark issues by component label
based on reported data.

This change could help with initial triaging of issues.

23 months agologind-session-dbus: allow to set display name via dbus
David Tardon [Fri, 10 Jun 2022 13:07:01 +0000 (15:07 +0200)] 
logind-session-dbus: allow to set display name via dbus

Currently, the only way to set display name of a graphical session is to
pass it to CreateSession(). But modern display managers like gdm start
the display server as part of the user session, which means that the
display name isn't known yet when the session is being created. Hence,
let's make it possible to set it later.

23 months agobootspec: Add PE file name to log messages
Jan Janssen [Sun, 19 Jun 2022 13:35:47 +0000 (15:35 +0200)] 
bootspec: Add PE file name to log messages

Fixes: #23783
23 months agoMerge pull request #23774 from yuwata/netlabel-nftset-follow-ups
Yu Watanabe [Wed, 22 Jun 2022 16:33:19 +0000 (01:33 +0900)] 
Merge pull request #23774 from yuwata/netlabel-nftset-follow-ups

network, core: revert NFTSet and NetLabel features

23 months agoMerge pull request #23806 from keszybz/udevadm-info-pager
Zbigniew Jędrzejewski-Szmek [Wed, 22 Jun 2022 14:50:53 +0000 (16:50 +0200)] 
Merge pull request #23806 from keszybz/udevadm-info-pager

Pager for udevadm info

23 months agoRevert "networkd: NetLabel integration" 23774/head
Yu Watanabe [Wed, 22 Jun 2022 13:28:46 +0000 (22:28 +0900)] 
Revert "networkd: NetLabel integration"

This reverts PR #23269 and its follow-up commit. Especially,
2299b1cae32c1fb8911da0ce26efced68032f4f8 (partially), and
3cf63830acdef9d8afdc9ef1cf25aa7e85a5e4d5.

The PR was merged without final approval, and has several issues:
- The NetLabel for static addresses are not assigned, as labels are
  stored in the Address objects managed by Network, instead of Link.
- If NetLabel is specified for a static address, then the address
  section will be invalid and the address will not be configured,
- It should be implemented with Request object,
- There is no test about the feature.

23 months agoRevert NFTSet feature
Yu Watanabe [Tue, 14 Jun 2022 06:06:27 +0000 (15:06 +0900)] 
Revert NFTSet feature

This reverts PR #22587 and its follow-up commit. More specifically,
2299b1cae32c1fb8911da0ce26efced68032f4f8 (partially),
e176f855278d5098d3fecc5aa24ba702147d42e0,
ceb46a31a01b3d3d1d6095d857e29ea214a2776b, and
51bb9076ab8c050bebb64db5035852385accda35.

The PR was merged without final approval, and has several issues:
- OSS fuzz reported issues in the conf parser,
- It calls synchrnous netlink call, it should not be especially in PID1,
- The importance of NFTSet for CGroup and DynamicUser may be
  questionable, at least, there was no justification PID1 should support
  it.
- For networkd, it should be implemented with Request object,
- There is no test for the feature.

Fixes #23711.
Fixes #23717.
Fixes #23719.
Fixes #23720.
Fixes #23721.
Fixes #23759.

23 months agoudevadm info: use pager for all output types 23806/head
Zbigniew Jędrzejewski-Szmek [Wed, 22 Jun 2022 12:30:57 +0000 (14:30 +0200)] 
udevadm info: use pager for all output types

Before we used the pager for --tree, but not e.g. for --export-db.
I don't see any particular reason to limit this.

23 months agoudevadm info: implement --no-pager
Zbigniew Jędrzejewski-Szmek [Wed, 22 Jun 2022 12:26:55 +0000 (14:26 +0200)] 
udevadm info: implement --no-pager

23 months agocore: close watchdog device if watchdog device is unspecified now 23802/head
Yu Watanabe [Wed, 22 Jun 2022 07:22:39 +0000 (16:22 +0900)] 
core: close watchdog device if watchdog device is unspecified now

If a watchdog device was specified previously, and unspecified later and
PID1 is reloaded, then we need to close the device.

23 months agocore: drop unnecessary free
Yu Watanabe [Wed, 22 Jun 2022 07:20:30 +0000 (16:20 +0900)] 
core: drop unnecessary free

As reset_arguments() frees the string.

Follow-up for 919ea64f69f710840c1bc93f0f7cb7c51aae45d0.

23 months agoresolve: mDNS transaction max attempts fix
Vishal Chillara Srinivas [Fri, 17 Jun 2022 06:37:19 +0000 (12:07 +0530)] 
resolve: mDNS transaction max attempts fix

Maximum attempts to send mDNS requests is one except for probe requests, which should be attempted thrice.
Implemented fix to account for the difference between regular queries and probe requests, and prevent
even regular queries from being attempted thrice.
See RFC 6762 Section 8.1

23 months agocore: Fix memory leaks
Łukasz Stelmach [Tue, 21 Jun 2022 10:12:01 +0000 (12:12 +0200)] 
core: Fix memory leaks

arg_early_core_pattern and arg_watchdog_device hold pointers to memory
allocated with strdup() (inside path_make_absolute_cwd). The memory needs
to be freed in reset_arguments() during reload rather than forgotten.

23 months agomkosi: Update CI to mkosi 13
Daan De Meyer [Tue, 21 Jun 2022 18:53:42 +0000 (20:53 +0200)] 
mkosi: Update CI to mkosi 13

23 months agoMerge pull request #23791 from mrc0mmand/dfuzzer-followups
Evgeny Vereshchagin [Tue, 21 Jun 2022 20:44:58 +0000 (23:44 +0300)] 
Merge pull request #23791 from mrc0mmand/dfuzzer-followups

Several dfuzzer-related follow-ups

23 months agounits: remove the restart limit on the modprobe@.service
Alban Bedel [Wed, 15 Jun 2022 11:12:46 +0000 (13:12 +0200)] 
units: remove the restart limit on the modprobe@.service

They are various cases where the same module might be repeatedly
loaded in a short time frame, for example if a service depending on a
module keep restarting, or if many instances of such service get
started at the same time. If this happend the modprobe@.service
instance will be marked as failed because it hit the restart limit.

Overall it doesn't seems to make much sense to have a restart limit on
the modprobe service so just disable it.

Fixes: #23742
23 months agoAdd sys/file.h for LOCK_
Pavel Zhukov [Tue, 21 Jun 2022 06:23:00 +0000 (08:23 +0200)] 
Add sys/file.h for LOCK_

Fixes build with musl:
| ../git/src/shared/dissect-image.c: In function 'mount_image_privately_interactively':
| ../git/src/shared/dissect-image.c:2986:34: error: 'LOCK_SH' undeclared (first use in this function)
|  2986 |         r = loop_device_flock(d, LOCK_SH);
|       |                                  ^~~~~~~

23 months agotest: allow overriding $QEMU_MEM when running w/ ASan 23791/head
Frantisek Sumsal [Tue, 21 Jun 2022 10:09:35 +0000 (12:09 +0200)] 
test: allow overriding $QEMU_MEM when running w/ ASan

23 months agotest: make the shutdown routine a bit more "robust"
Frantisek Sumsal [Tue, 21 Jun 2022 08:20:12 +0000 (10:20 +0200)] 
test: make the shutdown routine a bit more "robust"

Replace the call to the `end.service` with `systemctl poweroff`, since
it seems to cause issues no matter what `--job-mode=` is used:

```
[  129.070993] testsuite-21.sh[380]: ++ systemctl start --job-mode=flush end.service
[  129.154985] testsuite-21.sh[912]: Failed to start end.service: Transaction for end.service/start is destructive (sysinit.target has 'stop' job queued, but 'start' is included in transaction).
[  129.159636] testsuite-21.sh[912]: See system logs and 'systemctl status end.service' for details.
```

Also, add a "safety net" which bypasses the manager and does the
poweroff directly, since sometimes the D-Bus call performed by
`systemctl` might timeout (as the manager might be still processing data
from the fuzzing):

```
[  115.776778] sh[894]: + systemctl poweroff --no-block
[  166.164242] testsuite-21.sh[893]: Failed to start transient service unit: Connection timed out
[  166.269289] sh[894]: Call to PowerOff failed: Connection timed out
```

23 months agotest: drop the at_exit() coredump check
Frantisek Sumsal [Tue, 21 Jun 2022 08:13:48 +0000 (10:13 +0200)] 
test: drop the at_exit() coredump check

since we don't truncate the journal anymore.

23 months agotest: make dfuzzer less verbose
Frantisek Sumsal [Tue, 21 Jun 2022 08:04:03 +0000 (10:04 +0200)] 
test: make dfuzzer less verbose

Otherwise it oversaturates the journal, which in some cases can't keep
up with the load of messages (due to the performance penalty caused by
sanitizers), and gets killed by a watchdog.

23 months agotest: always force a new image for dfuzzer
Frantisek Sumsal [Tue, 21 Jun 2022 08:01:30 +0000 (10:01 +0200)] 
test: always force a new image for dfuzzer

Otherwise we might end up with an image containing broken service
symlinks and other things, which break certain parts of the test.

23 months agopkgconfig,rpm: expose vars for user-tmpfiles.d location
Zbigniew Jędrzejewski-Szmek [Mon, 20 Jun 2022 13:06:09 +0000 (15:06 +0200)] 
pkgconfig,rpm: expose vars for user-tmpfiles.d location

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2098553.

23 months agotest: use saved process PID instead of %%
Frantisek Sumsal [Mon, 20 Jun 2022 10:27:39 +0000 (12:27 +0200)] 
test: use saved process PID instead of %%

As the `%%` specifier might fail if the current job (i.e. the last
background job) already finished:

```
[   61.692196] testsuite-04.sh[656]: ++ systemd-id128 new
[   61.705407] testsuite-04.sh[263]: + ID=912cb8f8ef304153a123f772bb0fe9e0
[   61.706318] testsuite-04.sh[657]: + systemd-cat -t 912cb8f8ef304153a123f772bb0fe9e0 bash -c 'echo parent; (echo child) & wait'
[   61.720940] testsuite-04.sh[263]: + PID=657
[   61.721126] testsuite-04.sh[263]: + wait %%
[   61.723014] testsuite-04.sh[263]: /usr/lib/systemd/tests/testdata/units/testsuite-04.sh: line 96: wait: %%: no such job
```

23 months agoMerge pull request #22547 from mrc0mmand/dfuzzer
Evgeny Vereshchagin [Sun, 19 Jun 2022 23:42:09 +0000 (02:42 +0300)] 
Merge pull request #22547 from mrc0mmand/dfuzzer

test: fuzz our dbus interfaces with dfuzzer

23 months agotest: skip TEST-21-DFUZZER without ASan 22547/head
Frantisek Sumsal [Sun, 19 Jun 2022 08:39:12 +0000 (10:39 +0200)] 
test: skip TEST-21-DFUZZER without ASan

as the test is quite time consuming and it yields more useful reports
when the target app is built with sanitizers.

23 months agotest: fuzz our dbus interfaces with dfuzzer
Frantisek Sumsal [Mon, 13 Dec 2021 19:50:28 +0000 (20:50 +0100)] 
test: fuzz our dbus interfaces with dfuzzer

23 months agotest: make masking of supplementary services configurable
Frantisek Sumsal [Wed, 16 Feb 2022 19:29:14 +0000 (20:29 +0100)] 
test: make masking of supplementary services configurable

23 months agolocale: drop unnecessary allocation
Yu Watanabe [Sat, 18 Jun 2022 02:06:46 +0000 (11:06 +0900)] 
locale: drop unnecessary allocation

Fixes a bug introduced by 3d36b5d7e7b191fca7c5c65dbab94d99cf5f0230.

Fixes #23777.

23 months agoMerge pull request #23771 from mrc0mmand/test-tweaks
Yu Watanabe [Sat, 18 Jun 2022 01:45:22 +0000 (10:45 +0900)] 
Merge pull request #23771 from mrc0mmand/test-tweaks

A couple of test-output-related tweaks

23 months agonetworkctl: fix output of "status": replace "Queue Length" by "Number of Queues"
Marc Kleine-Budde [Fri, 17 Jun 2022 17:10:51 +0000 (19:10 +0200)] 
networkctl: fix output of "status": replace "Queue Length" by "Number of Queues"

Commit 0307afc681e1 ("networkctl: add support to display Transmit/Recieve queue
length (#12633)") added the display of the number of RX and TX Queues to the
output of `networkctl status $DEV`. However the row description says "Queue
Length".

This patch fixes the output by replacing "Queue Length" by "Number of Queues".

Fixes: 0307afc681e1 ("networkctl: add support to display Transmit/Recieve queue length (#12633)")
23 months agoadd program name to log line
Philipp Gortan [Fri, 17 Jun 2022 21:26:54 +0000 (23:26 +0200)] 
add program name to log line

23 months agocryptenroll: fix typo in manpage
Foster Snowhill [Fri, 17 Jun 2022 22:31:38 +0000 (00:31 +0200)] 
cryptenroll: fix typo in manpage

23 months agotest: check journal directly instead of capturing console output 23771/head
Frantisek Sumsal [Fri, 17 Jun 2022 15:29:22 +0000 (17:29 +0200)] 
test: check journal directly instead of capturing console output

23 months agotest: run the custom check hooks before common checks
Frantisek Sumsal [Fri, 17 Jun 2022 15:28:13 +0000 (17:28 +0200)] 
test: run the custom check hooks before common checks

since we delete the guest journals as part of the save_journal() step in
check_result_common(), making journal inaccessible from the custom check
hooks.

23 months agotest: pass the initdir to check_result_{qemu,nspawn} hooks
Frantisek Sumsal [Fri, 18 Feb 2022 13:10:15 +0000 (14:10 +0100)] 
test: pass the initdir to check_result_{qemu,nspawn} hooks

23 months agotest: fix a couple of issues found by shellcheck
Frantisek Sumsal [Fri, 17 Jun 2022 13:28:17 +0000 (15:28 +0200)] 
test: fix a couple of issues found by shellcheck

23 months agotest: don't flush debug logs to the console
Frantisek Sumsal [Fri, 17 Jun 2022 13:06:59 +0000 (15:06 +0200)] 
test: don't flush debug logs to the console

Let's keep the debug logs in the journal, while logging only
testsute-*.sh stdout/stderr to the console (ba7abf7). This should make
the test output log a bit more readable and potentially the tests itself
a bit faster by avoiding console oversaturation.

Also, it should significantly reduce the size of artifacts kept by CIs.

23 months agotest: always wrap useradd/userdel when running w/ ASan
Frantisek Sumsal [Fri, 17 Jun 2022 12:47:10 +0000 (14:47 +0200)] 
test: always wrap useradd/userdel when running w/ ASan

since they dlopen() PAM modules, including systemd ones.

23 months agotest: make the busy loop in TEST-02 less verbose
Frantisek Sumsal [Fri, 17 Jun 2022 12:44:49 +0000 (14:44 +0200)] 
test: make the busy loop in TEST-02 less verbose

as it unnecessarily clogs the logs.

23 months agoMerge pull request #23756 from yuwata/analyze-seccomp-filter
Luca Boccassi [Fri, 17 Jun 2022 08:58:14 +0000 (09:58 +0100)] 
Merge pull request #23756 from yuwata/analyze-seccomp-filter

analyze: fix seccomp filter handling in security command

23 months agomeson: Reorder cflags for sd-boot
Jan Janssen [Thu, 16 Jun 2022 19:53:30 +0000 (21:53 +0200)] 
meson: Reorder cflags for sd-boot

Currently, -Wall and -Wextra override previously passed flags like
-Wno-unused-parameter. This reorders them to be passed before any
optional flags. -Wsign-compare is part of -Wextra and therefore dropped.
-nostdlib is a link-stage flag and dropped as it is already part of
efi_ldflags.

23 months agotest: send stdout/stderr of testsuite units to journal & console
Frantisek Sumsal [Thu, 16 Jun 2022 20:16:53 +0000 (22:16 +0200)] 
test: send stdout/stderr of testsuite units to journal & console

to make debugging in CIs slightly easier.

23 months agotest: add syscall filter tests for analyze security 23756/head
Yu Watanabe [Wed, 15 Jun 2022 18:21:28 +0000 (03:21 +0900)] 
test: add syscall filter tests for analyze security

23 months agoseccomp-util: make @known include @obsolete
Yu Watanabe [Wed, 15 Jun 2022 18:18:44 +0000 (03:18 +0900)] 
seccomp-util: make @known include @obsolete

@known is generated from syscall-list.txt, which generated from kernel
headers. So, some syscalls in @obsolete may not be listed in
syscall-list.txt.

23 months agoanalyze-security: always save syscall name
Yu Watanabe [Wed, 15 Jun 2022 16:23:20 +0000 (01:23 +0900)] 
analyze-security: always save syscall name

This reverts dd51e725df9aec2847482131ef601e0215b371a0 and fixes bugs
introduced by 1624114d74f55ad9791b7624b08d89d2339a68b3.

Previously,
- On online scan, the syscall filter was a string Hashmap, but it
  might contain syscall name with errno or error action. Hence, we need
  to drop the errno or error action in the string.
- On offline scan, the syscall filter was a Hashmap of syscall ID, so
  hashmap_contains() with syscall name did not work. We need to convert
  syscall IDs to syscall names.
- If hashmap_contains() in syscall_names_in_filter() is true, then
  the syscall is allowed when the list is an allow-list, and vice versa.
  Hence, the condition in syscall_names_in_filter() was errnously
  inverted by dd51e725df9aec2847482131ef601e0215b371a0.

This makes syscalls are always stored with its name, instead of ID,
and also correct the condition.

Fixes #23663.

23 months agoset: introduce set_put_strndup()
Yu Watanabe [Wed, 15 Jun 2022 16:20:20 +0000 (01:20 +0900)] 
set: introduce set_put_strndup()

Note, if `n != SIZE_MAX`, we cannot check the existence of the specified
string in the set without duplicating the string. And, set_consume() also
checks the existence of the string. Hence, it is not necessary to call
set_contains() if `n != SIZE_MAX`.

23 months agocore/dbus-execute: drop unnecessary flag
Yu Watanabe [Wed, 15 Jun 2022 16:14:30 +0000 (01:14 +0900)] 
core/dbus-execute: drop unnecessary flag

The code block is called only when the list was empty, and the newly
requested list is allow-list. Hence, invert_flag is always zero here.

23 months agocore/dbus-execute: do not append denied syscalls in allow-list
Yu Watanabe [Wed, 15 Jun 2022 16:13:58 +0000 (01:13 +0900)] 
core/dbus-execute: do not append denied syscalls in allow-list

Follow-up for 68acc1afbe5cec50da1ffdc411dadda504e4caf5.

Before the commit, SystemCallFilter bus property provides only allowed
syscalls if ExecContext.syscall_filter is an allow-list, and vice versa.

After the commit, if the list is allow-list, it contains allowed
syscalls with value `-1`, and denied syscalls with non-negative values.

To keep the backward compatibility, denied syscalls must be dropped in
SystemCallFilter bus property.

2 years agoMerge pull request #23741 from mrc0mmand/more-asan-tweaks
Yu Watanabe [Thu, 16 Jun 2022 03:10:56 +0000 (12:10 +0900)] 
Merge pull request #23741 from mrc0mmand/more-asan-tweaks

test: wrap certain uninstrumented binaries to make them work w/ ASan

2 years agonspawn: fix UID map string
Yu Watanabe [Wed, 15 Jun 2022 13:32:40 +0000 (22:32 +0900)] 
nspawn: fix UID map string

We send/recv the set of payload uid, host uid, payload gid, host gid.
Hence, the index must be incremented with 4, instead of 2.

Fixes #23664.

2 years agoRFC 6762 section 7.1: a Multicast DNS querier SHOULD NOT include records in the
Vishal Chillara Srinivas [Wed, 15 Jun 2022 12:46:06 +0000 (18:16 +0530)] 
RFC 6762 section 7.1: a Multicast DNS querier SHOULD NOT include records in the
Known-Answer list whose remaining TTL is less than half of their original TTL

2 years agoresolve: mark mDNS RRs in the Additional Records section as cacheable
Vishal Chillara Srinivas [Tue, 31 May 2022 14:30:47 +0000 (20:00 +0530)] 
resolve: mark mDNS RRs in the Additional Records section as cacheable

RFC 6762 does not restrict caching of records in the Additional section.
Caching can improve resolve efficiency.

2 years agotest: don't wrap binaries built with ASan 23741/head
Frantisek Sumsal [Wed, 15 Jun 2022 17:43:11 +0000 (19:43 +0200)] 
test: don't wrap binaries built with ASan

since they should handle loading other instrumented libraries without
issues.

2 years agotest: drop all LD_PRELOAD-related ASan workarounds
Frantisek Sumsal [Wed, 15 Jun 2022 10:32:51 +0000 (12:32 +0200)] 
test: drop all LD_PRELOAD-related ASan workarounds

since they shouldn't be necessary anymore, as we tweak the "problematic"
binaries on per-binary basis.

2 years agotest: wrap binaries using systemd DSOs when running w/ ASan
Frantisek Sumsal [Tue, 14 Jun 2022 20:54:39 +0000 (22:54 +0200)] 
test: wrap binaries using systemd DSOs when running w/ ASan

Let's detect & wrap binaries which are linked against systemd DSOs and
we're running under ASan, since otherwise running such binaries ends
with:

```
==633==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.
```

2 years agotree-wide: fix typo
Yu Watanabe [Wed, 15 Jun 2022 05:50:34 +0000 (14:50 +0900)] 
tree-wide: fix typo

2 years agoMerge pull request #23733 from sshedi/cid-1469711
Yu Watanabe [Wed, 15 Jun 2022 03:03:24 +0000 (12:03 +0900)] 
Merge pull request #23733 from sshedi/cid-1469711

homework: initialize we_detached

2 years agoMerge pull request #23709 from yuwata/test-hostname-locale
Yu Watanabe [Wed, 15 Jun 2022 03:00:22 +0000 (12:00 +0900)] 
Merge pull request #23709 from yuwata/test-hostname-locale

test: import hostname and locale tests from debian/ubuntu test suite

2 years agoRevert "test: fix TEST-70 under sanitizers"
Frantisek Sumsal [Tue, 14 Jun 2022 20:56:58 +0000 (22:56 +0200)] 
Revert "test: fix TEST-70 under sanitizers"

This reverts commit 47d81bc61315bae917276f978f39f200cf31e106.

2 years agoman: Add some punctuation; remove double spaces.
adrian5 [Tue, 14 Jun 2022 17:42:59 +0000 (19:42 +0200)] 
man: Add some punctuation; remove double spaces.

2 years agosd-journal: check retval of sd_id128_from_string call 23733/head
Shreenidhi Shedi [Tue, 14 Jun 2022 04:58:37 +0000 (10:28 +0530)] 
sd-journal: check retval of sd_id128_from_string call

Fixes: CID#1469712
CID 1469712 (#1 of 1): Unused value (UNUSED_VALUE)
returned_value: Assigning value from sd_id128_from_string(word + 2, &boot_id) to r here,
but that stored value is overwritten before it can be used.

2 years agohomework: initialize we_detached
Shreenidhi Shedi [Mon, 13 Jun 2022 08:57:51 +0000 (14:27 +0530)] 
homework: initialize we_detached

Fixes: CID#1469711
CID 1469711 (#1 of 1): Uninitialized scalar variable (UNINIT)
14. uninit_use: Using uninitialized value we_detached.

2 years agotest: use trap RETURN 23709/head
Yu Watanabe [Tue, 14 Jun 2022 12:08:04 +0000 (21:08 +0900)] 
test: use trap RETURN

2 years agotest: move "do" at the end of line
Yu Watanabe [Tue, 14 Jun 2022 12:06:06 +0000 (21:06 +0900)] 
test: move "do" at the end of line

2 years agotest: insert space in for loop
Yu Watanabe [Tue, 14 Jun 2022 12:05:10 +0000 (21:05 +0900)] 
test: insert space in for loop

2 years agotest: import localed tests from debian/ubuntu test suite
Yu Watanabe [Tue, 14 Jun 2022 00:14:00 +0000 (09:14 +0900)] 
test: import localed tests from debian/ubuntu test suite