Commit graph

63894 commits

Author SHA1 Message Date
Gaël PORTAY 21c60c76e1 veritysetup: add support for fec options
The verity fec_* parameters allows to use Forward Error Correction to
recover from corruption if hash verification fails.

This adds the options fec_device, fec_offset and fec_roots (sixth
argument) which are the equivalent of the options --fec-device,
--fec-offset and --fec-roots in the veritysetup world.
 - fec-device=FILE
 - fec-offset=BYTES
 - fec-roots=UINT64

See `veritysetup(8)` for more details.
2023-04-13 05:39:49 +02:00
Gaël PORTAY 0bbf7a842a veritysetup: add support for superblock and underlying options
The verity parameter no_superblock allows to format/open an hash device
without the superblock. However, the superblock data must be set to open
the data-device.

This adds the option superblocks (sixth argument) and all the underlying
options which are implied to set the superblock manually if hash device
has no superblock:

 - superblock=BOOL
 - format=NUMBER (hash version type, 0 for original ChromeOS, 1 for
   modern)
 - data-block-size=BYTES (max page-size, multiple of 512)
 - hash-block-size=BYTES (max page-size, multiple of 512)
 - data-blocks=BLOCKS (size of data-device in blocks)
 - salt=HEXSTR (salt used at format, max 256 bytes)
 - uuid=UUID
 - hash=STR (algorithm name for dm-verity used at format, default is
   sha256)

See `veritysetup(8)` for more details.
2023-04-13 05:15:20 +02:00
Gaël PORTAY 14de7ef914 veritysetup: add support for hash-offset option
The verity parameter hash_area_offset allows to locate the superblock in
the hash device. It can be used to have a single device which contains
both data and hashes.

This adds the option hash-offset=BYTES (sixth argument) which is the
equivalent of the option --hash-offset in the veritysetup world.

See `veritysetup(8)` for more details.
2023-04-13 05:15:17 +02:00
David Schroeder 9c669abb71
pid1: fix coredump_filter setting
Correct what appears to be a copy/paste error in config_parse_exec_coredump_filter that is preventing the coredump_filter setting from working correctly.
2023-04-13 07:48:21 +08:00
Michal Sekletar 5015b5014b man: add util-linux to the package list for Fedora container
/bin/login is shipped in util-linux, however, systemd.spec on Fedora has
"Requires: (util-linux-core or util-linux)". If the dependency is
fulfilled just by installation of util-linux-core then users won't be
able to log in into the container after it boots. Let's add util-linux
package to the package list so that /bin/login is always present.
2023-04-12 20:25:16 +01:00
Lennart Poettering 112f27fdbf
Merge pull request #27153 from poettering/varlin-fd-pass
varlink: implement file descriptor passing
2023-04-12 20:34:01 +02:00
Mike Yuan 93ba4c1bc0
Merge pull request #27212 from DaanDeMeyer/notify-exit
core: Propagate exit status via notify socket when running in VM
2023-04-13 01:12:03 +08:00
Mike Yuan 7581da99a1
Merge pull request #27229 from poettering/dissect-policy-confext
dissect: follow-up for image policy merge
2023-04-13 00:14:30 +08:00
Zbigniew Jędrzejewski-Szmek 5a9e2dff47 man: link to Fedora 37
Fedora 36 is a bit old at this point and will be EOL in about 6 weeks.
Fedora 38 is not out yet, so the cloud link wouldn't work.
2023-04-13 00:13:44 +08:00
Yu Watanabe 8e1d6003fb
Merge pull request #27217 from yuwata/boot-entry-at
boot-entry: introduce _at() variant
2023-04-12 22:59:54 +09:00
Lennart Poettering db1f7c84ea varlink: honour "sensitive" flag of json variant objects all the way into the socket
Let's honour the flag if it is set, just to be safe.

(This only handles the case for the writing side: whenever the client
code hands us a json object with the flag set we'll honour it till the
it's out of reach for us. This does *not* handle the reading side, which
is left for a later patch once needed. We probably should add a
per-connection flag that simply globally enables the sensitive logic for
all messages coming in on a specific varlink conneciton.)
2023-04-12 15:14:21 +02:00
Lennart Poettering 7947dbe322 test: add varlink fd passing test 2023-04-12 15:14:21 +02:00
Lennart Poettering d37cdac6ce varlink: implement file descriptor passing
Let's add infrastructure to implement fd passing in varlink, when used
over AF_UNIX.

