]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agoudev/path-id: comment why USB host number is dropped from the PATH_ID 21620/head
Yu Watanabe [Mon, 6 Dec 2021 07:05:35 +0000 (16:05 +0900)] 
udev/path-id: comment why USB host number is dropped from the PATH_ID

Closes #21617.

The comment is borrowed from https://github.com/systemd/systemd/pull/21620#discussion_r762521508.

2 years agoudev/path_id: fix skip_subsystem()
Yu Watanabe [Sat, 4 Dec 2021 16:58:01 +0000 (01:58 +0900)] 
udev/path_id: fix skip_subsystem()

This partially reverts d340bdd1bd435e9f5524f4246feaf38511b2ff45.

The function previously drops multiple except for the last parents
which matches the specified subsystem.
But the commit d340bdd1bd435e9f5524f4246feaf38511b2ff45 drops all
parents.

E.g. input is pci-pci-pci-usb-usb-usb, then
Before d340bdd: pci-pci-pci-usb
After d340bdd: pci-pci-pci

2 years agotree-wide: check for NULLs in more places
Frantisek Sumsal [Sat, 4 Dec 2021 11:11:31 +0000 (12:11 +0100)] 
tree-wide: check for NULLs in more places

Fixes issues pointed out by the `cpp/inconsistent-null-check` LGTM
query.

2 years agoNEWS: add more entries for v250
Luca Boccassi [Sun, 5 Dec 2021 14:10:09 +0000 (14:10 +0000)] 
NEWS: add more entries for v250

2 years agoMerge pull request #21563 from yuwata/network-IPoIB-support
Yu Watanabe [Sat, 4 Dec 2021 20:24:01 +0000 (05:24 +0900)] 
Merge pull request #21563 from yuwata/network-IPoIB-support

network: IPoIB support

2 years agosd-netlink: fix implicit cast to boolean 21563/head
Yu Watanabe [Sat, 4 Dec 2021 06:27:53 +0000 (15:27 +0900)] 
sd-netlink: fix implicit cast to boolean

2 years agonetwork: set MTU after IPoIB configs are applied
Yu Watanabe [Mon, 8 Nov 2021 03:19:56 +0000 (12:19 +0900)] 
network: set MTU after IPoIB configs are applied

MTU is updated when IB mode is changed.

2 years agonetwork: add support to configure IPoIB interfaces
Yu Watanabe [Mon, 8 Nov 2021 00:41:51 +0000 (09:41 +0900)] 
network: add support to configure IPoIB interfaces

2 years agonetwork/netdev: add support to create IPoIB subinterface
Yu Watanabe [Sun, 7 Nov 2021 21:34:43 +0000 (06:34 +0900)] 
network/netdev: add support to create IPoIB subinterface

2 years agosd-netlink: add support for IPoIB
Yu Watanabe [Sun, 7 Nov 2021 21:43:17 +0000 (06:43 +0900)] 
sd-netlink: add support for IPoIB

2 years agonetwork/netdev: generate persistent MAC address when creating netdev interface
Yu Watanabe [Tue, 9 Nov 2021 06:51:58 +0000 (15:51 +0900)] 
network/netdev: generate persistent MAC address when creating netdev interface

Preparation for later commits.

2 years agoci: consider `cryptolib` in the group identifier
Frantisek Sumsal [Fri, 3 Dec 2021 16:07:34 +0000 (17:07 +0100)] 
ci: consider `cryptolib` in the group identifier

otherwise we end up with more than one job with the same identifier in
one run, causing some of them to get cancelled unexpectedly.

A quick follow-up to 85bd394df57fe45c2873605e2c1d1d79e83e853d.

2 years agoMerge pull request #21607 from mrc0mmand/ci-install-libbpf
Luca Boccassi [Fri, 3 Dec 2021 18:37:33 +0000 (18:37 +0000)] 
Merge pull request #21607 from mrc0mmand/ci-install-libbpf

ci: run build test with BPF-related stuff as well

2 years agoMerge pull request #21582 from mrc0mmand/lgtm-uninitialized
Luca Boccassi [Fri, 3 Dec 2021 18:25:19 +0000 (18:25 +0000)] 
Merge pull request #21582 from mrc0mmand/lgtm-uninitialized

