Yu Watanabe [Thu, 8 Dec 2022 06:18:28 +0000 (15:18 +0900)]
test: add tests for "uninitialized" string handling by id128_read_fd()
Yu Watanabe [Thu, 8 Dec 2022 05:30:31 +0000 (14:30 +0900)]
sd-id128: make id128_read() or friends return -ENOPKG when the file contents is "uninitialized"
Then, this drops ID128_PLAIN_OR_UNINIT. Also, this renames
Id128Format -> Id128FormatFlag, and make it bitfield.
Fixes #25634.
Yu Watanabe [Thu, 8 Dec 2022 05:20:03 +0000 (14:20 +0900)]
sd-id128: several cleanups
- use SD_ID128_STRING_MAX or friend,
- use sizeof(sd_id128_t),
- use newly introduced ascii_ishex().
Yu Watanabe [Thu, 8 Dec 2022 05:13:47 +0000 (14:13 +0900)]
string-util: introduce ascii_ishex()
Luca Boccassi [Mon, 12 Dec 2022 12:26:42 +0000 (13:26 +0100)]
Merge pull request #25707 from yuwata/sd-device-fix-double-free
sd-device: fix double-free
Lennart Poettering [Mon, 12 Dec 2022 11:59:16 +0000 (12:59 +0100)]
update TODO
Yu Watanabe [Mon, 12 Dec 2022 06:04:02 +0000 (15:04 +0900)]
test: name_assign_type sysattr never exists for enumerated devices
As we filtered out network devices in the test.
Yu Watanabe [Mon, 12 Dec 2022 05:16:09 +0000 (14:16 +0900)]
sd-device: fix double-free
If an attribute is read but the value is not used (i.e. ret_value is NULL),
then sd_device_get_sysattr_value() mistakenly frees the read data even though
it is cached internally.
Fixes a bug introduced by
acfc2a1d15560084e077ffb3be472cd117e9020a.
Fixes #25702.
Hugo Carvalho [Sat, 10 Dec 2022 12:19:51 +0000 (13:19 +0100)]
po: Translated using Weblate (Portuguese)
Currently translated at 100.0% (193 of 193 strings)
Co-authored-by: Hugo Carvalho <hugokarvalho@hotmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/pt/
Translation: systemd/main
Lycowolf [Sun, 11 Dec 2022 11:16:52 +0000 (12:16 +0100)]
Add mount matrix for VisionBook 12Wr Tab
Lennart Poettering [Fri, 9 Dec 2022 15:08:54 +0000 (16:08 +0100)]
repart: support erofs
So, i think "erofs" is probably the better, more modern alternative to
"squashfs". Many of the benefits don't matter too much to us I guess,
but there's one thing that stands out: erofs has a UUID in the
superblock, squashfs has not. Having an UUID in the superblock matters
if the file systems are used in an overlayfs stack, as overlayfs uses
the UUIDs to robustly and persistently reference inodes on layers in
case of metadata copy-up.
Since we probably want to allow such uses in overlayfs as emplyoed by
sysext (and the future syscfg) we probably should ramp up our erofs game
early on. Hence let's natively support erofs, test it, and in fact
mention it in the docs before squashfs even.
jcg [Fri, 9 Dec 2022 12:45:39 +0000 (20:45 +0800)]
mount-setup: don't need to mount /sys/fs/pstore if there is no ENABLE_PSTORE
Daan De Meyer [Fri, 9 Dec 2022 11:10:09 +0000 (12:10 +0100)]
ci: Labeler improvements
- Mention "/please-review" in the contributing guide
- Remove "needs-rebase" on push
- Don't add "please-review" if a green label is set
- Don't add please-review label to draft PRs
- Add please-review when a PR moves out of draft
Zbigniew Jędrzejewski-Szmek [Fri, 9 Dec 2022 14:03:45 +0000 (15:03 +0100)]
Merge pull request #25636 from thom311/th/wcast-align-fixes
all: avoid various "-Wcast-align=strict" warnings
Thomas Haller [Thu, 1 Dec 2022 13:07:22 +0000 (14:07 +0100)]
all: avoid various "-Wcast-align=strict" warnings
Zbigniew Jędrzejewski-Szmek [Thu, 8 Dec 2022 20:22:32 +0000 (21:22 +0100)]
Merge pull request #25653 from yuwata/base64_append
hexdecoct: several fixes for base64_append()
Yu Watanabe [Thu, 8 Dec 2022 19:58:01 +0000 (04:58 +0900)]
Yu Watanabe [Wed, 7 Dec 2022 00:35:41 +0000 (09:35 +0900)]
resolve: optimize conversion of TXT fields to json
Fixes oss-fuzz#54080 (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54080).
Fixes #25654.
Yu Watanabe [Wed, 7 Dec 2022 00:06:48 +0000 (09:06 +0900)]
hexdecoct: fix NULL pointer dereferences in hexmem()
Fixes oss-fuzz#54090 (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54090).
Fixes #25655.
Yu Watanabe [Tue, 6 Dec 2022 21:58:23 +0000 (06:58 +0900)]
hexdecoct: add missing NULL check
Fixes oss-fuzz#54065 (https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54065).
Fixes #25650.
Yu Watanabe [Tue, 6 Dec 2022 22:01:48 +0000 (07:01 +0900)]
test: add tests for base64_append()
Yu Watanabe [Tue, 6 Dec 2022 21:49:17 +0000 (06:49 +0900)]
hexdecoct: several cleanups for base64_append()
- add missing assertions,
- use size_t for buffser size or memory index,
- handle empty input more gracefully,
- return the length or the result string,
- fix off-by-one issue when the prefix is already long enough.
Edson Juliano Drosdeck [Thu, 8 Dec 2022 19:51:09 +0000 (16:51 -0300)]
hwdb: add Positivo-vaio Pro PW key toggle touchpad (#25669)
Daan De Meyer [Thu, 8 Dec 2022 15:25:03 +0000 (16:25 +0100)]
ci: Add/Drop labels on pull request activity and comment
When a pull request is opened/updated, add "please-review" and
remove a few other labels.
When a comment is made with /please-review on a PR. Add the
"please-review" label to the PR.
Lennart Poettering [Thu, 8 Dec 2022 16:48:34 +0000 (17:48 +0100)]
socket-util: add CMSG_TYPED_DATA() as type-safe wrapper around CMSG_DATA()
Thomas Haller [Mon, 5 Dec 2022 22:11:13 +0000 (23:11 +0100)]
fundamental: add CAST_ALIGN_PTR() macro
Lennart Poettering [Thu, 8 Dec 2022 16:24:52 +0000 (17:24 +0100)]
Merge pull request #25662 from msizanoen1/s2h-nosuspend-user-proc
sleep: always thaw user.slice even if freezing failed
Lennart Poettering [Thu, 8 Dec 2022 16:24:17 +0000 (17:24 +0100)]
Merge pull request #25667 from poettering/sha256-align-fix
sha256 alignment fixes/rework
Lennart Poettering [Thu, 8 Dec 2022 16:23:15 +0000 (17:23 +0100)]
Merge pull request #25665 from poettering/dissect-memory
dissect: add a mode for operating on an in-memory copy of a DDI, inst…
Yu Watanabe [Wed, 7 Dec 2022 00:51:30 +0000 (09:51 +0900)]
fs-util: make chmod_and_chown_at() work with empty path and AT_FDCWD
Follow-up for
7d000133c2fbf4b5986185ccfc0273a2428972a9.
Fixes CID#
1500608.
Lennart Poettering [Wed, 7 Dec 2022 17:19:29 +0000 (18:19 +0100)]
sha256: port to new generic IS_ALIGNED32() macro
This drops the special casing for s390 and other archs, which was
cargo-culted from glibc. Given it's not obvious why it exists, and is at
best an optimization let's simply avoid it, in particular as the archs
are relatively non-mainstream.
Inspired by: #25636
Lennart Poettering [Wed, 7 Dec 2022 17:31:27 +0000 (18:31 +0100)]
macro: add generic IS_ALIGNED32() anf friends
Let's generalize (and invert) the UNALIGNED32_P() macro from the sha256
code, and let's add a test for it.
Lennart Poettering [Wed, 7 Dec 2022 17:13:12 +0000 (18:13 +0100)]
sha256: move to unaligned_write_ne32()
Lennart Poettering [Wed, 7 Dec 2022 17:10:42 +0000 (18:10 +0100)]
fundamental: split out unaligned_{read|write}_ne{16,32,64}() helpers into unaligned-fundamental.h
Let's allow using this in code shared between userspace and EFI mode.
Also, don't implement these functions via endianness conversions given
we don't actually want to convert endianess here.
Lennart Poettering [Wed, 7 Dec 2022 17:32:38 +0000 (18:32 +0100)]
sha256: external headers should be included with <>
Lennart Poettering [Thu, 8 Dec 2022 14:11:18 +0000 (15:11 +0100)]
Merge pull request #25180 from keszybz/ukify
ukify: add helper to create UKIs
msizanoen1 [Thu, 8 Dec 2022 01:35:32 +0000 (02:35 +0100)]
core: pending_freezer_{message => invocation}
Rename the field to reflect the new semantics.
msizanoen1 [Wed, 7 Dec 2022 16:22:05 +0000 (23:22 +0700)]
core/sleep: set timeout for freeze/thaw operation to 1.5 seconds
A FreezeUnit operation can hang due to the presence of kernel threads
(see last 2 commits). Keeping the default configuration will mean the
system will hang for 25 seconds in suspend waiting for the response. 1.5
seconds should be sufficient for most cases.
msizanoen1 [Wed, 7 Dec 2022 16:09:33 +0000 (23:09 +0700)]
core/cgroup: ignore kernel cgroup.events when thawing
The `frozen` state can be `0` while the processes are indeed frozen (see
last commit). Therefore do not respect cgroup.events when checking
whether thawing is necessary.
Lennart Poettering [Thu, 8 Dec 2022 11:46:41 +0000 (12:46 +0100)]
test: add simple test for new --in-memory switch for systemd-dissect
Lennart Poettering [Thu, 8 Dec 2022 11:46:24 +0000 (12:46 +0100)]
man: add doc for new --in-memory switch of systemd-dissect
Lennart Poettering [Thu, 8 Dec 2022 11:46:09 +0000 (12:46 +0100)]
dissect: add a mode for operating on an in-memory copy of a DDI, instead of directly on it
This is useful for operating in ephemeral, writable mode on any image,
including read-only ones. It also has the benefit of not keeping the
image file's filesystem busy.
Inspired by the discussions in #25648
Lennart Poettering [Thu, 8 Dec 2022 11:45:48 +0000 (12:45 +0100)]
loop-util: add new loop_device_make_by_path_memory() helper
This uses the new memfd_clone_fd() call to make an in-memory copy of
some file before setting up a loopback block device on it.
Lennart Poettering [Thu, 8 Dec 2022 11:45:26 +0000 (12:45 +0100)]
data-fd-util: add new memfd_clone_fd() helper
This adds a new helper for cloning any file's contents (or block device contents) into a new memfd.
Antonio Alvarez Feijoo [Wed, 7 Dec 2022 15:52:27 +0000 (16:52 +0100)]
cryptsetup: retry TPM2 unseal operation if it fails with TPM2_RC_PCR_CHANGED
Quoting "Trusted Platform Module Library - Part 3: Commands (Rev. 01.59)":
"pcrUpdateCounter – this parameter is updated by TPM2_PolicyPCR(). This value
may only be set once during a policy. Each time TPM2_PolicyPCR() executes, it
checks to see if policySession->pcrUpdateCounter has its default state,
indicating that this is the first TPM2_PolicyPCR(). If it has its default value,
then policySession->pcrUpdateCounter is set to the current value of
pcrUpdateCounter. If policySession->pcrUpdateCounter does not have its default
value and its value is not the same as pcrUpdateCounter, the TPM shall return
TPM_RC_PCR_CHANGED.
If this parameter and pcrUpdateCounter are not the same, it indicates that PCR
have changed since checked by the previous TPM2_PolicyPCR(). Since they have
changed, the previous PCR validation is no longer valid."
The TPM will return TPM_RC_PCR_CHANGED if any PCR value changes (no matter
which) between validating the PCRs binded to the enrollment and unsealing the
HMAC key, so this patch adds a retry mechanism in this case.
Fixes #24906
Yu Watanabe [Thu, 8 Dec 2022 04:17:15 +0000 (13:17 +0900)]
man: mention that DefaultRouteOnDevice= create the IPv4 default route
And add an example setting for creating an IPv6 default route.
Closes #25440.
Yu Watanabe [Thu, 8 Dec 2022 07:04:36 +0000 (16:04 +0900)]
Merge pull request #25672 from jelly/FirwmwareName
Extend hostnamed DMI firmware properties
Yu Watanabe [Thu, 8 Dec 2022 03:29:07 +0000 (12:29 +0900)]
Merge pull request #25564 from poettering/dissect-discover
systemd-dissect: add simple "--discover" command
Yu Watanabe [Thu, 8 Dec 2022 03:23:29 +0000 (12:23 +0900)]
Merge pull request #25666 from poettering/selinux-getconf-fixup
selinux getXYZcon() NULL return fixes
Jade Lovelace [Wed, 7 Dec 2022 19:14:30 +0000 (11:14 -0800)]
oomd: print dry run output at INFO level
Otherwise, the dry run isn't much use since it would be logged at debug
and not seen.
Frantisek Sumsal [Wed, 7 Dec 2022 19:44:07 +0000 (20:44 +0100)]
test: wait for the monitoring service to become active
Otherwise we might start querying resolved too early, causing the
monitoring service to miss stuff:
```
[ 1103.149474] testsuite-75.sh[35]: + systemd-run -u resmontest.service -p Type=notify resolvectl monitor
[ 1103.353803] testsuite-75.sh[423]: Running as unit: resmontest.service
[ 1103.353989] testsuite-75.sh[35]: + knotc zone-begin test.
[ 1103.354160] testsuite-75.sh[425]: OK
...
[ 1103.355298] testsuite-75.sh[35]: + knotc reload
[ 1103.355363] testsuite-75.sh[438]: Reloaded
[ 1103.355536] testsuite-75.sh[35]: + : '--- nss-resolve/nss-myhostname tests'
[ 1103.355536] testsuite-75.sh[35]: + run getent -s resolve hosts ns1.unsigned.test
[ 1103.356127] testsuite-75.sh[443]: + getent -s resolve hosts ns1.unsigned.test
[ 1103.356505] testsuite-75.sh[444]: + tee /tmp/tmp.bXg5Uj5Jkk
[ 1103.359591] resolvectl[424]: → Q: ns1.unsigned.test IN AAAA
[ 1103.359591] resolvectl[424]: ← S: success
[ 1103.359850] testsuite-75.sh[444]: 10.0.0.1 ns1.unsigned.test
[ 1103.359939] resolvectl[424]: → Q: ns1.unsigned.test IN A
[ 1103.359939] resolvectl[424]: ← S: success
[ 1103.359939] resolvectl[424]: ← A: ns1.unsigned.test IN A 10.0.0.1
[ 1103.360149] testsuite-75.sh[35]: + grep -qE '^10\.0\.0\.1\s+ns1\.unsigned\.test' /tmp/tmp.bXg5Uj5Jkk
[ 1103.362119] systemd[1]: Starting resmontest.service...
[ 1103.362633] systemd[1]: Started resmontest.service.
[ 1103.363263] testsuite-75.sh[35]: + monitor_check_rr 'ns1.unsigned.test IN A 10.0.0.1'
[ 1103.363263] testsuite-75.sh[35]: + local 'match=ns1.unsigned.test IN A 10.0.0.1'
[ 1103.363377] testsuite-75.sh[35]: + set +o pipefail
[ 1103.363836] testsuite-75.sh[458]: + journalctl -u resmontest.service -f --full
[ 1103.364042] testsuite-75.sh[459]: + grep -m1 'ns1.unsigned.test IN A 10.0.0.1'
...
Trying to halt container. Send SIGTERM again to trigger immediate termination.
Container TEST-75 terminated by signal KILL.
```
Space Meyer [Wed, 7 Dec 2022 13:11:30 +0000 (14:11 +0100)]
journald: prevent segfault on empty attr/current
getpidcon() might set con to NULL, even when it returned a 0 return
code[0]. The subsequent strlen(con) will then cause a segfault.
Alternatively the behaviour could also be changed in getpidcon. I
don't know whether the libselinux folks are comitted to the current
behaviour, but the getpidcon man page doesn't really make it obvious
this case could happen.
[0] https://github.com/SELinuxProject/selinux/blob/
fb7f35495fbad468d6efa76c5fed727659903038/libselinux/src/procattr.c#L155-L158
msizanoen1 [Wed, 7 Dec 2022 13:46:01 +0000 (20:46 +0700)]
core/unit: allow overriding an ongoing freeze operation
Sometimes a freeze operation can hang due to the presence of kernel
threads inside the unit cgroup (e.g. QEMU-KVM). This ensures that the
ThawUnit operation invoked by systemd-sleep at wakeup always thaws the
unit.
msizanoen1 [Wed, 7 Dec 2022 09:32:05 +0000 (16:32 +0700)]
core/cgroup: thaw slice of unit when thawing unit
This ensures starting a new unit under a frozen slice work as expected.
msizanoen1 [Wed, 7 Dec 2022 09:38:05 +0000 (16:38 +0700)]
core/slice: skip member units without realized cgroup during freeze or thaw
This ensures that services with `RemainAfterExit` but without any
process running won't cause failure during freeze.
msizanoen1 [Wed, 7 Dec 2022 09:54:13 +0000 (16:54 +0700)]
sleep: always thaw user.slice even if freezing failed
`FreezeUnit` can fail even when some units did got frozen, causing some
user units to be frozen. A possible symptom is `user@.service` being
frozen while still being able to log in over SSH.
Luca Boccassi [Wed, 7 Dec 2022 19:51:47 +0000 (20:51 +0100)]
Merge pull request #25632 from keszybz/chroot-fix
Add trivial check for preset operation in chroot
Luca Boccassi [Wed, 7 Dec 2022 19:45:23 +0000 (20:45 +0100)]
Merge pull request #25465 from DaanDeMeyer/repart-workspace
repart: Cleanup created files on failure
Jelle van der Waa [Wed, 7 Dec 2022 16:33:50 +0000 (17:33 +0100)]
hostnamed: expose FirmwareDate dbus property
Expose /sys/class/dmi/id/bios_date as dbus property in hostnamed.
Jelle van der Waa [Tue, 6 Dec 2022 17:23:18 +0000 (18:23 +0100)]
hostnamed: expose FirmwareVendor as dbus property
Expose /sys/class/dmi/id/bios_vendor as dbus property in hostnamed.
Lennart Poettering [Tue, 29 Nov 2022 15:39:06 +0000 (16:39 +0100)]
dissect: add simple --discover command
Lennart Poettering [Tue, 29 Nov 2022 15:40:15 +0000 (16:40 +0100)]
discover-image: store image class in Image object too, if known
Lennart Poettering [Tue, 29 Nov 2022 15:38:48 +0000 (16:38 +0100)]
discover-image: add stringification helpers for ImageClass
Zbigniew Jędrzejewski-Szmek [Sat, 26 Nov 2022 13:31:57 +0000 (14:31 +0100)]
ukify: allow multiple initrds
If given, multiple initrds are concatenated into a temporary file which then
becomes the .initrd section.
It is also possible to give no initrd. After all, some machines boot without an
initrd, and it should be possible to use the stub without requiring an initrd.
(The stub might not like this, but this is something to fix there.)
Zbigniew Jędrzejewski-Szmek [Fri, 25 Nov 2022 18:14:42 +0000 (19:14 +0100)]
ci: install pefile
Zbigniew Jędrzejewski-Szmek [Fri, 25 Nov 2022 15:25:23 +0000 (16:25 +0100)]
man: add man page for ukify
Zbigniew Jędrzejewski-Szmek [Wed, 16 Nov 2022 16:44:28 +0000 (17:44 +0100)]
ukify: try to find the uname string in the linux image if not specified
The approach is based on mkinicpio's autodetection.
This is hacky as hell. Some cases are actually fairly nice: ppc64el images have
a note that contains 'uname -r'. (The note is not uniquely labeled at all, and
only contains the release part instead of the full version-hostname-release
string, and we don't actually care about ppc, and it's very hard to read the
note from Python, but in general that'd be the approach I'd like.)
I opted to simply read and decompress the full linux binary in some cases.
Python doesn't make it easy to do streaming decompression with regexp matching,
and it doesn't seem to matter much: the image decompresses in a fraction of a
second.
Zbigniew Jędrzejewski-Szmek [Fri, 25 Nov 2022 16:21:40 +0000 (17:21 +0100)]
tests: add pytest tests for ukify
Some gymnastics were needed to import ukify as a module. Before the file
was templated, this was trivial: insert the directory in sys.path, call import.
But it's a real pain to import the unsuffixed file after processing. Instead,
the untemplated file is imported, which works well enough for tests and is
very simple.
The tests can be called via pytest:
PATH=build/:$PATH pytest -v src/ukify/test/test_ukify.py
or directly:
PATH=build/:$PATH src/ukify/test/test_ukify.py
or via the meson test machinery output:
meson test -C build test-ukify -v
or without verbose output:
meson test -C build test-ukify
Zekret files are obfuscated using base64.
Luca Boccassi [Wed, 7 Dec 2022 14:49:30 +0000 (15:49 +0100)]
Merge pull request #25651 from keszybz/man-halt
Deemphasize 'halt' subcommand
Zbigniew Jędrzejewski-Szmek [Wed, 16 Nov 2022 14:52:47 +0000 (15:52 +0100)]
meson,ukify: hook up ukify, add --version option
The option is added because we have a similar one for kernel-install. This
program requires python, and some people might want to skip it because of this.
The tool is installed in /usr/lib/systemd for now, since the interface might
change.
A template file is used, but there is no .in suffix.
The problem is that we'll later want to import the file as a module
for tests, but recent Python versions make it annoyingly hard to import
a module from a file without a .py suffix. imp.load_sources() works, but it
is deprecated and throws warnings.
importlib.machinery.SourceFileLoader().load_module() works, but is also
deprecated. And the documented replacements are a maze of twisted little
callbacks that result in an empty module.
So let's take the easy way out, and skip the suffix which makes it easy
to import the template as a module after adding the directory to sys.path.
Zbigniew Jędrzejewski-Szmek [Sat, 29 Oct 2022 18:07:46 +0000 (20:07 +0200)]
ukify: add helper to create UKIs
Features:
- adds sections .linux, .initrd, .uname, .osrel, .pcrpkey, .pcrsig, .cmdline, .splash
- multiple initrds can be concatenated
- section flags are set properly (READONLY, DATA or CODE)
- uses systemd-measure to precalculate pcr measurements and create a signed json policy
- the inner linux image will be signed automatically with sbsign if unsigned
- uses sbsign to sign the output image
- offsets are calculated so that sections are placed adjacent, with .linux last
- custom sections are possible
- multiple pcr signing keys can be specified and different boot phase paths can be
signed with different keys
- most things can be overriden (path to tools, stub file, signing keys, pcr banks,
boot phase paths, whether to sign things)
- superficial verification of slash bmp is done
- kernel uname "scraping" from the kernel if not specified (in a later patch)
TODO:
- change systemd-measure to not require a functional TPM2. W/o this, we'd need
to support all banks in the build machine, which is hard to guarantee.
- load signing keys from /etc/kernel/
- supress exceptions, so if something external fails, the user will not see a traceback
- conversion to BMP from other formats
$ sudo /usr/lib/systemd/ukify \
--tools=build/ \
--measure \
/lib/modules/6.0.5-300.fc37.x86_64/vmlinuz \
/boot/
08a5690a2eed47cf92ac0a5d2e3cf6b0/6.0.5-300.fc37.x86_64/initrd \
--secureboot-private-key=server.key --secureboot-certificate=server.crt \
--pcr-private-key=tpm2-pcr-private.pem --pcr-public-key=tpm2-pcr-public.pem \
--cmdline='rw quiet' \
--section test:TESTTESTTEST \
--section test2:TESTTESTTEST2 \
--pcr-banks=sha1 \
--uname="$(uname -rv)"
Host arch 'x86_64', efi arch 'x64'
+ sbverify --list /lib/modules/6.0.5-300.fc37.x86_64/vmlinuz
+ build/systemd-measure calculate --linux=/lib/modules/6.0.5-300.fc37.x86_64/vmlinuz --osrel=/etc/os-release --cmdline=/tmp/tmpcmdline_5aufjir --pcrpkey=tpm2-pcr-public.pem --initrd=/boot/
08a5690a2eed47cf92ac0a5d2e3cf6b0/6.0.5-300.fc37.x86_64/initrd --bank=sha1
11:sha1=
03df5e5243bc002b959d52359fe04e266d0b5ebf
11:sha1=
54949b82bae32e80343ff0f01eeeeb75f4c07d3f
11:sha1=
0fc62be88aa9c5ad7282aa8adb504f451bcec9df
11:sha1=
b71155e7fcd467f7c1696f675e37887032e2eafa
+ build/systemd-measure sign --linux=/lib/modules/6.0.5-300.fc37.x86_64/vmlinuz --osrel=/etc/os-release --cmdline=/tmp/tmpcmdline_5aufjir --pcrpkey=tpm2-pcr-public.pem --initrd=/boot/
08a5690a2eed47cf92ac0a5d2e3cf6b0/6.0.5-300.fc37.x86_64/initrd --bank=sha1 --private-key=tpm2-pcr-private.pem --public-key=tpm2-pcr-public.pem
+ objcopy /usr/lib/systemd/boot/efi/linuxx64.efi.stub --add-section .osrel=/etc/os-release --change-section-vma .osrel=0x22000 --add-section .cmdline=/tmp/tmpcmdline_5aufjir --change-section-vma .cmdline=0x23000 --add-section .pcrpkey=tpm2-pcr-public.pem --change-section-vma .pcrpkey=0x24000 --add-section .initrd=/boot/
08a5690a2eed47cf92ac0a5d2e3cf6b0/6.0.5-300.fc37.x86_64/initrd --change-section-vma .initrd=0x25000 --add-section .uname=/tmp/tmpuname0v3uzh5r --change-section-vma .uname=0x4009000 --add-section .test=/tmp/tmptestuxve59c8 --change-section-vma .test=0x400a000 --add-section .test2=/tmp/tmptest2_i143p9i --change-section-vma .test2=0x400b000 --add-section .pcrsig=/tmp/tmppcrsigdtcqxz_w --change-section-vma .pcrsig=0x400c000 --add-section .linux=/lib/modules/6.0.5-300.fc37.x86_64/vmlinuz --change-section-vma .linux=0x400d000 /tmp/uki4vsbf7y8
+ sbsign --key server.key --cert server.crt /tmp/uki4vsbf7y8 --output vmlinuz.efi
warning: data remaining[
79849520 vs
79866644]: gaps between PE/COFF sections?
warning: data remaining[
79849520 vs
79866648]: gaps between PE/COFF sections?
Signing Unsigned original image
Wrote signed vmlinuz.efi
Lennart Poettering [Wed, 7 Dec 2022 14:23:02 +0000 (15:23 +0100)]
selinux-setup: minor modernizations
Lennart Poettering [Wed, 7 Dec 2022 14:20:15 +0000 (15:20 +0100)]
selinux: accept the fact that getxyzcon() can return success and NULL
Inspired by #25664: let's check explicitly for NULL everywhere we do one
of those getXYZcon() calls.
We usually turn this into EOPNOTSUPP, as when selinux is off (which is
supposed to be the only case this can happen according to selinux docs)
we otherwise return EOPNOTSUPP in that case.
Note that in most cases we have an explicit mac_selinux_use() call
beforehand, hence this should mostly not be triggerable codepaths.
Yu Watanabe [Mon, 28 Nov 2022 18:20:33 +0000 (03:20 +0900)]
network: manage addresses in the way the kernel does
This effectively reverts
5d0030310c134a016321ad8cf0b4ede8b1800d84.
With the commit
5d0030310c134a016321ad8cf0b4ede8b1800d84, networkd manages
addresses with the detailed hash and compare functions. But that causes
networkd cannot detect address update by the kernel or an external tool.
See issue
https://github.com/systemd/systemd/issues/481#issuecomment-
1328132401.
With this commit, networkd (again) manages addresses in the way that the
kernel does. Hence, we can correctly detect address update.
Yu Watanabe [Wed, 7 Dec 2022 04:53:37 +0000 (13:53 +0900)]
test-network: try to change MAC address more
Follow-up for
23b6bf274fc1a46d8778bfc979d3c803d61a1f5c.
Frantisek Sumsal [Wed, 7 Dec 2022 12:04:44 +0000 (13:04 +0100)]
packit: ignore unpackaged files
It may take a bit for newly introduced binaries/other files to get
properly integrated into the Rawhide specfile, so don't choke up in the
meantime when rpmbuild detects unpackaged files.
Lennart Poettering [Wed, 7 Dec 2022 13:28:36 +0000 (14:28 +0100)]
update TODO
Luca Boccassi [Wed, 7 Dec 2022 12:01:50 +0000 (13:01 +0100)]
Merge pull request #25502 from keszybz/pam-namespace-add
Add pam_namespace to user@.service pam stack
Yu Watanabe [Wed, 7 Dec 2022 03:01:59 +0000 (12:01 +0900)]
core: use correct scope of looking up units
Fixes a bug introduced by
3b3557c410c7910fae0990599dcb82711cf5fbb7.
Fixes #25625.
Zbigniew Jędrzejewski-Szmek [Wed, 7 Dec 2022 08:52:35 +0000 (09:52 +0100)]
TEST-65: use [[ -v ]] more
It's a bashism, but we use other bash features anyway, and it's cleaner
and much less verbose.
Zbigniew Jędrzejewski-Szmek [Mon, 5 Dec 2022 12:52:28 +0000 (13:52 +0100)]
TEST-65: check cat-config operation in chroot
This verifies the fix in
2075b6dd394e09a0f203b9cc7e3253908397f933.
Lennart Poettering [Wed, 7 Dec 2022 10:34:54 +0000 (11:34 +0100)]
Merge pull request #25648 from keszybz/exitrd
Build systemd-shutdown.standalone
Zbigniew Jędrzejewski-Szmek [Tue, 6 Dec 2022 10:27:31 +0000 (11:27 +0100)]
man: deemphasize "halt"
Systemd documents "halt" as the primary shutdown mechanism, redirecting
"reboot" and "shutdown" to the halt(8), but halt is a really strange and
obsolete concept. Who would want to really keep their machine running after
shutdown? I expect that halting is almost unused. Let's at least make it less
prominent in the docs.
While at it, use "power off" for a verb and "power-off" for noun (but "poweroff"
of the actual command name).
Yu Watanabe [Wed, 7 Dec 2022 02:18:07 +0000 (11:18 +0900)]
fuzz-systemctl: adjust size limit
Follow-up for
719b7d4dc2bde3a9257e9f6fdcf03239ee2324b6.
The size of the current reproducer is 250KB. Hence, 16KB should be
enough, but still we can test most arguments within the size.
Hopefully fixes oss-fuzz#53552.
Yu Watanabe [Wed, 7 Dec 2022 04:34:39 +0000 (13:34 +0900)]
Merge pull request #25628 from zhangjian3032/dev/fix-set-bond-mac-failed
network: Fix set bond device MAC address failed
Daan De Meyer [Mon, 5 Dec 2022 10:15:58 +0000 (11:15 +0100)]
test-fs-util: Add relative path chase_symlinks() tests
Zbigniew Jędrzejewski-Szmek [Tue, 6 Dec 2022 16:10:54 +0000 (17:10 +0100)]
Merge pull request #25616 from poettering/chase-symlinks-opendir
chase-symlinks/systemctl: let's handle cases without /proc/ better
Lennart Poettering [Wed, 30 Nov 2022 17:55:40 +0000 (18:55 +0100)]
gpt: add helpers for deriving data partition from verity or verity sig designator
let's add the inverse of the existing partition_verity_of() and
partition_verity_sig_of()
Frantisek Sumsal [Tue, 6 Dec 2022 15:22:08 +0000 (15:22 +0000)]
Merge pull request #25644 from yuwata/escape-fix-octescape
escape: fix octescape()
Yu Watanabe [Tue, 22 Nov 2022 04:03:55 +0000 (13:03 +0900)]
network: drop REMOVING flag when a netlink message is sent to kernel
When an interface goes to down, the kernel drops several routes
automatically, and at the same time networkd requests to remove
them, but the kernel sometimes does not respond the requests. Hence,
the routes cannot drop the REMOVING flag, and networkd will never try
to configure other routes which depend on the previously removed
routes even if they are already reconfigured.
With this patch, when networkd sends a request to configure a route
(or any other network settings), REMOVING flag for the route is dropped
without waiting for the reply about the previous remove request, as we
can expect it will appear even if it is already removed or under removing.
Fixes #24999.
Luca Boccassi [Tue, 6 Dec 2022 15:00:10 +0000 (16:00 +0100)]
Merge pull request #25645 from yuwata/boot-fix-false-maybe-uninitialized
boot: fix false maybe-uninitialized warning
Aidan Dang [Sat, 3 Dec 2022 15:26:13 +0000 (02:26 +1100)]
Implement --luks-pbkdf-force-iterations for homed
Zbigniew Jędrzejewski-Szmek [Tue, 6 Dec 2022 10:16:57 +0000 (11:16 +0100)]
man: reword sentence
"Such as … suchlike" repeats too much.
Zbigniew Jędrzejewski-Szmek [Wed, 30 Nov 2022 08:25:49 +0000 (09:25 +0100)]
meson: build a standalone version of systemd-shutdown
I'd like to use this as a basis for an exitrd:
When compiled with -Dstandalone-binaries=true -Db_lto=true -Dbuildtype=release,
the new file is 800k. It's more than I'd like, but still quite a bit less
than libsystemd-shared.so, which is 3800k.
Zbigniew Jędrzejewski-Szmek [Wed, 30 Nov 2022 07:41:13 +0000 (08:41 +0100)]
test: do the --help/--version checks for repart.standalone too
Jian Zhang [Mon, 5 Dec 2022 10:38:00 +0000 (18:38 +0800)]
test-network: add test for bond mac address config
Signed-off-by: Jian Zhang <zhangjian.3032@bytedance.com>
Yu Watanabe [Tue, 6 Dec 2022 05:05:35 +0000 (14:05 +0900)]
Merge pull request #25559 from intelfx/work/systemd-importd-quotas
import: wire up SYSTEMD_IMPORT_BTRFS_{SUBVOL,QUOTA} to importd
Yu Watanabe [Tue, 6 Dec 2022 03:57:43 +0000 (12:57 +0900)]
boot: fix false maybe-uninitialized warning
Fixes #25641.
Yu Watanabe [Tue, 6 Dec 2022 04:06:57 +0000 (13:06 +0900)]
boot: cleanups for efivar_get() and friends
- rename function arguments for storing results, and support the case
that they are NULL,
- return earlier on error,
- always validate read size in efivar_get_uint32_le() and efivar_get_uint64_le().
Lennart Poettering [Fri, 2 Dec 2022 14:02:44 +0000 (15:02 +0100)]
dissect: show color in log output