This will optionally associate one or more fds with a message sent via
varlink and deliver it to the server.
2023-04-12 15:14:21 +02:00
Lennart Poettering 790446bd6c varlink: add helper that clears the currently processed incoming message JSON object
Some minor refactoring. This adds a helper call whose only job is to
unref the JSON object of the currently processed incoming message.

This doesn't make too much sense on its own, given this just replaces
one line by another. However, in a later patch when we'll add fd passing
we'll extend the function to also destroy associated fds, and then it
will start to make more sense.
2023-04-12 15:14:21 +02:00
Lennart Poettering 8531631763 varlink: get rid of "reply" field
So far, if we do a synchronous varlink call from the client side via
varlink_call(), we'll
move the returned json object from "v->current" into "v->reply", and
keep it referenced there until the next call. We then return a pointer
to it. This ensures that the json object remains valid between two
varlink_call() invocations.

But the thing is, we don't need a separate field for that, we can just
leave the data in "v->current". This means VARLINK_IDLE_CLIENT state
will be permitted with and without v->current initialized. Initially,
after connection setup it will be set to NULL, but after the first
varlink_call() it will be set to the most recent response, pinning it
into memory.
2023-04-12 15:14:21 +02:00
Lennart Poettering a3861b4726 varlink: add some comments explaining what by various errors are defined 2023-04-12 15:14:21 +02:00
Daan De Meyer 88eec29d18 core: Send ERRNO= via notify socket on exit 2023-04-12 15:03:45 +02:00
Daan De Meyer 3a89cb84a6 core: Propagate exit status via notify socket when running in VM
When running in a container, we can propagate the exit status of
pid1 as usual via the process exit status. This is not possible
when running in a VM. Instead, let's send EXIT_STATUS=%i via the
notify socket if one is configured. The user running the VM can then
pick up the exit status from the notify socket after the VM has shut
down.
2023-04-12 15:03:43 +02:00
Daan De Meyer 623a00020f notify: Add EXIT_STATUS field
Whenever one of our tools or daemons exits, let's send the exit status
via sd-notify in the EXIT_STATUS field.
2023-04-12 15:02:34 +02:00
Lennart Poettering 4f25844a4b sysext: define a default image dissection policy for confext images 2023-04-12 14:54:44 +02:00
Lennart Poettering b151e69671 discover-image: bring discover path list up-to-date.
While merge 3af48a86d9 was for a working
PR it was based on an older version of git main. Let's catch up with the
search path changes from de862276ed.
2023-04-12 14:41:32 +02:00
Daan De Meyer 14cb10b737 Fix compilation error 2023-04-12 14:36:14 +02:00
Thierry Martin 2f091b1b49 nspawn: container network interface naming
systemd-nspawn now optionally supports colon-separated pair of
host interface name and container interface name for --network-macvlan, --network-ipvlan and --network-interface options.
Also supported in .nspawn configuration files (i.e Interface=, MACVLAN=, IPVLAN= parameters).

man page changed for ntwk interface naming
2023-04-12 14:28:43 +02:00
Lennart Poettering 3af48a86d9
Merge pull request #25608 from poettering/dissect-moar
dissect: add dissection policies
2023-04-12 13:46:08 +02:00
Luca Boccassi 068943453f
Merge pull request #27165 from poettering/fdstore-envvar
service: tell service processes that the fdstore is available via an e…
2023-04-12 12:13:43 +01:00
Yu Watanabe d2d969bb45 boot-entry: introduce boot_entry_token_ensure_at() 2023-04-12 19:47:34 +09:00
Yu Watanabe e61ab091b7
Merge pull request #27223 from dtardon/install-changes
Simplify use of bus_deserialize_and_dump_unit_file_changes()
2023-04-12 19:30:51 +09:00
Daan De Meyer ea24ed79f6
Merge pull request #27220 from yuwata/sd-device-follow-ups-for-devlink
sd-device: several follow-ups about devlink creation
2023-04-12 11:49:08 +02:00
Lennart Poettering 1412ad9a81 man: rebreak all of sd_notify(3)
No change of contents, just some rebreaking of the full file to match
our current line break settings.
2023-04-12 10:34:37 +02:00
Lennart Poettering 75b29fda71 service: tell service processes that the fdstore is available via an env var 2023-04-12 10:34:31 +02:00
David Tardon 234d964c2e systemctl: reduce variable scope 2023-04-12 09:53:55 +02:00
David Tardon 5e891cbb5c tree-wide: drop unneeded output params
Neither of the callers of bus_deserialize_and_dump_unit_file_changes()
touches the changes array, so let's simplify things and keep it internal
to the function.
2023-04-12 09:53:55 +02:00
Yu Watanabe f643ca1767
Merge pull request #27033 from dtardon/array-cleanup
Use CLEANUP_ARRAY more
2023-04-12 16:43:39 +09:00
Yu Watanabe fda18ce2b6 boot-entry: use chase_and_fopen_unlocked() to open /etc/kernel/entry-token
Otherwise, when 'root' is specified, the file may be a symlink to a host
file, and we may read wrong entry.
2023-04-12 16:23:03 +09:00
Yu Watanabe 7e430500d2 udev-test: add more testcases for SYMLINK 2023-04-12 10:52:14 +09:00
Frantisek Sumsal 82929336c7 test: drop binary stripping stuff
Stripping the binaries in the test images makes potential stack straces
quite useless, so let's drop the stripping stuff to make test fails a bit
more developer friendly.