lgtm: enable more queries

2 years agoci: install libbpf 21607/head
Frantisek Sumsal [Fri, 3 Dec 2021 15:30:56 +0000 (16:30 +0100)] 
ci: install libbpf

2 years agoanalyze: fix build with -Db_ndebug=true
Frantisek Sumsal [Fri, 3 Dec 2021 06:37:32 +0000 (07:37 +0100)] 
analyze: fix build with -Db_ndebug=true

2 years agomeson: support versioned llvm binaries in BPF detection
Frantisek Sumsal [Thu, 2 Dec 2021 20:49:02 +0000 (21:49 +0100)] 
meson: support versioned llvm binaries in BPF detection

2 years agoBump the max number of inodes for /dev to 128k
Franck Bui [Fri, 3 Dec 2021 10:23:36 +0000 (11:23 +0100)] 
Bump the max number of inodes for /dev to 128k

Follow-up for 7d85383edbab73274dc81cc888d884bb01070bc2.

Apparently the previous limit set on the max number of inodes for /dev was too
small as a system with 4096 LUNs attached can consume up to 95k inodes for
symlinks:

  # /bin/df -i
  Filesystem                 Inodes  IUsed    IFree IUse% Mounted on
  devtmpfs                 49274377  95075 49179302    1% /dev

Hence this patch bumps the limit from 64k to 128k although the new limit is
still pretty arbitrary (that said, not sure if it really makes sense to put
such absolute limit number).

2 years agoMerge pull request #21170 from keszybz/delibgcryptify
Zbigniew Jędrzejewski-Szmek [Fri, 3 Dec 2021 12:44:53 +0000 (13:44 +0100)] 
Merge pull request #21170 from keszybz/delibgcryptify

Allow systemd-resolved and systemd-importd to use libgcrypt or libopenssl

2 years agocryptenroll: fix wrong error messages
Gibeom Gwon [Fri, 3 Dec 2021 06:10:50 +0000 (15:10 +0900)] 
cryptenroll: fix wrong error messages

PKCS#11 -> FIDO2 in cryptenroll-fido2.c

2 years agoMerge pull request #21599 from loongarch64/dev-syscalls
Zbigniew Jędrzejewski-Szmek [Fri, 3 Dec 2021 07:11:31 +0000 (08:11 +0100)] 
Merge pull request #21599 from loongarch64/dev-syscalls

Add LoongArch 64bit syscalls

2 years agomeson: correctly display enabled features
Frantisek Sumsal [Thu, 2 Dec 2021 17:42:31 +0000 (18:42 +0100)] 
meson: correctly display enabled features

In 9cf75222f20 the conf.get() statements for `bpf-framework` and
`valgrind` were dropped, which causes the respective features to always
show as disabled (since they don't follow the "standard" naming scheme
with HAVE_/ENABLE_ prefixes).

2 years agolgtm: enable more (and potentially useful) queries 21582/head
Frantisek Sumsal [Tue, 30 Nov 2021 22:40:28 +0000 (23:40 +0100)] 
lgtm: enable more (and potentially useful) queries

Not all available queries on LGTM are enabled by default, but some of
the excluded ones might come in handy, hence let's enable them
explicitly.

2 years agolgtm: don't treat the custom note as a list of tags
Frantisek Sumsal [Thu, 2 Dec 2021 15:55:17 +0000 (16:55 +0100)] 
lgtm: don't treat the custom note as a list of tags

Just a cosmetic change.

2 years agolgtm: detect uninitialized variables using the __cleanup__ attribute
Frantisek Sumsal [Wed, 1 Dec 2021 20:31:43 +0000 (21:31 +0100)] 
lgtm: detect uninitialized variables using the __cleanup__ attribute

This is a slightly modified version of the original
`cpp/uninitialized-local` CodeQL query which focuses only on variables
using the cleanup macros. Since this has proven to cause issues in the
past, let's panic on every uninitialized variable using any of the
cleanup macros (as long as they're written using the __cleanup__
attribute).

Some test results from a test I used when writing the query:

