1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-25 06:03:40 +03:00

54941 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
4b658ff651
Merge pull request #21531 from keszybz/log2-tables
Optimize log2 tables
2021-11-29 13:58:49 +01:00
Zbigniew Jędrzejewski-Szmek
1e135e9780
Merge pull request #21537 from medhefgo/boot-sbat
meson: Default to sbat-distro=auto
2021-11-29 11:30:25 +01:00
Luca Boccassi
c0775eb787 coredump: fix parsing metadata without access to executable
This was broken in a subtle way: we'd get an ELF ref, but not the right one,
so no metadata note would be found.
Change the parsing function to return 1 when it finds something, so that
we can return early only when that happens.
2021-11-29 11:25:48 +01:00
Zbigniew Jędrzejewski-Szmek
48c67fdfb1 meson: upgrade warning about bad init values to an error
We never expect to get this warning, it is most likely to occur if
somebody messes up enumeration values.
2021-11-29 11:16:23 +01:00
Zbigniew Jędrzejewski-Szmek
8a7da94082 networkd: replace a table with log2 fields by a list 2021-11-29 11:16:15 +01:00
Zbigniew Jędrzejewski-Szmek
0580badc15 networkd: align table 2021-11-29 11:16:07 +01:00
Zbigniew Jędrzejewski-Szmek
19aa7eeb6c networkd: replace a table with log2 fields by a list 2021-11-29 11:15:58 +01:00
Zbigniew Jędrzejewski-Szmek
7396e01484 networkd: replace a table with log2 fields by a list 2021-11-29 11:15:50 +01:00
Zbigniew Jędrzejewski-Szmek
67b65e1104 networkd: replace a table with log2 fields by a list
The code looks a bit more complicated, but the compiler generates a simpler and
more compact text.

An additional advantage is that if any of the fields were repeating or not
power-of-two, the compiler would warn about an overridden entry in the table.
2021-11-29 11:15:31 +01:00
Zbigniew Jędrzejewski-Szmek
f4ada1b42f basic/util: add macro variants of log2 functions
The macro variants can be used in static initializers.

The same guard against calling __builtin_clz(0) is added as for
__builtin_clzll(0), since that's undefined behaviour too. Our code
wouldn't call it, but this avoids a potential pitfall with the macro.
All variants map 0→0. Otherwise we'd often have to handle 0 specially
in callers.

__builtin_clz takes unsigned as the argument, so there's no LOG2I macro.
2021-11-29 11:12:52 +01:00
Topi Miettinen
ddf127cda4 pam_systemd: Check also abstract socket for X11
It seems that `pam_systemd` was the only thing left that wanted to use sockets
in file system path `/tmp/.X11-unix/X*`. X11 apps actually prefer using the
abstract socket version.

This allows running Xserver with `-nolisten tcp -nolisten unix`, which makes
the server only listen to an abstract socket.

Also in my setup, Xserver is running as a separate system service instead of
starting from display manager service, and now `PrivateTmp=yes` can be used for
both. The file system of the display manager service is inherited by user apps
and now their `/tmp` will be separate from `/tmp` of PID1 namespace as well as
`/tmp` of Xserver.
2021-11-28 18:24:39 +00:00
Jan Janssen
52ccce6ac5 meson: Rename compile_args to efi_cfalgs
compile_args sounds like it could be used for other targets besides
efi binaries. This also keeps the name in line with efi_ldflags.
2021-11-28 16:22:15 +01:00
Jan Janssen
252b6b1bfd meson: Default to sbat-distro=auto
Any recent shim will refuse starting an image that does not have an sbat section
and will do so with a generic "Security Violation" message. And it is very easy
to forget passing -Dsbat-distro=auto to meson when creating a fresh build dir.

