Commit Graph
71663 Commits
Author SHA1 Message Date
Yu Watanabe f2e5a28bdd network: use FOREACH_STRING() 2024-02-24 21:04:14 +09:00
Mike Yuan 3d3c42773d docs/CODING_STYLE: fix typo (CLONE_VORK -> VFORK) 2024-02-24 13:26:19 +08:00
Mike Yuan d95705cc88 systemctl-show: use lookup_unit_by_pidref too
Follow-up for e0e7bc8223

This allows us to pin the process locally when GetUnitByPIDFD
is not available, just like what we have been doing for
'systemctl whoami'. Also, fix looking up remote pid.
We can't use pidfd for those.
2024-02-24 12:24:41 +08:00
Mike Yuan 716a4cdb0e systemctl: generalize GetUnitByPIDFD handling 2024-02-24 12:24:41 +08:00
Mike Yuan d9219935ab systemctl-util: use strv_free_and_replace at one more place 2024-02-24 12:07:32 +08:00
Luca Boccassi 857945cc5f Fallback from pidfd_open on permission errors too
Skip using pidfds if we get a permission denied error.
This can happen with an old policy and a new kernel that uses the
new pidfs filesystem to back pidfds, instead of anonymous inodes,
as the existing policy denies access.

This is already the case for most uses of pidfd_open, like pidref,
but not on these two. Fix them.
2024-02-24 12:58:13 +09:00
Yu Watanabe a860df82b4 test: split out {dump,verify}_ra_message()
Then, let's not modify the global object.
2024-02-24 12:37:50 +09:00
Yu Watanabe 36653443f7 sd-radv: several cleanups
- split out radv_setup_recv_event(),
- slightly update log messages,
- use DIV_ROUND_UP(),
- use structured initializer more.

No functional change, just preparation for later commits.
2024-02-24 12:37:50 +09:00
Yu Watanabe 6a27ca08c6 sd-ndisc: several trivial cleanups
- update several log messages,
- use event_reset_time_relative(),
- split out ndisc_setup_recv_event() and ndisc_setup_timer().

No functional change, just refactoring and preparation for later commits.
2024-02-24 12:37:50 +09:00
Yu Watanabe 37c011e74c icmp6-util: merge icmp6_bind_router_{solicitation,advertisement}() into icmp6_bind()
No functional change, just refactoring.
2024-02-24 12:37:50 +09:00
Georges Basile Stavracas Neto afdf63fcf2 hwdb: Add support for Elgato Stream Deck Plus
Add support for the following device:

 - ID 0fd9:0084 Elgato Systems GmbH Stream Deck Plus
2024-02-24 11:45:11 +09:00
Yu Watanabe 16a52db488 docs: fix typo 2024-02-24 11:30:39 +09:00
Luca Boccassi 6036f62c51 efi: de-inline xmalloc to fix build failure with gcc 12.2 and -O2
With meson build --werror --buildtype=plain -Dc_args=" -O2" the build fails:

../src/boot/efi/stub.c: In function ‘load_addons.constprop’:03:06
../src/boot/efi/stub.c:475:40: error: using a dangling pointer to ‘p’ [-Werror=dangling-pointer=]03:06
  475 |                         dt_bases[n_dt] = xmemdup((uint8_t*)loaded_addon->ImageBase + addrs[UNIFIED_SECTION_DTB],03:06
      |                         ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~03:06
  476 |                                                  dt_sizes[n_dt]);03:06
      |                                                  ~~~~~~~~~~~~~~~03:06
In file included from ../src/boot/efi/stub.c:20:03:06
../src/boot/efi/util.h:33:15: note: ‘p’ declared here03:06
   33 |         void *p;03:06
      |               ^

De-inline the function and initialize p to make gcc happy.
2024-02-24 08:16:07 +08:00
Luca Boccassi bb394133cb Merge pull request #31464 from poettering/vmspawn-limit-bank
vmspawn: disable all TPM PCR banks, except for SHA256
2024-02-23 22:04:44 +00:00
Lennart Poettering d4ece77f5e ptyfwd: optionally prefix window title with colored dot
in uid0/systemd-run/nspawn we already set a window title with a colorful
unicode dot indicating the changed privileges/execution context. This typically
gets overriden by the shell inside the environment however.

Let's tweak this a bit: when we see the window title OSC ANSI sequence
passing through, let's patch in the unicode dot as a prefix to the
title.