```
 #define _cleanup_foo_ __attribute__((__cleanup__(foo)))
 #define _cleanup_(x) __attribute__((__cleanup__(x)))

 static inline void freep(void *p) {
         *(void**)p = mfree(*(void**) p);
 }

 #define _cleanup_free_ _cleanup_(freep)

 static inline void foo(char **p) {
     if (*p)
         *p = free(*p);
 }

 int main(void) {
     __attribute__((__cleanup__(foo))) char *a;
     char *b;
     _cleanup_foo_ char *c;
     char **d;
     _cleanup_free_ char *e;
     int r;

     r = fun(&e);
     if (r < 0)
         return 1;

     puts(a);
     puts(b);
     puts(c);
     puts(*d);
     puts(e);

     return 0;
 }
```

```
+| test.c:23:14:23:14 | e | The variable $@ may not be initialized here, but has a cleanup handler. | test.c:20:26:20:26 | e | e |
+| test.c:27:10:27:10 | a | The variable $@ may not be initialized here, but has a cleanup handler. | test.c:16:45:16:45 | a | a |
+| test.c:29:10:29:10 | c | The variable $@ may not be initialized here, but has a cleanup handler. | test.c:18:25:18:25 | c | c |
```

2 years agocore: support user manager with Condition[Memory/CPU/IO]Pressure
Luca Boccassi [Wed, 1 Dec 2021 14:16:24 +0000 (14:16 +0000)] 
core: support user manager with Condition[Memory/CPU/IO]Pressure

Get the cgroup root path from the current PID, so that when
ran by the user manager we can get to the right path.
Eg: foo.slice:10% will check under:

/sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/foo.slice/cpu.pressure

Follow-up for 81513b382b24a7f3602987f71042d075ca27d1a5

2 years agomeson: disallow the combination of cryptolib=openssl and dns-over-tls=gnutls 21170/head
Zbigniew Jędrzejewski-Szmek [Thu, 2 Dec 2021 10:29:45 +0000 (11:29 +0100)] 
meson: disallow the combination of cryptolib=openssl and dns-over-tls=gnutls

It could work, but it doesn't make much sense. If we already have openssl as
the cryptolib that provides the necessary support, let's not bring in another
library. Disallowing this simplifies things and reduces our support matrix.

2 years agoci: expand the test framework to cover openssl
Zbigniew Jędrzejewski-Szmek [Wed, 1 Dec 2021 11:50:01 +0000 (12:50 +0100)] 
ci: expand the test framework to cover openssl

2 years agoMerge pull request #21584 from yuwata/network-wireguard-cleanups
Yu Watanabe [Thu, 2 Dec 2021 06:53:57 +0000 (15:53 +0900)] 
Merge pull request #21584 from yuwata/network-wireguard-cleanups

network: cleanups for wireguard

2 years agoRevert "network: address: drop deprecated temporary address"
Yu Watanabe [Thu, 2 Dec 2021 00:53:49 +0000 (09:53 +0900)] 
Revert "network: address: drop deprecated temporary address"

This reverts commit 528da64a0c734bd45e953b5c57d82e2a727435ef.

The commit is a bad way to fix #19838, and introduces #21593.

Fixes #21593.

2 years agonetwork/wireguard: search valid address of the endpoint from all struct addrinfo... 21584/head
Yu Watanabe [Mon, 29 Nov 2021 15:20:03 +0000 (00:20 +0900)] 
network/wireguard: search valid address of the endpoint from all struct addrinfo entries

2 years agonetwork/wireguard: cleanups for resolving endpoints
Yu Watanabe [Mon, 29 Nov 2021 12:21:21 +0000 (21:21 +0900)] 
network/wireguard: cleanups for resolving endpoints

This makes
- drop peers_with_unresolved_endpoint and peers_with_failed_endpoint,
- drop destroy handler for sd_resolve_query, and manage each query by peer,
- add random fluctuation to the timeout for retry handler,
- retry timer event source is now managed by peer,
- use sd_event_source_disable_unref().

2 years agonetwork/wireguard: do not resolve Endpoint= if an IP address is specified
Yu Watanabe [Mon, 29 Nov 2021 13:07:29 +0000 (22:07 +0900)] 
network/wireguard: do not resolve Endpoint= if an IP address is specified

Also verify the domain name and port.

2 years agoparse-util: refuse leading white space in port number
Yu Watanabe [Wed, 1 Dec 2021 23:31:55 +0000 (08:31 +0900)] 
parse-util: refuse leading white space in port number