Adding sbat info when shim is not used or secure boot is disabled does not hurt
anyone, so default to auto. This still ensures to not add auto-detected info in
case we are cross building.
2021-11-28 16:20:54 +01:00
Luca Boccassi
64a05587ce
Merge pull request #21549 from yuwata/network-netdev-mac-address-none
network: netdev: make MACAddress= take 'none'
2021-11-28 12:36:35 +00:00
Jan Janssen
5a45a6bbb6 test-parse-util: Add SI-suffix parse_size tests 2021-11-28 11:48:34 +01:00
Jan Janssen
d19bff65ee test-namespace: Convert to TEST macro 2021-11-28 11:48:34 +01:00
Jan Janssen
353b980204 test-barrier: Convert to TEST macro 2021-11-28 11:48:34 +01:00
Jan Janssen
26e555cbba test: Convert to TEST/TEST_RET macros
Note that test-cgroup-mask, test-cgroup-unit-default and test-unit-name will now
report being skipped instead of reporting success if not run under systemd.
2021-11-28 11:46:26 +01:00
Jan Janssen
0578dfe3eb test: Add sd_booted condition test to TEST macro
Note that this will only report test skips if they use TEST_RET macro.
Regular TEST macros can still be skipped, but this will not be reported
back to main();
2021-11-28 11:42:28 +01:00
Jan Janssen
4c0acc0761 test: Add TEST_RET macro
This declares a test function whose return code will be passed from
main(). The first test that does not return EXIT_SUCCESS wins.
2021-11-28 11:40:45 +01:00
Yu Watanabe
5b8bdd20c6 network/netdev: generate persistent MAC address for batadv and bridge
This mostly reverts 489f01f806f865eabb55458c98182b06a6c53a62 and
deb2cfa4c6885d448eb1f17e5ef1b139106b7e86.

As now MACAddress=none is supported. So, users can still disable MAC
address assignment.
2021-11-28 12:04:55 +09:00
Yu Watanabe
aaa5ca57ae network/netdev: make MACAddress= take 'none' to suppress generating persistent hardware address
This is mostly equivalent to .link file's MACAddressPolicy=none.
2021-11-28 12:04:55 +09:00
Yu Watanabe
5dcc5b1a11 network/netdev: move config_parse_netdev_kind() at the end 2021-11-28 12:04:55 +09:00
Topi Miettinen
788e720181 namespace: allow ProcSubset=pid with some ProtectKernel options
In case `/proc` is successfully mounted with pid tree subset only due to
`ProcSubset=pid`, the protective mounts for `ProtectKernelTunables=yes` and
`ProtectKernelLogs=yes` to non-pid `/proc` paths are failing because the paths
don't exist. But the pid only option may have failed gracefully (for example
because of ancient kernel), so let's try the mounts but it's not fatal if they
don't succeed.
2021-11-27 17:36:51 +00:00
Luca Boccassi
cab35e9672
Merge pull request #21535 from yuwata/network-netdev-verify-mac
network/netdev: verify MAC address
2021-11-27 13:48:56 +00:00
Yu Watanabe
70b0652697 network: route: route->link may be NULL
Fixes #21544.
2021-11-27 13:48:02 +00:00
Alyssa Ross
f000edf9ea docs: fix descriptions in discoverable partitions
00db9a114e ("docs: generate table from header using a script") got the
descriptions for the partition types mixed up.  After that change, the
spec claimed, for example, that the /usr partition should contain
"dm-verity integrity hash data for the matching root partition", and
that the /usr verity partition should be of type "Any native, optionally
in LUKS".  This made the spec an extremely confusing read before I
figured out what must have happened!

I've gone through the table as it existed prior to 00db9a114e, and moved
the descriptions around in the script that generates the table until
they matched up with what they used to be.  Then I regenerated the
table from the fixed script.
2021-11-27 13:46:35 +00:00
Yu Watanabe
f5caacec1c
Merge pull request #21533 from yuwata/network-trivial-follow-ups
network: trivial follow-ups
2021-11-27 06:42:19 +09:00
Yu Watanabe
e76d491c87
Merge pull request #21530 from keszybz/strv-cleanup
Modernize style and drop strv_free_free
2021-11-27 06:41:56 +09:00
Yu Watanabe
007899f43e network/netdev: verify specified MAC address
Drop multicast bit and set local bit of the specified MAC address.

