1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-06 13:17:44 +03:00
Commit Graph

50466 Commits

Author SHA1 Message Date
Yu Watanabe
a73f8e9f32 network: do not emit changed properties when bus connection is not ready
Prompted by #19212.
2021-04-08 14:48:46 +02:00
Yu Watanabe
ecb4b08c2e test: move check of nat table existence
As test_v4() with iptables backend will be called after nftables tests.

Follow-up for afbcd90552.
2021-04-08 14:39:53 +02:00
Zbigniew Jędrzejewski-Szmek
2fe2941646
Merge pull request #19237 from yuwata/udev-builtin-net-id-follow-ups-for-19017
udev: fix several issues around hotplug slot detection
2021-04-08 14:37:02 +02:00
Zbigniew Jędrzejewski-Szmek
71d1e58309 core: fix memleak of ipc_namespace_path
Fixup for a70581ffb5.
Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32991
2021-04-07 22:12:50 +01:00
Luca Boccassi
7f8225d21b
Merge pull request #19231 from bluca/coredump_decode
coredump: follow-ups for #19135
2021-04-07 22:06:26 +01:00
Yu Watanabe
cb8c948738 udev: use snprintf_ok() 2021-04-08 01:38:47 +09:00
Yu Watanabe
5a6e56ec17 udev: fix potential infinite loop 2021-04-08 01:38:47 +09:00
Yu Watanabe
19ed9a114c udev: make dev_pci_slot() return earlier when PCI bridge is found 2021-04-08 01:38:47 +09:00
Yu Watanabe
c304cb0146 udev: use uint32_t for hotplug_slot
This also makes function id is parsed as uint64_t. Kernel internally
uses uint32_t for function id (see the definition of 'struct zpci_dev),
but it maybe extended in the future.
2021-04-08 01:38:43 +09:00
Yu Watanabe
fa28023c0f udev: split out logic of parsing s390 PCI slots
This also adds several debugging logs.
2021-04-08 01:35:43 +09:00
Yu Watanabe
70c35e4bfd udev: it is not necessary that the path is readable 2021-04-08 01:35:43 +09:00
Yu Watanabe
b08c3fbe0e udev: add missing initialization to fix freeing invalid address 2021-04-08 01:35:43 +09:00
Lennart Poettering
7211773a55 mkosi: work-around to make systemd build in Fedora images that lack populated /etc
On Fedora /usr/bin/ld is a symlink managed via the "alternatives"
system. This unfortunately means the binary is not usable in
environments where /var or /etc are unpopulated. Let's address this by
redirecting "ld" to "ld.bfd" manually if such an environment is
detected, via $PATH.

This is useful for building systemd in mkosi with UsrOnly=1 set.
2021-04-07 17:45:28 +02:00
Lennart Poettering
d997861ea7 proc-cmdline: allow backslash escapes when parsing /proc/cmdline
So far when parsing /proc/cmdline we'd consider backslashes as
mechanisms for escaping whitepace or quotes. This changes things so that
they are retained as they are instead. The kernel itself doesn't allow such
escaping, and hence we shouldn't do so either (see lib/cmdline.c in the
kernel sources; it does support "" quotes btw).

This fix is useful to allow specifying backslash escapes in the "root="
cmdline option to be passed through to systemd-fstab-generator. Example:

    root=/dev/disk/by-partlabel/Root\x20Partition

Previously we'd eat up the "\" so that we'd then look for a device
/dev/disk/by-partlabel/Rootx20Partition which never shows up.
2021-04-07 16:19:35 +02:00
Luca Boccassi
81e01cf809 coredump: update and shorten package metadata keys
Follow-up for a7ea0a460b
2021-04-07 14:04:04 +01:00
Luca Boccassi
289784a798 coredump: use path_equal_filename helper 2021-04-07 14:03:49 +01:00
Luca Boccassi
727e63e33e basic: add path_equal_filename helper 2021-04-07 14:03:49 +01:00
Luca Boccassi
b7ddd44497 coredumpctl: fetch JSON object by key instead of iterating
Follow-up for d1b5a0c691
2021-04-07 14:03:49 +01:00
Luca Boccassi
1f2abb791e coredump: fetch JSON object by key instead of iterating
Follow-up for c546154a44
2021-04-07 14:03:48 +01:00
Luca Boccassi
671769c932 coredump: rename COREDUMP_PKGMETA_ fields to COREDUMP_PACKAGE_
Follow-up for c546154a44
2021-04-07 14:02:38 +01:00
Luca Boccassi
f216e74841 coredump: use JSON helpers instead of creating objects manually
Follow-up for 95f7180773
2021-04-07 14:02:38 +01:00
Luca Boccassi
9b7205f5dd coredump: fix style nits
Follow-up for 95f7180773
2021-04-07 14:02:38 +01:00
Luca Boccassi
26c22c84e0 coredump: use set_put_strdup()
Follow-up for 95f7180773
2021-04-07 14:02:38 +01:00
Luca Boccassi
2c173dbf1b coredump: fix typo
Follow-up for 95f7180773
2021-04-07 14:02:38 +01:00
Morten Linderud
29d898cc7b man/systemd-cryptenroll: Fix sd-boot manvolnum from 8 to 7
Off-by-one error in the documentation index. The volume number for
systemd-boot/sd-boot is 7.