When parse_ip_port() is directly used in a conf parser, then that's
fine, as the rvalue is already truncated.

When parse_ip_port() is used when e.g. parsing IP address with port,
then we should really refuse white space after colon.

2 years agoMerge pull request #21585 from yuwata/network-radv-uplink-interface-auto-with-dhcp6-pd
Yu Watanabe [Wed, 1 Dec 2021 23:16:23 +0000 (08:16 +0900)] 
Merge pull request #21585 from yuwata/network-radv-uplink-interface-auto-with-dhcp6-pd

network: cleanups for uplink interface handling for RADV and DHCP6-PD

2 years agoMerge pull request #21583 from bluca/bpf_assert
Yu Watanabe [Wed, 1 Dec 2021 22:47:17 +0000 (07:47 +0900)] 
Merge pull request #21583 from bluca/bpf_assert

cgroup: don't emit BPF firewall warning when manager is in test mode

2 years agoMerge pull request #21591 from yuwata/core-bpf-firewall-unsupported-reason
Luca Boccassi [Wed, 1 Dec 2021 21:20:30 +0000 (21:20 +0000)] 
Merge pull request #21591 from yuwata/core-bpf-firewall-unsupported-reason

core/bpf-firewall: make bpf_firewall_supported() always set unsupport…

2 years agoelf-util: do not ignore prctl() errors
Luca Boccassi [Wed, 1 Dec 2021 01:04:54 +0000 (01:04 +0000)] 
elf-util: do not ignore prctl() errors

We want to avoid loops, so fail and return if we can't disable
core dumping

CID#1467004

2 years agosyscalls: run ninja update-syscall-tables 21599/head
Xiaotian Wu [Wed, 1 Dec 2021 15:53:17 +0000 (23:53 +0800)] 
syscalls: run ninja update-syscall-tables

2 years agotree-wide: fix typo
Yu Watanabe [Wed, 1 Dec 2021 15:07:21 +0000 (00:07 +0900)] 
tree-wide: fix typo

2 years agosyscalls: add LoongArch 64bit syscalls
Xiaotian Wu [Tue, 8 Dec 2020 12:02:13 +0000 (20:02 +0800)] 
syscalls: add LoongArch 64bit syscalls

2 years agoFixed typo
KennthStailey [Wed, 1 Dec 2021 14:43:40 +0000 (09:43 -0500)] 
Fixed typo

`ip set dev eth0` should be `ip link set dev eth0`

2 years agocore/bpf-firewall: make bpf_firewall_supported() always set unsupported reason when... 21591/head
Yu Watanabe [Wed, 1 Dec 2021 12:07:22 +0000 (21:07 +0900)] 
core/bpf-firewall: make bpf_firewall_supported() always set unsupported reason when BPF_FIREWALL_UNSUPPORTED is returned

Otherwise, log_unit_full_errno() in emit_bpf_firewall_warning() will
trigger an assertion.

2 years agocore/cgroup: propagate errors on detecting supported features
Yu Watanabe [Wed, 1 Dec 2021 12:37:17 +0000 (21:37 +0900)] 
core/cgroup: propagate errors on detecting supported features

2 years agocore/restrict-netif: make restrict_network_interfaces_supported() return negative...
Yu Watanabe [Wed, 1 Dec 2021 12:34:37 +0000 (21:34 +0900)] 
core/restrict-netif: make restrict_network_interfaces_supported() return negative errno only when critical error

Other errors are handled as the functionality is not supported.

This also drops unnecessary SYNTHETIC_ERRNO().

2 years agotest: run commands with debug level logs in TEST-65-ANALYZE 21583/head
Luca Boccassi [Tue, 30 Nov 2021 23:49:58 +0000 (23:49 +0000)] 
test: run commands with debug level logs in TEST-65-ANALYZE

2 years agocgroup: don't emit BPF firewall warning when manager is in test mode
Luca Boccassi [Tue, 30 Nov 2021 23:49:33 +0000 (23:49 +0000)] 
cgroup: don't emit BPF firewall warning when manager is in test mode

Support for BPF might not have been checked, since it's not necessary
in test mode (eg: running offline analysis of units). This causes an
assert:

