1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-26 14:04:03 +03:00

55518 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
1a37237e2f hwdb: fix check for uppercasedness of match patterns
The check was added in 77547d5313ea916d2fb64ca5a8812734e9b50f92, but
it doesn't work as expected. Because the second part is wrapped in Optional(),
it would silently "succeed" when the lowercase digits were in the second part:

>>> from parse_hwdb import *
>>> g = 'v' + upperhex_word(4) + Optional('p' + upperhex_word(4))
>>> g.parseString('v04D8pE11C*')
(['v', '04D8', 'p', 'E11C'], {})
>>> g.parseString('v04D8pe11c*')
(['v', '04D8'], {})

The following matches are OK:
usb:v0627p0001:*QEMU USB Keyboard*
usb:v0627p0001:*
usb:v0627p0001*
usb:v0627*
2022-01-04 11:04:33 +01:00
Yu Watanabe
1341f25b9b
Merge pull request #21778 from evverx/test-cifuzz
tests: run nss-{users|hosts} by default
2022-01-04 18:46:58 +09: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
Jan Janssen
7ffc4f4748 boot: Prevent stub command line editing under secure boot 2022-01-03 11:29:49 +01:00
Jan Janssen
fb90100cf0 boot: Unify idx type handling
This replaces several inconsistent use of types and unsound
signed comparisons.
The added max entry count is just for paranoia. Anyone with that
many boot entries deserves a medal.
2022-01-03 10:41:45 +01:00
Jan Janssen
159636cf74 boot: Convert goto into loop 2022-01-03 10:20:23 +01:00
Jan Janssen
0b2281a209 boot: Rename cleanup functions 2022-01-03 10:15:24 +01:00
Evgeny Vereshchagin
951280ce99 tests: no longer load libnss_{files|dns}
Those libraries aren't provided by systemd so they shouldn't be
included here
2022-01-03 04:36:37 +00: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
Evgeny Vereshchagin
637ccd2fa4 tests: run nss-{users|hosts} by default
to prevent issues like https://github.com/systemd/systemd/issues/21935
by testing the code under ASan/UBSan
2022-01-02 20:37:59 +00: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
Jan Janssen
2f2b072267 meson: Get objcopy location from compiler 2022-01-02 10:18:26 +01:00
Jan Janssen
52adf0e91e meson: Remove efi-cc option
Changing the efi compiler this way doesn't really work. The gnu-efi
header checks as well as supported compiler flag checks use the
regular cc that meson detects. Changing the compiler this way will
end up with bad compiler flags. For the very same reason, this does
not work with a cross-compiler without going through proper meson
cross-compilation steps either.

The proper way to build systemd-boot with a different compiler is to
use a different build folder and then just use the proper ninja build
target to only build the bootloader/stub.
2022-01-02 10:18:26 +01:00
dependabot[bot]
b774de1883 build(deps): bump meson from 0.60.2 to 0.60.3 in /.github/workflows
Bumps [meson](https://github.com/mesonbuild/meson) from 0.60.2 to 0.60.3.
- [Release notes](https://github.com/mesonbuild/meson/releases)
- [Commits](https://github.com/mesonbuild/meson/compare/0.60.2...0.60.3)

---
updated-dependencies:
- dependency-name: meson
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-01 17:40:39 +03:00
Yu Watanabe
60e930fc3e udev: fix ID_NET_NAME_MAC= udev property
This fixes a bug introduced by eaba9bb3e69635d2c490c5e1b0d262b763753e1d.

The commit mistakenly drops 'x' in ID_NET_NAME_MAC, and adds colons.
The colons were dropped by the commit dfa4876c417e2a9935d58100d44d94bb41cd5bfb,
but the missing 'x' was not added at that time.

Follow-up for dfa4876c417e2a9935d58100d44d94bb41cd5bfb.
2021-12-31 13:21:12 +00:00
Yu Watanabe
92e9df9ca0 nss-myhostname: do not apply non-zero offset to null pointer
Fixes https://github.com/systemd/systemd/issues/21935#issuecomment-1003216503.
2021-12-31 09:13:03 +09:00
Yu Watanabe
420a35c1fa nss-systemd: fix alignment of gr_mem
Follow-up for 1e65eb8f9b7d567462030b2e625998d77677e636.

Fixes #21935.
2021-12-31 09:05:16 +09:00