Signed-off-by: Morten Linderud <morten@linderud.pw>
2021-04-07 13:57:33 +02:00
Luca Boccassi
65d09d575c Bump test-random-util timeout
It is using log_trace, which we enabled in the CI, so now it's
slower and it is timing out. Bump the timeout from 30s to 120s.
2021-04-07 09:32:42 +02:00
Zbigniew Jędrzejewski-Szmek
3e3ab11b9e
Merge pull request #19135 from bluca/coredump_decode
coredump: parse build-id and .note.package
2021-04-07 07:41:16 +02:00
Luca Boccassi
a7ea0a460b Add markdown doc about coredump package metadata 2021-04-06 23:12:51 +01:00
Luca Boccassi
d1b5a0c691 coredumpctl: parse and print package metadata 2021-04-06 23:12:51 +01:00
Luca Boccassi
c546154a44 coredump: parse and append package metadata to journal message
Append 'package' and 'packageVersion' to the journal as discrete fields
COREDUMP_PKGMETA_PACKAGE and COREDUMP_PKGMETA_PACKAGEVERSION respectively,
and the full json blurb as COREDUMP_PKGMETA_JSON.
2021-04-06 23:12:51 +01:00
Luca Boccassi
95f7180773 coredump: parse .note.package ELF section
Parse the .note.package ELF section for each ELF object
contained in a core file, if present.
2021-04-06 22:53:54 +01:00
Luca Boccassi
965e095546 coredump: parse build-id out of core file
Parse the build-id of each ELF object contained in the core file
using the elfutils' libdwfl interface.
Add it to the journal.
2021-04-06 22:52:48 +01:00
Luca Boccassi
ee579e6454
Merge pull request #19215 from braewoods/main
hwdb: 60-keyboard:: Add quirks for 2 new HP laptops
2021-04-06 18:52:11 +01:00
Lennart Poettering
1b30720c1b tpm2-util: properly load tpm2 libraries befre unsealing
We forgot a call to dlopen_tpm2() in the unseal codepaths. As long as
automatic TPM2 device discovery was used that didn't matter, since in
that codepaths we'd have another call dlopen_tpm2(). But with an
explicitly configured TPM2 device things should work too, hence add the
missing call.

Fixes: #19206
2021-04-06 18:43:24 +02:00
Lennart Poettering
ff2cf6f8fe recovery-key: add some extra asserts
Let's ensure our key sizes calculations are correct.

This doesn't actually change anything, just adds more safety checks.
Inspired by #19203, but not a fix.
2021-04-06 18:42:30 +02:00
KoyamaSohei
da846b3031 resolve: copy rd flag from the query to response 2021-04-06 17:00:29 +02:00
Sibo Dong
f34173a048 bash-completion: localize words and cword variables
The words and cword variables are not localized in all Bash completion
scripts that call _init_completion.

cur, prev, words, and cword (and split if using the -s flag) are all
variables that should be localized in Bash completion scripts before
calling _init_completion (even if they don't otherwise appear in the
calling script). This is done for cur and prev, but not for words and
cword. Letting words and cword remain unlocalized may clobber variables
the user is using for other purposes, which is bad.

This issue can be resolved by declaring words and cword as local
variables.

Resolves #19188.
2021-04-06 16:15:13 +02:00
Luca Boccassi
7c20dd4b6e sysusers/firstboot: temporarily disable LoadCredential
Single-param LoadCredential= in units causes systemd v247/v248 to
assert when parsing. Disable it for now, until the fix is merged
in the stable trees, released and available (eg: in Debian
for the CI)