Assertion '(_error) != 0' failed at src/core/bpf-firewall.c:914, function emit_bpf_firewall_warning(). Aborting.

Export SYSTEMD_LOG_LEVEl=debug in TEST-65-ANALYZE is enough to trigger
this assert while doing an offline analysis of a unit that has some
firewall/network restrictions set.

Skip the warning if the manager is in test mode.

2 years agoci: temporarily set -Wno-deprecated-declarations in Packit
Zbigniew Jędrzejewski-Szmek [Tue, 2 Nov 2021 13:37:19 +0000 (14:37 +0100)] 
ci: temporarily set -Wno-deprecated-declarations in Packit

to suppress OpenSSL 3.0 deprecation warnings (until a proper solution is
deployed): RSA_free, EC_KEY_free, RSA_set0_key, RSA_size, EVP_PKEY_assign,
EC_KEY_set_group, and others are deprecated.

2 years agoresolved: do not use BN_dup() unnecessarilly
Zbigniew Jędrzejewski-Szmek [Tue, 2 Nov 2021 09:45:20 +0000 (10:45 +0100)] 
resolved: do not use BN_dup() unnecessarilly

Suggested in https://github.com/systemd/systemd/pull/21170#discussion_r738696794

2 years agoport string_hashsum from libgcrypt to openssl^gcrypt
Zbigniew Jędrzejewski-Szmek [Wed, 27 Oct 2021 13:39:48 +0000 (15:39 +0200)] 
port string_hashsum from libgcrypt to openssl^gcrypt

This allows resolved and importd to be built without libgcrypt.

Note that we now say either 'cryptographic library' or 'cryptolib'.

Co-authored-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
2 years agobasic/openssl-util: Add sha256 hash wrapper
Kevin Kuehler [Fri, 11 Dec 2020 00:08:11 +0000 (16:08 -0800)] 
basic/openssl-util: Add sha256 hash wrapper

2 years agoresolve: Port nsec3 code to openssl^gcrypt
Kevin Kuehler [Fri, 11 Dec 2020 00:08:30 +0000 (16:08 -0800)] 
resolve: Port nsec3 code to openssl^gcrypt

Co-authored-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
2 years agotest-network: re-arrange DHCP6-PD subnet IDs to test searching free subnet ID 21585/head
Yu Watanabe [Wed, 1 Dec 2021 11:34:48 +0000 (20:34 +0900)] 
test-network: re-arrange DHCP6-PD subnet IDs to test searching free subnet ID

2 years agotest-network: add testcases for uplink interface detection for RADV with DHCPv6-PD
Yu Watanabe [Wed, 1 Dec 2021 06:08:00 +0000 (15:08 +0900)] 
test-network: add testcases for uplink interface detection for RADV with DHCPv6-PD

2 years agonetwork: dhcp6-pd: exclude all explicitly specified subnet IDs when searching free IDs
Yu Watanabe [Wed, 1 Dec 2021 10:43:40 +0000 (19:43 +0900)] 
network: dhcp6-pd: exclude all explicitly specified subnet IDs when searching free IDs

When the upstream link gained a lease, then several downstream links may
not appear yet. Previously, the explicitly specified subnet ID for a
downstream link which appears later may be already assigned to an
interface which does not request specific subnet ID.

To avoid such situation, this makes all specified IDs are excluded when
searching free IDs.

As a side effect, we can avoid the second call of
dhcp6_pd_distribute_prefix().

2 years agonetwork: dhcp6-pd: introduce dhcp6_pd_is_uplink()
Yu Watanabe [Wed, 1 Dec 2021 10:24:22 +0000 (19:24 +0900)] 
network: dhcp6-pd: introduce dhcp6_pd_is_uplink()

This also merges dhcp6_pd_resolve_uplink() with dhcp6_pd_find_uplink()

2 years agonetwork: dhcp6: make UplinkInterface=:self take effect only when DHCPv6PrefixDelegati...
Yu Watanabe [Wed, 1 Dec 2021 05:48:51 +0000 (14:48 +0900)] 
network: dhcp6: make UplinkInterface=:self take effect only when DHCPv6PrefixDelegation= is enabled

2 years agonetwork: radv: use the uplink interface used in DHCPv6-PD
Yu Watanabe [Wed, 1 Dec 2021 05:37:26 +0000 (14:37 +0900)] 
network: radv: use the uplink interface used in DHCPv6-PD

