1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-04 21:47:31 +03:00

55474 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
0d75a90bb6 network: split out neighbor_configure_message(), simplify logging 2022-01-05 11:45:16 +01:00
Zbigniew Jędrzejewski-Szmek
f2b78e0e91 network: split out dhcp4_pd_create_6rd_tunnel_message(), simplify logging 2022-01-05 11:45:16 +01:00
Zbigniew Jędrzejewski-Szmek
51762897c6 network: adjust log message about MACsec associations 2022-01-05 11:45:11 +01:00
Zbigniew Jędrzejewski-Szmek
9e369704a8 network: simplify logging in macsec netdev code 2022-01-05 11:43:36 +01:00
Zbigniew Jędrzejewski-Szmek
b471fc9456 network: simplify logging in l2tp_create_session() and l2tp_create_tunnel()
All the detailed logging is replaced by a simple "Failed to create netlink message",
which should be enough for the user in the unlikely case that this ever fails.
2022-01-05 11:43:36 +01:00
Zbigniew Jędrzejewski-Szmek
bb2f88ff7b network: split out link_configure_fill_message(), simplify logging 2022-01-05 11:43:36 +01:00
Zbigniew Jędrzejewski-Szmek
9a93dabc40 network: move logging from can_set_netlink_message() to the caller 2022-01-05 11:43:36 +01:00
Zbigniew Jędrzejewski-Szmek
2a3cca04c4 network: de-duplicate logging in bridge_vlan_append_info() and the caller
The remaining message is changed, because the user would most likely not
understand that "append VLANs" is just talking about the netlink message.
2022-01-05 11:43:36 +01:00
Zbigniew Jędrzejewski-Szmek
eff692502b network: move logging from ipoib_set_netlink_message() to the caller 2022-01-05 11:43:28 +01:00
Zbigniew Jędrzejewski-Szmek
2f64865b0e network: split out netdev_fill_fou_tunnel_message(), simplify logging 2022-01-05 11:41:29 +01:00
Zbigniew Jędrzejewski-Szmek
0c50cb50bd network: split out netdev_create_message(), simplify logging 2022-01-05 11:41:29 +01:00
Zbigniew Jędrzejewski-Szmek
81f01be0b8 network: replace more detailed netlink append messages
Some refactoring was needed here to avoid duplicate messages.
Some select-and-paste errors were fixed on the way.

systemd-networkd is thinner by 8k.
2022-01-05 11:41:29 +01:00
Zbigniew Jędrzejewski-Szmek
d15cba9647 network: use SYNTHETIC_ERRNO in one more place 2022-01-05 11:41:29 +01:00
Zbigniew Jędrzejewski-Szmek
5b80ecea55 network: replace detailed netlink append messages with a single generic message
This commit is the first in the series, and they generally follow the same
idea: we had very detailed logging for message append operations which would
only fail either with some type error or intrinsic limit (and then they would
fail everywhere, so this would be noticed during development or in CI), or they
would fail with ENOMEM, in which case the exact location is not very interesting
since this is not repeatable.

I am in general in favour of detailed logging messages, because it helps with
diagnosis of errors, but I think case is an exception. Despite not being very
useful, those messages required a lot of effort, because they were customized
for each and every append operation. In fact some of the messages contained copy
errors. The text of the messages (since they are generally unique) also added up
to a considerable size.

This removes the log messages after each sd_netlink_message_append_*() in
fill_message_create() with a single line in netdev_create(). As described
above, we are just appending fields to a message, so those calls would almost
never fail.

A forgotten 'return' was added in one place.

$ size build/systemd-networkd{.0,}
   text	   data	    bss	    dec	    hex	filename
1878634	 394016	     36	2272686	 22adae	build/systemd-networkd.0
1842450	 394080	     36	2236566	 222096	build/systemd-networkd

… so we save 30k too.
2022-01-05 11:36:04 +01:00
Evgeny Vereshchagin
5df66d7d68 fuzz: no longer skip empty files
Empty files and empty strings seem to have triggered various
issues in the past so it seems they shouldn't be ignore by the
fuzzers just because fmemopen can't handle them.