Related: https://github.com/systemd/systemd-centos-ci/pull/616
2023-04-12 10:33:32 +09:00
Yu Watanabe 70e4510805 sd-device: absolute devlink must start with /dev/
This also makes device node path is handled with the same logic.

Addresses https://github.com/systemd/systemd/pull/27169#discussion_r1162739511.

Follow-up for 2c5f119c3c.
2023-04-12 09:20:11 +09:00
Yu Watanabe 3b5fc5fb1b boot-entry: prioritize machine ID only when it is not randomly generated
Preparation for later commits. The parameter will be used in
kernel-install later.
2023-04-12 08:31:50 +09:00
Daan De Meyer 965b481d9b
Merge pull request #27214 from DaanDeMeyer/firstboot
firstboot: Use root directory file descriptor for everything
2023-04-11 22:30:09 +02:00
Tanishka fd7623193d Modified to use STRV_MAKE() in strv_env_name_is_valid() function listed in env-util.c 2023-04-11 21:05:22 +02:00
Zbigniew Jędrzejewski-Szmek f843f8be9c
Merge pull request #27209 from jamacku/patch-1
Don't run release workflow on `systemd-security` & drop checkout action
2023-04-11 20:44:48 +02:00
Mike Yuan 8a826a979a systemctl: suppress error for try-* if unit is masked
Closes #16521
2023-04-11 17:54:02 +01:00
Jan Janssen b87d6da447 boot: Fix alignment of long long inside structs on x86
On x86 EFI follows the windows ABI, which expects 8-byte aligned long
long. The x86 sysv ELF ABI expects them to be 8-byte aligned when used
alone, but 4-byte aligned when they appear inside of structs:

    struct S {
        int i;
        long long ll;
    };

    // _Static_assert(sizeof(struct S) == 12, "x86 sysv ABI");
    _Static_assert(sizeof(struct S) == 16, "EFI/MS ABI");

To get the behavior we need when building with sysv ELF ABI we need to
pass '-malign-double' to the compiler as done by EDK2.

This in turn will make ubsan unhappy as the stack may not be properly
aligned on entry, so we have to tell the compiler explicitly to re-align
the stack on entry to efi_main.

This fixes loading EFI drivers on x86 that were previously always
rejected as the EFI_LOADED_IMAGE_PROTOCOL had a wrong memory layout.

See also: https://github.com/rhboot/shim/pull/516
2023-04-11 17:09:18 +01:00
Jan Macku 19cdda7c3a ci: drop checkout from release workflow
It's not required as per comment - https://github.com/systemd/systemd/pull/27110#issuecomment-1499653913
2023-04-11 16:59:18 +02:00
Jan Macku 9718afd194 ci: don't run release wf on systemd-security 2023-04-11 16:59:18 +02:00
David Tardon f86a41291b portabled-image-bus: use CLEANUP_ARRAY 2023-04-11 16:32:48 +02:00
David Tardon a5290effe8 portabled-image-bus: use CLEANUP_ARRAY 2023-04-11 16:32:47 +02:00
David Tardon 2b4b01b00a portabled-image-bus: use CLEANUP_ARRAY 2023-04-11 16:32:46 +02:00
David Tardon 0dab8d5dc7 portabled-bus: use CLEANUP_ARRAY 2023-04-11 16:32:45 +02:00
David Tardon bd92527752 sd-bus: use _cleanup_ 2023-04-11 16:31:52 +02:00