2 years agodocs: document that systemd closes console during normal runtime
Arvid E. Picciani [Wed, 1 Dec 2021 08:21:04 +0000 (09:21 +0100)] 
docs: document that systemd closes console during normal runtime

fixes #21451

Signed-off-by: Arvid E. Picciani <aep@exys.org>
2 years agocore: add Condition[Memory/CPU/IO]Pressure
Luca Boccassi [Wed, 17 Nov 2021 10:00:12 +0000 (10:00 +0000)] 
core: add Condition[Memory/CPU/IO]Pressure

By default checks PSI on /proc/pressure, and causes a unit to be skipped
if the threshold is above the given configuration for the avg300
measurement.
Also allow to pass a custom timespan, and a particular slice unit to
check under.

Fixes #20139

2 years agoMerge pull request #21581 from keszybz/really-random-fixlets
Yu Watanabe [Wed, 1 Dec 2021 03:54:00 +0000 (12:54 +0900)] 
Merge pull request #21581 from keszybz/really-random-fixlets

Really random fixlets

2 years agoMerge pull request #21564 from yuwata/errno-eagain-eintr
Yu Watanabe [Wed, 1 Dec 2021 03:52:27 +0000 (12:52 +0900)] 
Merge pull request #21564 from yuwata/errno-eagain-eintr

tree-wide: introduce ERRNO_IS_TRANSIENT() and use it

2 years agoMerge pull request #21536 from medhefgo/test
Yu Watanabe [Wed, 1 Dec 2021 03:52:10 +0000 (12:52 +0900)] 
Merge pull request #21536 from medhefgo/test

test: Introduce TEST_RET macro

2 years agoMerge pull request #21288 from loongarch64/la64/main
Yu Watanabe [Wed, 1 Dec 2021 03:51:48 +0000 (12:51 +0900)] 
Merge pull request #21288 from loongarch64/la64/main

Add support for the LoongArch architecture.

2 years agoMerge pull request #21553 from yuwata/network-wireguard-add-routes-to-allowed-ips
Luca Boccassi [Tue, 30 Nov 2021 23:30:31 +0000 (23:30 +0000)] 
Merge pull request #21553 from yuwata/network-wireguard-add-routes-to-allowed-ips

network: wireguard: add routes to AllowedIPs=

2 years agoresolve: Port dnskey verification by ds to openssl^gcrypt
Kevin Kuehler [Fri, 11 Dec 2020 00:08:28 +0000 (16:08 -0800)] 
resolve: Port dnskey verification by ds to openssl^gcrypt

Co-authored-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
2 years agoresolve: Port dnssec verify from gcrypt to openssl^gcrypt
Kevin Kuehler [Fri, 11 Dec 2020 00:08:26 +0000 (16:08 -0800)] 
resolve: Port dnssec verify from gcrypt to openssl^gcrypt

Co-authored-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
2 years agoresolved: split out function to hash signature
Zbigniew Jędrzejewski-Szmek [Thu, 21 Oct 2021 14:00:08 +0000 (16:00 +0200)] 
resolved: split out function to hash signature

dnssec_verify_rrset() is just too long.

2 years agoresolved: split out function to generate signature
Zbigniew Jędrzejewski-Szmek [Thu, 28 Oct 2021 12:03:44 +0000 (14:03 +0200)] 
resolved: split out function to generate signature

dnssec_verify_rrset() is just too long.

2 years agoresolve: Add coverage for dnssec ecdsa (rfc6605)
Kevin Kuehler [Fri, 11 Dec 2020 00:08:23 +0000 (16:08 -0800)] 
resolve: Add coverage for dnssec ecdsa (rfc6605)

2 years agoimport: port importd from libgcrypt to openssl^gcrypt
Zbigniew Jędrzejewski-Szmek [Tue, 2 Nov 2021 08:58:04 +0000 (09:58 +0100)] 
import: port importd from libgcrypt to openssl^gcrypt

This is heavily based on Kevin Kuehler's work, but the logic is also
significantly changed: instead of a straighforward port to openssl, both
versions of the code are kept, and at compile time we pick one or the other.