Prompted by https://github.com/systemd/systemd/pull/21939#issuecomment-1003113669
2022-01-04 09:26:26 +01:00
Weblate
bb18c742c8 po: Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/
Translation: systemd/main
2022-01-04 14:56:20 +09:00
Zbigniew Jędrzejewski-Szmek
e897b07f97 meson: generate better arch defines for clang bpf compilation
The code assume that meson's cpu_family can be mapped directly to
'-D__<cpu_family>__'. This works in a surprising number of cases, but not for a
few architectures. PPC uses "powerpc", and RISC-V omits the trailing underscores.
ARM and RISC-V require a second define too.

Fixes #21900.

(I don't think this matters too much: we need *something* so that gnu/stubs.h
can be successfully included. But we don't actually call syscalls or depend too
much on the host environment, so things should be fine as long as we don't get
a compilation error.)
2022-01-04 00:18:47 +00:00
Luca Boccassi
c9b1efdf14
Merge pull request #21990 from keszybz/indentation-and-comments
Indentation and comments
2022-01-04 00:18:10 +00:00
Zbigniew Jędrzejewski-Szmek
5f74fcd41c basic/log: allow errno values higher than 255
When the support for "synthetic errno" was added, we started truncating
the errno value to just the least significant byte. This is generally OK,
because errno values are defined up to ~130.

The docs don't really say what the maximum value is. But at least in principle
higher values could be added in the future. So let's stop truncating
the values needlessly.