This is super pretty, since it makes sure root sessions via 0ad are
really easily recognizable as such, because the window title carries an
🔴 red dot as prefix then.
2024-02-23 21:15:25 +00:00
Luca Boccassi 461c85838e Merge pull request #31465 from xypron/detect-virt
Detect virtualization on RISC-V
2024-02-23 20:50:51 +00:00
Thilo Fromm ea29a87f23 man/systemd-sysext.xml: document mutable extensions
Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2024-02-23 19:17:50 +01:00
Lennart Poettering db7136ec73 signal-util: imply sentinel -1 in sigprocmask_many() + sigset_add_many() args list 2024-02-23 09:35:12 -08:00
Lennart Poettering f58411a22f signal-util: use RET_NERRNO() + RET_GATHER() more 2024-02-23 09:35:12 -08:00
Heinrich Schuchardt 5041e771a8 detect-virt: allow detection via SMBIOS on RISC-V
SMBIOS support in QEMU for RISC-V is merged upstream.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-02-23 17:29:20 +01:00
Lennart Poettering a9791a4192 update TODO 2024-02-23 17:29:06 +01:00
Lennart Poettering 519bad6c2c vmspawn: disable all PCR banks but SHA256
By default swtpm runs with four banks: SHA1, SHA256, SHA384, SHA512.
This means all data that is part of the boot will be hashed four times,
which slows everything down.

Let's restrict things to SHA256 only, which is the one that really
matters. SHA1 is no up to today's standards anyway, and noone really
consumes the other two, hence no point in enabling this.

To disable the banks we need to call swtpm_setup with --pcr-banks. Do
so.
2024-02-23 17:27:56 +01:00
Lennart Poettering d90a05b68f vmspawn: drop "const" from string we free
I am a bit surprised this compiled at all...
2024-02-23 17:27:18 +01:00
Heinrich Schuchardt 819874adc0 detect-virt: allow detection via device-tree on RISC-V
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-02-23 17:25:59 +01:00
Lennart Poettering 72bdf0ac67 Merge pull request #31455 from keszybz/restore-docs-urls
Restore docs urls
2024-02-23 15:59:44 +01:00
Lennart Poettering bebe5f1a74 Merge pull request #31456 from poettering/tpm1.2-no-more
sd-stub: drop any support for TPM 1.2
2024-02-23 14:52:20 +01:00
Sam Leonard 5df0159ef2 ssh-generator: add mention of ssh.authorized_keys.root to man page 2024-02-23 12:52:28 +00:00
Lennart Poettering 085a4d4723 update TODO 2024-02-23 13:20:19 +01:00
Luca Boccassi e0699e067e Merge pull request #31411 from poettering/build-path
userdbd,homed,importd,sysupdate,pid1: make it easier to run daemons that have callouts from build dir
2024-02-23 11:57:42 +00:00
Lennart Poettering eb9b95f9d8 update TODO 2024-02-23 11:09:08 +01:00
Lennart Poettering ffef7a68d3 update TODO 2024-02-23 11:08:14 +01:00
Zbigniew Jędrzejewski-Szmek 0ace2560ea Merge pull request #31352 from DaanDeMeyer/versioning
Rework meson-vcs-tag.sh
2024-02-23 11:07:56 +01:00
Lennart Poettering 13fc754dc3 sd-stub: drop any support for TPM 1.2
TPM 1.2 is obsolete, and doesn't really provide much security guarantees
given it's build around SHA1 which is not up to today's standards.

The rest of systemd's TPM codebase never supported TPM 1.2 hence let's
drop this partial support in sd-stub too. It has created problems after
all (sd-stub reported the measuements and userspace assumed these were
for TPM2), without bringing any benefits (given that the measurements we
make are not consumed by us anyway, unlike those for TPM 2.0)

let's cut off this old support.
2024-02-23 10:56:54 +01:00
Yu Watanabe d0a337bb72 sd-dhcp,sd-ndisc: drop mistakenly set copyright
Follow-ups for
  6efa51f862 (sd-dhcp-client-id.h),
  97c3506dcd (sd-dhcp-duid.h),
  461dbb2fa9 (sd-dhcp-option.h),
  dd8ab4a206 (sd-dhcp-server-lease.h),
  ca34b43481 (sd-ndisc-protocol.h and sd-ndisc-router.h).
2024-02-23 10:09:26 +01:00
Zbigniew Jędrzejewski-Szmek 1b4dc2ea28 docs: drop .md suffixes again 2024-02-23 09:56:00 +01:00
Zbigniew Jędrzejewski-Szmek 8e3fee33af Revert "docs: use collections to structure the data"
This reverts commit 5e8ff010a1.

This broke all the URLs, we can't have that. (And actually, we probably don't
_want_ to make the change either. It's nicer to have all the pages in one
directory, so one doesn't have to figure out to which collection the page
belongs.)
2024-02-23 09:48:47 +01:00
Jan Macku a62013b382 ci(freezer): use GitHub Markdown magic for messages
It should make messages easier to notice.

GitHub docs: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts
2024-02-23 08:44:10 +00:00
Max Staudt 04f19d6735 udev: Add /dev/media/by-path symlinks for media controllers
Add persistent symlinks for media controller ("mediaX") devices, based
on their ID_PATH udev properties.