The code is purposefully kept "dumb" — the idea is that the libgcrypt codepaths
are only temporary and will be removed after everybody upgrades to openssl 3.
Thus, a separate abstraction layer is not introduced. Instead, very simple
ifdefs are used to select one or the other. If we added an abstraction layer,
we'd have to remove it again afterwards, and it don't think it makes sense to
do that for a temporary solution.

Co-authored-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
# Conflicts:
# meson.build

2 years agomeson: add config setting to select between openssl and gcrypt
Zbigniew Jędrzejewski-Szmek [Tue, 2 Nov 2021 08:44:12 +0000 (09:44 +0100)] 
meson: add config setting to select between openssl and gcrypt

This is not pretty, but it is supposed to be only a temporary measure.

2 years agorepart: port to our home-grown hmac_sha256
Kevin Kuehler [Wed, 20 Oct 2021 10:21:18 +0000 (12:21 +0200)] 
repart: port to our home-grown hmac_sha256

This reduces dependencies. The speed of the code here is uimportant, because we
hash only a tiny amount of input data.

Debian and Ubuntu currently build without repart, see
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=976959
> repart requires openssl and so far I tried to avoid linking against
> both gnutls and openssl.

Co-authored-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
2 years agotmpfiles: 'st' may have been used uninitialized 21581/head
Zbigniew Jędrzejewski-Szmek [Tue, 23 Nov 2021 14:05:58 +0000 (15:05 +0100)] 
tmpfiles: 'st' may have been used uninitialized

2 years agoman: prettify line number handling in python example
Zbigniew Jędrzejewski-Szmek [Sun, 28 Nov 2021 11:30:52 +0000 (12:30 +0100)] 
man: prettify line number handling in python example

This way the 'line_number' variable contains the actual line number as we think
of it, instead of adjusting it on output.

2 years agotest-sizeof: show stack and heap randomization
Zbigniew Jędrzejewski-Szmek [Fri, 26 Nov 2021 09:28:18 +0000 (10:28 +0100)] 
test-sizeof: show stack and heap randomization

It's useful to reassure yourself those those things actually work ;)

2 years agoMerge pull request #21580 from bluca/core_fork
Zbigniew Jędrzejewski-Szmek [Tue, 30 Nov 2021 20:49:53 +0000 (21:49 +0100)] 
Merge pull request #21580 from bluca/core_fork

Switch coredump ELF parsing to fork+dlopen

2 years agotest-network: add tests for creating routes to wireguard's AllowedIPs= 21553/head
Yu Watanabe [Mon, 29 Nov 2021 07:49:24 +0000 (16:49 +0900)] 
test-network: add tests for creating routes to wireguard's AllowedIPs=

2 years agonetwork: wireguard: automatically configure routes to addresses specified in AllowedIPs=
Yu Watanabe [Mon, 29 Nov 2021 07:36:42 +0000 (16:36 +0900)] 
network: wireguard: automatically configure routes to addresses specified in AllowedIPs=

Closes #14176.

2 years agonetwork: route: expose route_hash_ops
Yu Watanabe [Mon, 29 Nov 2021 07:35:46 +0000 (16:35 +0900)] 
network: route: expose route_hash_ops

2 years agonetwork/wireguard: drop unnecessary .in6 specifier
Yu Watanabe [Mon, 29 Nov 2021 06:13:03 +0000 (15:13 +0900)] 
network/wireguard: drop unnecessary .in6 specifier

This should not change any behavior, as the size of the IPv4 address is
smaller than IPv6.

2 years agonetwork: route: read RTA_TABLE attribute to get route table
Yu Watanabe [Mon, 29 Nov 2021 10:38:24 +0000 (19:38 +0900)] 
network: route: read RTA_TABLE attribute to get route table

If the table of a route is larger than 255, then the value is stored in
RTA_TABLE attribute. But the attribute is not supported by old kernels.
So, first try to read the value from RTA_TABLE attribute, then fallback
to the value in the message header.

2 years agonetwork: route: use typesafe function
Yu Watanabe [Mon, 29 Nov 2021 10:38:03 +0000 (19:38 +0900)] 
network: route: use typesafe function

2 years agooomd: use type suffix instead of casting
Zbigniew Jędrzejewski-Szmek [Tue, 30 Nov 2021 17:42:32 +0000 (18:42 +0100)] 
oomd: use type suffix instead of casting