This also makes failure in generating persistent MAC address
non-critical.
2021-11-27 06:39:04 +09:00
Yu Watanabe
5e20e1e3e3 network/netdev: use "struct hw_addr_data" to store MAC address 2021-11-27 06:39:04 +09:00
Yu Watanabe
9f0cf80dd0 network/netdev: introduce .iftype to netdev vtable
And disable .generate_mac flag for non-ether interfaces.
2021-11-27 06:38:26 +09:00
Yu Watanabe
a67e0507c3 network: veth: use SYNTHETIC_ERRNO() macro or use real error cause 2021-11-27 06:37:58 +09:00
Luca Boccassi
0446921131 analyze: add --profile switch to security verb
Allows to pass a portable profile when doing offline analysis of
units. Especially useful for analyzing portable images, since a
lot of the security-relevant settings in those cases come from
the profiles, but they are not shipped in the portable images.
2021-11-26 18:17:26 +00:00
Frantisek Sumsal
72f9e485ce test: create a dummy LSan suppression file in the minimal image
otherwise gcc's ASan complains (unlike clang's) when the image is used -
e.g. in TEST-29 or TEST-50.

```
[   17.328705] testsuite-29.sh[361]: + portablectl --profile=trusted attach --now --runtime /usr/share/minimal_0.raw app0
...
[   20.978649] systemd[1]: Starting app0-foo.service...
[   21.104844] kernel: loop0: detected capacity change from 0 to 24960
[   20.999559] systemd[1]: Starting app0.service...
[   21.126022] kernel: loop1: detected capacity change from 0 to 24960
...
[   21.861087] cat[422]: AddressSanitizer: failed to read suppressions file '/systemd-lsan.supp'
[   21.868634] cat[421]: AddressSanitizer: failed to read suppressions file '/systemd-lsan.supp'
[   21.877941] systemd[1]: app0.service: Control process exited, code=exited, status=1/FAILURE
[   21.878836] systemd[1]: app0.service: Failed with result 'exit-code'.
[   21.905712] systemd[1]: Failed to start app0.service.
```

Follow-up to f201f3447796a5424372d32b338bc3b907516c28.
2021-11-26 18:15:51 +00:00
Luca Boccassi
83de7427dc shell-completion: add offline/root/image to systemd-analyze 2021-11-26 18:08:59 +00:00
Luca Boccassi
13c02e7bd5 portable: move profile search helper to path-lookup
Will be used in systemd-analyze later
2021-11-26 17:50:59 +00:00
Zbigniew Jędrzejewski-Szmek
58c34be864 basic/util: rename u64log2 to log2u64
u64log2 was strangely named. We even have log2i and log2u right below
in that file.
2021-11-26 15:29:06 +01:00
Lennart Poettering
e6f48be8d4 update TODO 2021-11-26 15:18:59 +01:00
Zbigniew Jędrzejewski-Szmek
1ba193d73e basic/strv: drop strv_free_free
I think the function name is confusing: we generally say "free_free" when
both keys and values are freed in a hash map, but here the type is an
array of strvs, so the name should be something like strv_array_free.

The function is unused since 143fadf369a18449464956206226761e49be1928 (2018),
let's just drop it.
2021-11-26 14:58:44 +01:00
Zbigniew Jędrzejewski-Szmek
14337c374a basic/strv: inline variables and modernize style a bit 2021-11-26 14:52:03 +01:00
Lennart Poettering
f08e143c01 update TODO 2021-11-26 14:49:25 +01:00
Lennart Poettering
195d181ca4 NEWS: start with an entry for v250 2021-11-26 14:49:25 +01:00
Yu Watanabe
9e2b7763d3 udev/net: make MACAddress= takes hardware address for infiniband 2021-11-26 21:06:24 +09:00
Yu Watanabe
613701a4e8 udev/net: introduce "struct Link" to store link attributes 2021-11-26 21:06:24 +09:00
Yu Watanabe
418c02c3f1 udev/net: rename variables 2021-11-26 21:06:24 +09:00
Yu Watanabe
36edc2c956 network: update comment
Addresses https://github.com/systemd/systemd/pull/21517#discussion_r757096584.
2021-11-26 21:05:52 +09:00
Yu Watanabe
4bd2c4e8e0 netif-util: update log message
Follow-up for 37593b7c488f7b957936500158f200af16534c6b.
2021-11-26 21:05:52 +09:00
Zbigniew Jędrzejewski-Szmek
baef2ca347
Merge pull request #21529 from keszybz/test-journal-flush-no-crash
Fix crash in test-journal-flush in CI
2021-11-26 12:28:44 +01:00
Anita Zhang
ddc57d0a83 test: make test-55-oomd less flaky
Make oomctl a bit less likely to race with systemd-oomd receiving the
managed oom cgroup info by checking oomctl output in a loop with
timeout.

Fixes #21146
2021-11-26 12:27:30 +01:00