See: https://github.com/systemd/systemd/issues/19178
2021-04-06 12:02:42 +02:00
Lennart Poettering
f3e58b55de update 2021-04-06 11:48:37 +02:00
James Buren
5f6e4dc4f4 hwdb: 60-keyboard:: Add HP ProBook 455 G5 hotkey quirks
This enables all of the known hotkeys that were not working out of the
box on my test unit.
2021-04-06 02:18:26 -05:00
James Buren
98fa828f60 hwdb: 60-keyboard:: Add HP mt44 Mobile Thin Client hotkey quirks
This enables all of the known hotkeys that were not working out of the
box on my test unit.
2021-04-06 01:32:37 -05:00
Gibeom Gwon
fd11201b93 qrcode-util: set case-sensitive for generating QR codes
Until now, string treated case-insensitive, always converted to
uppercase. This can cause confusion such as user enter uppercased
recovery key.
2021-04-06 08:08:01 +02:00
Anita Zhang
afbcd90552 test-firewall-util: skip if iptables nat table does not exist 2021-04-06 08:01:27 +02:00
Zbigniew Jędrzejewski-Szmek
9d5ae3a121
Merge pull request #19126 from anitazha/oomdimprovements
systemd-oomd post-test week improvements
2021-04-06 07:59:59 +02:00
Frantisek Sumsal
34fde9f898 test: check if the unit file fuzzer corpora is up to date
This follows a similar pattern we already have in place for
networkd-related directives.
2021-04-05 14:41:05 +01:00
Anita Zhang
685b0985f0 oomd: threshold swap kill candidates to usages of more than 5%
In some instances, particularly with swap on zram, swap used will be high
while there is still a lot of memory available. FB OOMD handles this by
thresholding kills to X% of total swap usage. Let's do the same thing here.

Anecdotally with these thresholds and my laptop which is exclusively swap
on zram I can sit at 0K / 4G swap free with most of memory free and
systemd-oomd doesn't kill anything.

Partially addresses aggressive kill behavior from
https://bugzilla.redhat.com/show_bug.cgi?id=1941170
2021-04-05 02:04:49 -07:00
Anita Zhang
cb13961ada oomd: don't get pressure candidates on every interval
Only start collecting candidates for a memory pressure kill when we're
hitting the limit (but before the duration hitting that limit is
exceeded). This brings CPU util from ~1% to 0.3%.

Addresses CPU util from
https://bugzilla.redhat.com/show_bug.cgi?id=1941340
and
https://bugzilla.redhat.com/show_bug.cgi?id=1944646
2021-04-05 02:01:32 -07:00
Frantisek Sumsal
080a602771 fuzzer: add a test case for #19178 2021-04-03 10:38:06 +01:00
Luca Boccassi
1270e56526
Merge pull request #19179 from anitazha/buildandtest
test-oomd-util: fix running in mkosi
2021-04-02 17:56:13 +01:00
Viktor Mihajlovski
a496a238e8 udev: fix slot based network names on s390
The s390 PCI driver assigns the hotplug slot name from the
function_id attribute of the PCI device using a 8 char hexadecimal
format to match the underlying firmware/hypervisor notation.

Further, there's always a one-to-one mapping between a PCI
function and a hotplug slot, as individual functions can
hot plugged even for multi-function devices.

As the generic matching code will always try to parse the slot
name in /sys/bus/pci/slots as a positive decimal number, either
a wrong value might be produced for ID_NET_NAME_SLOT if
the slot name consists of decimal numbers only, or none at all
if a character in the range from 'a' to 'f' is encountered.

Additionally, the generic code assumes that two interfaces
share a hotplug slot, if they differ only in the function part
of the PCI address. E.g., for an interface with the PCI address
dddd:bb:aa.f, it will match the device to the first slot with
an address dddd:bb:aa. As more than one slot may have this address
for the s390 PCI driver, the wrong slot may be selected.

To resolve this we're adding a new naming schema version with the
flag NAMING_SLOT_FUNCTION_ID, which enables the correct matching
of hotplug slots if the device has an attribute named function_id.
The ID_NET_NAME_SLOT property will only be produced if there's
a file /sys/bus/pci/slots/<slotname> where <slotname> matches
the value of /sys/bus/pci/devices/.../function_id in 8 char
hex notation.

Fixes #19016
See also #19078
2021-04-02 18:08:23 +02:00