The end result is the same.

2 years agonetwork: address: drop deprecated temporary address
Yu Watanabe [Tue, 30 Nov 2021 06:52:54 +0000 (15:52 +0900)] 
network: address: drop deprecated temporary address

Fixes #19838.

2 years agoTODO: update dlopen todo list 21580/head
Luca Boccassi [Wed, 24 Nov 2021 20:26:19 +0000 (20:26 +0000)] 
TODO: update dlopen todo list

2 years agoelf-util: switch libelf/libdw to dlopen()
Luca Boccassi [Mon, 22 Nov 2021 11:11:21 +0000 (11:11 +0000)] 
elf-util: switch libelf/libdw to dlopen()

In order to avoid inflating the dependency list for the core
library, use dlopen when inspecting elfs, since it's only
used in two non-core executables.

2 years agomeson: remove libdw dependency from pstore
Luca Boccassi [Wed, 24 Nov 2021 20:23:02 +0000 (20:23 +0000)] 
meson: remove libdw dependency from pstore

systemd-pstore does not use any symbol from libdw, and never did,
but the dependency was listed since the beginning

2 years agoelf-util: add stub for builds without libdw
Luca Boccassi [Sun, 21 Nov 2021 17:31:20 +0000 (17:31 +0000)] 
elf-util: add stub for builds without libdw

2 years agoelf-util: split out helper to parse build-id
Luca Boccassi [Thu, 18 Nov 2021 00:51:41 +0000 (00:51 +0000)] 
elf-util: split out helper to parse build-id

2 years agocoredump: move elf parsing utilities to src/shared/elf-util
Luca Boccassi [Wed, 17 Nov 2021 01:44:33 +0000 (01:44 +0000)] 
coredump: move elf parsing utilities to src/shared/elf-util

2 years agocoredump: always log on failure in parse_core()
Luca Boccassi [Wed, 24 Nov 2021 20:13:44 +0000 (20:13 +0000)] 
coredump: always log on failure in parse_core()

2 years agocoredump: make the buffer optional when analyzing a core file
Luca Boccassi [Wed, 17 Nov 2021 01:27:57 +0000 (01:27 +0000)] 
coredump: make the buffer optional when analyzing a core file

Allow later usage when we only want to fetch the JSON packaging metadata

2 years agocoredump: analyze object with libdwelf in forked process
Luca Boccassi [Sun, 21 Nov 2021 17:05:28 +0000 (17:05 +0000)] 
coredump: analyze object with libdwelf in forked process

Parsing objects is risky as data could be malformed or malicious,
so avoid doing that from the main systemd-coredump process and
instead fork another process, and set it to avoid generating
core files itself.

2 years agocoredump: use _cleanup_ pattern
Luca Boccassi [Mon, 29 Nov 2021 11:31:00 +0000 (11:31 +0000)] 
coredump: use _cleanup_ pattern

Note that c.f needs to be closed _before_ taking or freeing
the buf pointer, as it might be invalidated

2 years agocoredump: flush accumulating buffer after parsing core file
Luca Boccassi [Mon, 29 Nov 2021 10:23:49 +0000 (10:23 +0000)] 
coredump: flush accumulating buffer after parsing core file

2 years agocoredump: check return of dwarf_getscopes
Luca Boccassi [Tue, 30 Nov 2021 02:01:53 +0000 (02:01 +0000)] 
coredump: check return of dwarf_getscopes

2 years agoMerge pull request #21578 from bluca/json_spec
Zbigniew Jędrzejewski-Szmek [Tue, 30 Nov 2021 15:36:36 +0000 (16:36 +0100)] 
Merge pull request #21578 from bluca/json_spec

docs: clarify JSON terms in COREDUMP_PACKAGE_METADATA

2 years agogpt: update the gpt test case for LoongArch 21288/head
Xiaotian Wu [Mon, 19 Apr 2021 13:03:32 +0000 (21:03 +0800)] 
gpt: update the gpt test case for LoongArch

2 years agoarchitecture: Add support for the LoongArch architecture
Wu Xiaotian [Tue, 1 Sep 2020 04:13:18 +0000 (12:13 +0800)] 
architecture: Add support for the LoongArch architecture