For example, if the uvcvideo driver creates /dev/media0, a persistent
name may be:
/dev/media/by-path/pci-0000:04:00.3-usb-0:1:1.0-media-controller

Persistent links are a handy tool to make scripts self-documenting
during development or in tests, as well as less error prone in case of
devices changing enumeration order. For media controllers, one can
alternatively scan through all of them and look for a matching bus_info
in their struct media_device_info, but the links are much handier when
drafting something by hand.

A similar pattern already exists for Video4Linux /dev/videoX devices,
see 60-persistent-v4l.rules for those.
2024-02-22 19:27:29 +00:00
Yu Watanabe 3976c43092 network: introduce per-interface IP forwarding settings
This deprecates IPForward= setting, which unconditionally controled
the global setting, even though it is a setting in .network file.

Instead, this introduces new IPv4Forwarding= and IPv6Forwarding=
settings both in .network and networkd.conf.
If these settings are specified in a .network file, then the
per-interface forwarding setting will be configured.
If specified in networkd.conf, then the global IP forwarding setting will
be configured.

Closes #30648.
2024-02-22 19:24:12 +00:00
zzywysm 755fdfffa0 README: mention fq_codel
In 2014, systemd started choosing fq_codel as the default_qdisc in order to fight internet bufferbloat.

https://github.com/systemd/systemd/commit/e6c253e363dee77ef7e5c5f44c4ca55cded3fd47
https://github.com/systemd/systemd/commit/fa98c99ea7f7c5bec3962fa52f4d3496a9777024

While the subsequent change made this change no longer trigger warnings if fq_codel wasn't present, it is still recommended to have this enabled.  Add the necessary kernel configuration to the documentation.
2024-02-22 19:14:31 +00:00
Luca Boccassi 623af61df9 Merge pull request #31441 from yuwata/sd-ndisc-fix-timer
sd-ndisc: disable timer event source only when a valid RA received
2024-02-22 18:48:43 +00:00
Krzesimir Nowak bfa2dd7558 test: Extend systemd-sysext tests to cover the mutability feature 2024-02-22 19:06:22 +01:00
Krzesimir Nowak 58a28be5ac sysext: Add --mutable mode flag
The flag takes "auto" or "import" or a boolean value.

"auto" causes systemd-sysext to make a decision about mutability of the merged
hierarchy based on existence of the upper directory in
`/var/lib/extensions.mutable/${hierarchy}`.

"import" causes the existing upper dir to be actually used as another lower
dir, which results in read-only merged hierarchy.

True value makes systemd-sysext to create the upper dir if it's missing and to
make the merged hierarchy mutable.

False value makes systemd-sysext to ignore upper dir completely, and create a
read-only merged hierarchy.

The default is false value.
2024-02-22 19:06:22 +01:00
Krzesimir Nowak 8a8990653c sysext: Add minimal support for optional mutability for extensions
systemd-sysext will check if /var/lib/extensions.mutable/${hierarchy} exists
and use it as an overlayfs upperdir for storing writes. This allows having
mutable hierarchy after merging the extension images.

The implementation is following a proposed update to the Extension Images
specification at https://github.com/uapi-group/specifications/pull/78.
2024-02-22 19:06:22 +01:00
Krzesimir Nowak 6cadc0bd75 sysext: Refactor the merge hierarchy code
Divide the merge_hierarchy function into code that:

- determines the lower directories for overlayfs

  - determination of lower directories was further split into top, middle and
    bottom directories:

    - bottom - possibly the hierarchy itself

    - middle - hierarchies from extensions

    - top - metadata directory

- mounts the overlayfs using determined directories

- writes information to the metadata directory

- makes the merged hierarchy read-only
2024-02-22 19:06:22 +01:00
Krzesimir Nowak 1212c80c71 test: Initial systemd-sysext tests
The follow-up commit will refactor some code in systemd-sysext, so add some
tests to make sure that things didn't break. The tests will be later extended
with cases for new features added.
2024-02-22 19:06:22 +01:00
Krzesimir Nowak 1f681bb6c0 sysext: Factor out adding overlayfs option
We will use it later when adding workdir and upperdir options for overlayfs
mount operation.
2024-02-22 19:06:22 +01:00
Krzesimir Nowak 2165fd3748 sysext: Do not log failed unmount error again
umount_verbose is already doing it for us.
2024-02-22 19:06:22 +01:00
Krzesimir Nowak 1927bcdc67 mount-util: Add a helper for remounting a bind mount 2024-02-22 19:06:22 +01:00
Luca Boccassi c0b5b74ae3 Merge pull request #31445 from keszybz/slow-tests
Mark more tests as slow
2024-02-22 14:14:23 +00:00