The kernel (or libbpf?) have an error where they return 524 as an errno
value (https://bugzilla.redhat.com/show_bug.cgi?id=2036145). We would
confusingly truncate this to 12 (ENOMEM). It seems much nicer to let
strerror() give us "Unknown error 524" rather than to print the bogus
message about ENOMEM.
2022-01-03 22:46:32 +00:00
Zbigniew Jędrzejewski-Szmek
c790632cab coredump: do not crash if we failed to acquire exe path
The COREDUMP_EXE attribute is "optional", i.e. we continue to process the
crash even if we didn't acquire it. The coredump generation code assumed
that it is always available:

 #5 endswith at ../src/fundamental/string-util-fundamental.c:41
 [ endswith() is called with NULL here, and an assertion fails. ]
 #6 submit_coredump at ../src/coredump/coredump.c:823
 #7 process_socket at ../src/coredump/coredump.c:1038
 #8 run at ../src/coredump/coredump.c:1413

We use the exe path for loop detection, and also (ultimately) pass it to
dwfl_core_file_report(). The latter seems to be fine will NULL, so let's just
change our code to look at COMM, which should be more reliable anyway.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2036517.
2022-01-03 22:44:44 +00:00
Luca Boccassi
73dfeb0c6e
Merge pull request #21985 from yuwata/elf-util-cleanups
elf-util: several cleanups
2022-01-03 22:44:20 +00:00
Zbigniew Jędrzejewski-Szmek
acee2a2553 po: drop Project-Id-Version from header template
Since they were pretty inconsistent anyway, let's assume that they
don't matter.
2022-01-03 21:19:20 +01:00
Zbigniew Jędrzejewski-Szmek
b36c5e9587 various: fix three spelling issues found by fossies 2022-01-03 21:16:06 +01:00
Zbigniew Jędrzejewski-Szmek
df1f621bda docs: update branch names
Also use --atomic when pushing multiple items with git;
adjust some external URLs.
2022-01-03 21:15:21 +01:00
Yu Watanabe
633c3e8aa2 coredump: drop unnecessary parentheses 2022-01-04 04:27:11 +09:00
Yu Watanabe
80b241f2ec elf-util: add missing assertion 2022-01-04 04:27:11 +09:00
Yu Watanabe
fe8fdc4760 elf-util: reduce variable scope 2022-01-04 04:27:11 +09:00
Yu Watanabe
d090049c01 elf-util: executable argument for parse_elf() may be NULL
Fixes assertion triggered by parse_package_metadata() and json_build().
2022-01-04 04:27:09 +09:00
Yu Watanabe
3876cfafd0 elf-util: reduce variable scope and indentation 2022-01-04 04:11:55 +09:00
Yu Watanabe
e794bcaf1c elf-util: reduce variable scope and indentation 2022-01-04 04:11:55 +09:00
Zbigniew Jędrzejewski-Szmek
e97a300148
Merge pull request #21941 from yuwata/hostname-handle-empty
hostname-setup: support kernel with empty CONFIG_DEFAULT_HOSTNAME
2022-01-03 19:56:57 +01:00
Jan Janssen
8fb16fee96 boot: Do not warn if an initializing driver returns EFI_ABORTED
Fixes: #21965
2022-01-03 19:42:36 +01:00
Zbigniew Jędrzejewski-Szmek
3c7af1af7d basic: adjust wording and wrapping of comments 2022-01-03 19:18:55 +01:00
Zbigniew Jędrzejewski-Szmek
606309d554 test-bpf-lsm: drop some parens 2022-01-03 19:18:55 +01:00
Zbigniew Jędrzejewski-Szmek
333cf6c6ae test-job-type: modernize code a bit 2022-01-03 19:18:55 +01:00
Zbigniew Jędrzejewski-Szmek
b7cba81553 core/bpf: tighten handling of return values, improve messages
The code was written unidiomatically, using r as a boolean value, and
confusing errno and r in some places. AFAICS, there wasn't any actual
problem: even in the one place where errno was used instead of r, it would
almost certainly be initialized.

It seems that some libbpf functions set errno, while others return the
error, possibly encoded. Since there are almost no docs, the only way to
know is to read the code of the function. To make matters worse, there is
a global libbpf_mode which can be set to change the convention. With
LIBBPF_STRICT_DIRECT_ERRS in libbpf_mode, some functions set errno while others
return a negative error, and the only way to know is to read the code, except
that the split is now different. We currently don't set
LIBBPF_STRICT_DIRECT_ERRS, but even the possibility makes everything harder
to grok.

This is all very error-prone. Let's at least add some asserts to make sure that
the returned values are as expected.
2022-01-03 19:18:55 +01:00
Zbigniew Jędrzejewski-Szmek
92698b0f9e core/bpf: avoid unnecessary initialization of variables, tighten scope
No funtional change.
2022-01-03 19:18:55 +01:00
Zbigniew Jędrzejewski-Szmek
7185af6234
Merge pull request #21970 from yuwata/seccomp-util-fix-build
seccomp-util: fix build failure
2022-01-03 16:44:10 +01:00
Frantisek Sumsal
3fd864aea7 ci: bump mkosi to v12 with libsolv workaround
Replaces: https://github.com/systemd/systemd/pull/21574
Related:
    * https://github.com/systemd/mkosi/issues/861
    * https://github.com/systemd/mkosi/pull/878
2022-01-03 15:56:22 +03:00
Evgeny Vereshchagin
019c84938d
Merge pull request #21960 from medhefgo/boot-gap
boot: Use objcopy to align sections
2022-01-03 02:35:15 +03:00
Yu Watanabe
e83156c264 seccomp-util: include missing_syscall_def.h to make __SNR_foo mapped to __NR_foo
Fixes #21969.
2022-01-03 06:25:07 +09:00
Yu Watanabe
63e10c0cd3
Merge pull request #21944 from yuwata/nss-systemd-fix-pointer
nss-systemd: fix pointer calculation
2022-01-03 05:32:05 +09:00
Jan Janssen
bbbf1c3d32 ci: Test efi binaries for section table gaps 2022-01-02 20:05:58 +01:00
Jan Janssen
75747c8a39 boot: Use objcopy to align sections
Not aligning these can create gaps in the section table. Some
firmware does not handle this nicely resulting in secure boot
signature fails.
Using objcopy ensures that any new sections in the future will be
properly aligned.

Fixes: #21956
2022-01-02 19:58:56 +01:00
Yu Watanabe
d96ad9e8cb missing-syscall: add __NR_openat2 2022-01-03 03:48:37 +09:00
Yu Watanabe
0c718b1a67 syscalls: update syscall definitions 2022-01-03 03:48:37 +09:00
Yu Watanabe
3c80c7bacf
Merge pull request #21928 from medhefgo/boot-meson
meson: Boot
2022-01-02 23:40:46 +09:00
Jan Janssen
d9fd84fc5d boot: Add disabled secure boot mode without setup mode 2022-01-02 23:31:23 +09:00
Marco Scardovi
7bd3d6e35a make HP 15s-eq0xxx changes specific to sku9MG38EA#ABZ
Signed-Off-By: Marco Scardovi <marco@scardovi.com>
2022-01-02 12:22:07 +00:00
Frantisek Sumsal
3b5816ba33
Merge pull request #21915 from evverx/fuzz-bcd
tests: add fuzz-bcd
2022-01-02 10:05:13 +00:00