]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agoMerge pull request #22351 from mrc0mmand/TEST-56-cgroupsv1
Yu Watanabe [Wed, 2 Feb 2022 01:02:26 +0000 (10:02 +0900)] 
Merge pull request #22351 from mrc0mmand/TEST-56-cgroupsv1

test: require unified cgroup hierarchy for TEST-56

2 years agoresolve: add missing OOM check
Lennart Poettering [Tue, 1 Feb 2022 16:38:12 +0000 (17:38 +0100)] 
resolve: add missing OOM check

2 years agocore: warn on ExitType=cgroup with legacy cgroup setup
Luca Boccassi [Tue, 1 Feb 2022 15:31:52 +0000 (15:31 +0000)] 
core: warn on ExitType=cgroup with legacy cgroup setup

'cgroup empty' notifications are not reliable on v1, so log a warning.

See: https://github.com/systemd/systemd/issues/22320

2 years agoMerge pull request #22332 from yuwata/network-dhcp-server-dns-server-address
Yu Watanabe [Tue, 1 Feb 2022 22:07:22 +0000 (07:07 +0900)] 
Merge pull request #22332 from yuwata/network-dhcp-server-dns-server-address

network: dhcp-server: allow to specify server address for DNS= or friends

2 years agoMerge pull request #22327 from joanbm/main_resolved_improvements
Yu Watanabe [Tue, 1 Feb 2022 22:06:56 +0000 (07:06 +0900)] 
Merge pull request #22327 from joanbm/main_resolved_improvements

resolved: misc. small DnsStream refactors and improvements

2 years agotest: require unified cgroup hierarchy for TEST-56 22351/head
Frantisek Sumsal [Tue, 1 Feb 2022 19:25:00 +0000 (20:25 +0100)] 
test: require unified cgroup hierarchy for TEST-56

since cgroup empty notifications are unreliable in legacy cgroups.

See: systemd/systemd#22320
Complements: systemd/systemd#22344

2 years agotest: introduce `get_cgroup_hierarchy() helper
Frantisek Sumsal [Tue, 1 Feb 2022 19:18:29 +0000 (20:18 +0100)] 
test: introduce `get_cgroup_hierarchy() helper

which returns the host's cgroup hierarchy (unified, hybrid, or legacy).

2 years agounits: we need systemd-journald.service from systemd-journal-flush.service
Lennart Poettering [Tue, 1 Feb 2022 17:11:04 +0000 (18:11 +0100)] 
units: we need systemd-journald.service from systemd-journal-flush.service

This is a follow-up for d5ee050ffc9d413253932d9340ade8c8fb111092, and
reintroduces a requirement dep from systemd-journal-flush.service onto
systemd-journald.service, but a weaker one than originally: a Wants= one
instead of a Requires= one.

Why? Simply because the service issues an IPC call to the journald,
hence it should pull it in. (Note that socket activation doesn't happen
for the Varlink socket it uses, hence we should pull in the service
itself.)

2 years agotest-network: add tests for DNS=_server_address in [DHCPServer] 22332/head
Yu Watanabe [Tue, 1 Feb 2022 07:30:45 +0000 (16:30 +0900)] 
test-network: add tests for DNS=_server_address in [DHCPServer]

2 years agonetwork: dhcp-server: introduce special value DNS=_server_address
Yu Watanabe [Tue, 1 Feb 2022 07:20:33 +0000 (16:20 +0900)] 
network: dhcp-server: introduce special value DNS=_server_address

Closes #15026.

2 years agoMerge pull request #22310 from yuwata/sd-dhcp-lease-fixes
Yu Watanabe [Tue, 1 Feb 2022 19:55:07 +0000 (04:55 +0900)] 
Merge pull request #22310 from yuwata/sd-dhcp-lease-fixes

sd-dhcp-lease: two fixes

2 years agoMerge pull request #22343 from poettering/assert-se-efi
Luca Boccassi [Tue, 1 Feb 2022 19:26:57 +0000 (19:26 +0000)] 
Merge pull request #22343 from poettering/assert-se-efi

efi: add/user assert_se()/ASSERT_SE_PTR() for OOM handling

2 years agoanalyze: correctly mention that --json= is also understood by inspect-elf
Lennart Poettering [Tue, 1 Feb 2022 16:37:19 +0000 (17:37 +0100)] 
analyze: correctly mention that --json= is also understood by inspect-elf

2 years agoresolved: Allow test-resolved-stream to run concurrently 22327/head
Joan Bruguera [Sun, 30 Jan 2022 16:56:32 +0000 (17:56 +0100)] 
resolved: Allow test-resolved-stream to run concurrently

Since test-resolved-stream brings up a simple DNS server on 127.0.0.1:12345,
only one instance could run at a time, so it would fail when run like
`meson test -C build test-resolved-stream --repeat=1000`.
Similarly, if by chance something is up on port 12345, the test would fail.

To make the test more reliable, run it in an isolated user + network namespace.
If this fails (some distributions disable user namespaces), just run as before.

2 years agoresolved: Read as much as possible per stream EPOLLIN event
Joan Bruguera [Sun, 30 Jan 2022 11:51:10 +0000 (12:51 +0100)] 
resolved: Read as much as possible per stream EPOLLIN event

In commit 2aaf6bb6e99b0f2bd73e0c49bef9e11a2844bf1a, an issue was fixed where
systemd-resolved could get stuck for multiple seconds waiting for incoming data,
since GnuTLS/OpenSSL can buffer a TLS record, so data could be available, but
no EPOLLIN event would be generated.

To fix this, a somewhat elaborate logic consisting on asking the TLS library
whether it had buffered data, then "faking" an EPOLLIN event was implemented.

However, there is a much simpler solution: Always read as much data as available
(i.e. until we get an event like EAGAIN when trying to read) from the stream
when we get an EPOLLIN event, instead of at most a single packet per event.
This approach does not require asking the TLS library whether it has buffered
data, and the logic is exactly the same for both the TCP and TLS case.

test-resolved-stream is fixed to avoid a latent double free bug.

2 years agoresolved: Avoid multiple SSL writes per DoT packet
Joan Bruguera [Mon, 31 Jan 2022 20:28:32 +0000 (21:28 +0100)] 
resolved: Avoid multiple SSL writes per DoT packet

In the DoT case, dns_stream_writev decomposed an iovec into multiple
dnstls_stream_write calls, which resulted in multiple SSL writes and multiple
TLS records. This can be checked from a network capture, e.g. using socat:
socat -v -x openssl-listen:853,reuseaddr,fork,cert=my.cert,key=my.key,verify=0 openssl:8.8.8.8:853

Instead, propagate the iovec as-is into the DoT handling code. For GnuTLS, the
library provides support for buffering ('corking') a record. OpenSSL has no
such facility, so we join the iovec into a single buffer then call SSL_write.

socat capture of `resolvectl -4 query --cache=no example.com` before the commit:

> 2022/01/30 13:35:52.194200  length=2 from=0 to=1
 00 28                                            .(
--
> 2022/01/30 13:35:52.194253  length=40 from=2 to=41
 1e b2 01 00 00 01 00 00 00 00 00 01 07 65 78 61  .............exa
 6d 70 6c 65 03 63 6f 6d 00 00 01 00 01 00 00 29  mple.com.......)
 ff e4 00 00 00 00 00 00                          ........
--
< 2022/01/30 13:35:52.232798  length=58 from=0 to=57
 00 38 1e b2 81 80 00 01 00 01 00 00 00 01 07 65  .8.............e
 78 61 6d 70 6c 65 03 63 6f 6d 00 00 01 00 01 c0  xample.com......
 0c 00 01 00 01 00 00 53 6f 00 04 5d b8 d8 22 00  .......So..]..".
 00 29 02 00 00 00 00 00 00 00                    .)........

socat capture of `resolvectl -4 query --cache=no example.com` after the commit:

> 2022/01/30 13:34:47.598099  length=42 from=504 to=545
 00 28 37 86 01 00 00 01 00 00 00 00 00 01 07 65  .(7............e
 78 61 6d 70 6c 65 03 63 6f 6d 00 00 01 00 01 00  xample.com......
 00 29 ff e4 00 00 00 00 00 00                    .)........
--
< 2022/01/30 13:34:47.613203  length=58 from=756 to=813
 00 38 37 86 81 80 00 01 00 01 00 00 00 01 07 65  .87............e
 78 61 6d 70 6c 65 03 63 6f 6d 00 00 01 00 01 c0  xample.com......
 0c 00 01 00 01 00 00 52 5e 00 04 5d b8 d8 22 00  .......R^..]..".
 00 29 02 00 00 00 00 00 00 00                    .)........

2 years agoresolved: Make event flags logic robust for DoT
Joan Bruguera [Mon, 31 Jan 2022 20:28:21 +0000 (21:28 +0100)] 
resolved: Make event flags logic robust for DoT

Since when handling a DNS over TLS stream, the TLS library can override the
requested events through dnstls_events for handshake/shutdown purposes,
obtaining the event flags through sd_event_source_get_io_events and checking
for EPOLLIN or EPOLLOUT does not really tell us whether we want to read/write
a packet. Instead, it could just be OpenSSL/GnuTLS doing something else.

To make the logic more robust (and simpler), save the flags that tell us
whether we want to read/write a packet, and check them instead of the IO flags.

(& use uint32_t for the flags like in sd_event_source_set_io_events prototype)

2 years agoNEWS: minor formatting tweaks
Lennart Poettering [Tue, 1 Feb 2022 16:37:08 +0000 (17:37 +0100)] 
NEWS: minor formatting tweaks

2 years agoMerge pull request #22341 from poettering/pam-end-fix
Luca Boccassi [Tue, 1 Feb 2022 16:34:00 +0000 (16:34 +0000)] 
Merge pull request #22341 from poettering/pam-end-fix

pid1: pam_end() PAM_DATA_SILENT fix

2 years agoutil: another set of CVE-2021-4034 assert()s
Lennart Poettering [Tue, 1 Feb 2022 11:06:21 +0000 (12:06 +0100)] 
util: another set of CVE-2021-4034 assert()s

It's a good idea that we validate argc/argv when we are supposed to
store them away.

2 years agoefi: use assert_se() instead of assert() to guard for OOM issues in EFI code 22343/head
Lennart Poettering [Tue, 1 Feb 2022 14:28:33 +0000 (15:28 +0100)] 
efi: use assert_se() instead of assert() to guard for OOM issues in EFI code

2 years agomacro: add ASSERT_SE_PTR() macro
Lennart Poettering [Tue, 1 Feb 2022 13:43:04 +0000 (14:43 +0100)] 
macro: add ASSERT_SE_PTR() macro

ASSERT_SE_PTR() is like ASSERT_PTR() but uses assert_se() instead of
assert() internally.

Code should use ASSERT_SE_PTR() where the check should never be
optimized away, even if NDEBUG is set.

Rationale: assert() is the right choice for validating assumptions about
our own code, i.e. checking conditions that are "impossible" to not
hold, because we ourselves hacked things up the "right" way of course.
assert_se() is the right choice for tests that come with a weaker
guarantee, they encode assumptions over other's API behaviour, i.e.
whether something can fail there or not.

When developing tools that are not oom-safe assert_se() is the right
choice: we know that on Linux OOM doesn't really happen, even though
theoretically the API allows it to happen.

Usecase for ASSERT_SE_PTR() is mostly the fatal memory allocation logic
for EFI memory allocations. So far it used regular assert() i.e. OOM
failurs would be totally ignored if NDEBUG is set. We'd rather have our
EFI program to print an assert message and freeze instead though.

2 years agofundamental: support assert_se() in EFI mode too
Lennart Poettering [Tue, 1 Feb 2022 14:28:19 +0000 (15:28 +0100)] 
fundamental: support assert_se() in EFI mode too

2 years agoMerge pull request #22331 from yuwata/network-xfrm-interface-id
Luca Boccassi [Tue, 1 Feb 2022 13:25:38 +0000 (13:25 +0000)] 
Merge pull request #22331 from yuwata/network-xfrm-interface-id

network: xfrm: refuse zero interface ID

2 years agoexecute: document that the 'env' param is input *and* output 22341/head
Lennart Poettering [Tue, 1 Feb 2022 12:50:28 +0000 (13:50 +0100)] 
execute: document that the 'env' param is input *and* output

2 years agoexecute: line break comments a bit less aggressively
Lennart Poettering [Tue, 1 Feb 2022 12:50:13 +0000 (13:50 +0100)] 
execute: line break comments a bit less aggressively

2 years agoexecute: use _cleanup_ logic where appropriate
Lennart Poettering [Tue, 1 Feb 2022 12:49:56 +0000 (13:49 +0100)] 
execute: use _cleanup_ logic where appropriate

2 years agopid1: pass PAM_DATA_SILENT to pam_end() in child
Lennart Poettering [Tue, 1 Feb 2022 11:37:51 +0000 (12:37 +0100)] 
pid1: pass PAM_DATA_SILENT to pam_end() in child

Fixes: #22318
2 years agonetwork: dhcp-server: also refuse link local address to use as the server address
Yu Watanabe [Tue, 1 Feb 2022 07:39:43 +0000 (16:39 +0900)] 
network: dhcp-server: also refuse link local address to use as the server address

2 years agonetwork: use GREEDY_REALLOC() at one more place
Yu Watanabe [Tue, 1 Feb 2022 07:14:59 +0000 (16:14 +0900)] 
network: use GREEDY_REALLOC() at one more place

2 years agosd-dhcp-server: convert null address for e.g. DNS to server address
Yu Watanabe [Tue, 1 Feb 2022 07:09:17 +0000 (16:09 +0900)] 
sd-dhcp-server: convert null address for e.g. DNS to server address

2 years agosd-dhcp-server: use free_and_replace() at one more place
Yu Watanabe [Tue, 1 Feb 2022 06:49:52 +0000 (15:49 +0900)] 
sd-dhcp-server: use free_and_replace() at one more place

2 years agonetwork: drop outdated TODO comment
Yu Watanabe [Tue, 1 Feb 2022 06:38:39 +0000 (15:38 +0900)] 
network: drop outdated TODO comment

Follow-up for 59aa622013277cfe6349d0789a7a00ad2b884902.

2 years agoMerge pull request #22254 from yuwata/dhcp-server-fix-segfault
Yu Watanabe [Tue, 1 Feb 2022 05:10:11 +0000 (14:10 +0900)] 
Merge pull request #22254 from yuwata/dhcp-server-fix-segfault

sd-dhcp-server: remove lease with hashmap_remove_value()

2 years agoMerge pull request #22319 from yuwata/network-use-reconfigure
Yu Watanabe [Tue, 1 Feb 2022 05:09:32 +0000 (14:09 +0900)] 
Merge pull request #22319 from yuwata/network-use-reconfigure

network: also use link_reconfigure_impl() to initially assign .network file

2 years agotest-network: set xfrm interface ID 22331/head
Yu Watanabe [Tue, 1 Feb 2022 04:26:40 +0000 (13:26 +0900)] 
test-network: set xfrm interface ID

This also unifies two tests for xfrm, and checks the output of
'ip link' command.

Fixes #22329.

2 years agonetwork: xfrm: refuse zero interface ID
Yu Watanabe [Tue, 1 Feb 2022 04:00:51 +0000 (13:00 +0900)] 
network: xfrm: refuse zero interface ID

Since kernel 5.17-rc1, 5.16.3, and 5.15.17 (more specifically,
https://github.com/torvalds/linux/commit/8dce43919566f06e865f7e8949f5c10d8c2493f5)
the kernel refuses to create an xfrm interface with zero ID.

2 years agomeson: use full argument names for bpftool gen commands
James Hilliard [Tue, 1 Feb 2022 01:20:53 +0000 (18:20 -0700)] 
meson: use full argument names for bpftool gen commands

This should be a purely cosmetic change.

2 years agosd-dhcp-lease: fix memleak 22310/head
Yu Watanabe [Sun, 30 Jan 2022 20:19:09 +0000 (05:19 +0900)] 
sd-dhcp-lease: fix memleak

Fixes https://github.com/systemd/systemd/pull/22294#issuecomment-1024840811.

2 years agosd-dhcp-lease: fix reading unaligned memory
Yu Watanabe [Sun, 30 Jan 2022 20:04:52 +0000 (05:04 +0900)] 
sd-dhcp-lease: fix reading unaligned memory

The destination address was read twice, one is for prefixlen, and
other is for destination address itself. And for prefixlen, the address
might be read from unaligned buffer.

This also modernizes the code.

2 years agofuzz-dhcp-server: add static leases 22254/head
Yu Watanabe [Fri, 28 Jan 2022 01:12:00 +0000 (10:12 +0900)] 
fuzz-dhcp-server: add static leases

2 years agotest-dhcp-server: add tests for static lease
Yu Watanabe [Thu, 27 Jan 2022 18:07:28 +0000 (03:07 +0900)] 
test-dhcp-server: add tests for static lease

2 years agotest-dhcp-server: add tests for setting static DHCP lease
Yu Watanabe [Thu, 27 Jan 2022 07:04:20 +0000 (16:04 +0900)] 
test-dhcp-server: add tests for setting static DHCP lease

2 years agotest-dhcp-server: add usual headers
Yu Watanabe [Thu, 27 Jan 2022 06:40:40 +0000 (15:40 +0900)] 
test-dhcp-server: add usual headers

2 years agotest-dhcp-server: run a test earlier which does not require privilege
Yu Watanabe [Thu, 27 Jan 2022 07:07:48 +0000 (16:07 +0900)] 
test-dhcp-server: run a test earlier which does not require privilege

2 years agotest-dhcp-server: move sd-event allocation
Yu Watanabe [Thu, 27 Jan 2022 07:11:02 +0000 (16:11 +0900)] 
test-dhcp-server: move sd-event allocation

2 years agotest-dhcp-server: use log_tests_skipped_errno()
Yu Watanabe [Thu, 27 Jan 2022 07:06:13 +0000 (16:06 +0900)] 
test-dhcp-server: use log_tests_skipped_errno()

2 years agosd-dhcp-server: split out logic to ACK request
Yu Watanabe [Thu, 27 Jan 2022 17:44:10 +0000 (02:44 +0900)] 
sd-dhcp-server: split out logic to ACK request

2 years agosd-dhcp-server: do not assign address reserved for static leases to non-matching...
Yu Watanabe [Thu, 27 Jan 2022 17:25:37 +0000 (02:25 +0900)] 
sd-dhcp-server: do not assign address reserved for static leases to non-matching clients

This fix the root cause of the issue #22253.

2 years agosd-dhcp-server: explicitly refuse when conflicting address is requested
Yu Watanabe [Thu, 27 Jan 2022 18:50:57 +0000 (03:50 +0900)] 
sd-dhcp-server: explicitly refuse when conflicting address is requested

2 years agosd-dhcp-server: do not assign an address from pool when a static lease for the client...
Yu Watanabe [Thu, 27 Jan 2022 18:50:16 +0000 (03:50 +0900)] 
sd-dhcp-server: do not assign an address from pool when a static lease for the client ID exists

2 years agosd-dhcp-server: rename get_pool_offset() -> address_is_in_pool()
Yu Watanabe [Thu, 27 Jan 2022 17:10:23 +0000 (02:10 +0900)] 
sd-dhcp-server: rename get_pool_offset() -> address_is_in_pool()

As, the value of pool_offset is not used.

2 years agosd-dhcp-server: rename server_send_nak() -> server_send_nak_or_ignore()
Yu Watanabe [Thu, 27 Jan 2022 17:14:47 +0000 (02:14 +0900)] 
sd-dhcp-server: rename server_send_nak() -> server_send_nak_or_ignore()

And logs error in the function.

2 years agosd-dhcp-server: set DHCPLease::server before hashmap_put()
Yu Watanabe [Wed, 26 Jan 2022 15:17:23 +0000 (00:17 +0900)] 
sd-dhcp-server: set DHCPLease::server before hashmap_put()

Otherwise, if the second push is failed, then the first hashmap contains
dirty entry.

Also, this makes hashmap_remove_value() used when removing leases to
make not wrong lease is removed from the hashmap.

Note, this just hide the root cause of the issue #22253, which will be
fixed in later commit.

Fixes #22253.

2 years agosd-dhcp-server: fix indentation
Yu Watanabe [Thu, 27 Jan 2022 16:24:35 +0000 (01:24 +0900)] 
sd-dhcp-server: fix indentation

2 years agosd-dhcp-server: rename argument and add one missing assertion
Yu Watanabe [Thu, 27 Jan 2022 16:24:20 +0000 (01:24 +0900)] 
sd-dhcp-server: rename argument and add one missing assertion

2 years agosd-dhcp-server: do not use implicit cast to boolean from integer
Yu Watanabe [Thu, 27 Jan 2022 16:23:39 +0000 (01:23 +0900)] 
sd-dhcp-server: do not use implicit cast to boolean from integer

2 years agosd-dhcp-server: refuse zero length client ID
Yu Watanabe [Thu, 27 Jan 2022 16:05:52 +0000 (01:05 +0900)] 
sd-dhcp-server: refuse zero length client ID

2 years agosd-dhcp-server: do not log "STOPPED" when already stopped
Yu Watanabe [Thu, 27 Jan 2022 07:19:10 +0000 (16:19 +0900)] 
sd-dhcp-server: do not log "STOPPED" when already stopped

2 years agonetwork: also use link_reconfigure_impl() to initially assign .network file 22319/head
Yu Watanabe [Mon, 31 Jan 2022 07:32:05 +0000 (16:32 +0900)] 
network: also use link_reconfigure_impl() to initially assign .network file

2 years agonetwork: drop tiny wrapper used only one place anymore
Yu Watanabe [Tue, 1 Feb 2022 02:37:45 +0000 (11:37 +0900)] 
network: drop tiny wrapper used only one place anymore

2 years agonetwork: do not free bound_by carrier map on reconfigure
Yu Watanabe [Mon, 31 Jan 2022 13:30:39 +0000 (22:30 +0900)] 
network: do not free bound_by carrier map on reconfigure

Otherwise, if a link enters unmanaged state, then its carrier state does
not propagated to other interfaces.

2 years agonetwork: do not remove localhost address
Yu Watanabe [Mon, 31 Jan 2022 10:26:51 +0000 (19:26 +0900)] 
network: do not remove localhost address

Managing loopback interfaces by networkd is not recommended, but supporeted.
Even such spurious situation, do not drop the localhost addresses.

2 years agonetwork: move ndisc_flush() to link_stop_engines()
Yu Watanabe [Mon, 31 Jan 2022 10:09:30 +0000 (19:09 +0900)] 
network: move ndisc_flush() to link_stop_engines()

As it is not related to any static configs.

2 years agonetwork: remove only managed configs on reconfigure or carrier lost
Yu Watanabe [Mon, 31 Jan 2022 10:08:27 +0000 (19:08 +0900)] 
network: remove only managed configs on reconfigure or carrier lost

Otherwise, if the carrir of the non-managed interface is lost, the
configs such as addresses or routes on the interface will be removed by
networkd.

2 years agoMerge pull request #22175 from keszybz/kernel-install-mkosi-initrd
Luca Boccassi [Mon, 31 Jan 2022 23:09:46 +0000 (23:09 +0000)] 
Merge pull request #22175 from keszybz/kernel-install-mkosi-initrd

kernel-install: add support for KERNEL_INSTALL_INITRD_GENERATOR and KERNEL_INSTALL_STAGING_AREA

2 years agonetwork: s/confiured/configured/
Frantisek Sumsal [Mon, 31 Jan 2022 21:17:48 +0000 (22:17 +0100)] 
network: s/confiured/configured/

A quick typo fix I noticed whilst debugging.

2 years agotree-wide: some additional checks to avoid CVE-2021-4034 style weaknesses
Lennart Poettering [Mon, 31 Jan 2022 16:58:18 +0000 (17:58 +0100)] 
tree-wide: some additional checks to avoid CVE-2021-4034 style weaknesses

2 years agorandom-seed: add missing %m in error message
Lennart Poettering [Mon, 31 Jan 2022 16:58:42 +0000 (17:58 +0100)] 
random-seed: add missing %m in error message

2 years agoMerge pull request #22323 from mrc0mmand/fix-TEST-69-on-C8S
Frantisek Sumsal [Mon, 31 Jan 2022 19:04:02 +0000 (19:04 +0000)] 
Merge pull request #22323 from mrc0mmand/fix-TEST-69-on-C8S

test: use ~/.bashrc instead of /etc/bash.bashrc

2 years agoupdate TODO
Lennart Poettering [Mon, 31 Jan 2022 16:58:25 +0000 (17:58 +0100)] 
update TODO

2 years agotest: copy portable profiles into the image if they don't exist there
Frantisek Sumsal [Mon, 31 Jan 2022 13:19:09 +0000 (14:19 +0100)] 
test: copy portable profiles into the image if they don't exist there

If we're built with `-Dportable=false`, the portable profiles won't get
installed into the image. Since we need only the profile files and
nothing else, let's copy them into the image explicitly in such case.

2 years agotest: use ~/.bashrc instead of /etc/bash.bashrc 22323/head
Frantisek Sumsal [Mon, 31 Jan 2022 16:11:06 +0000 (17:11 +0100)] 
test: use ~/.bashrc instead of /etc/bash.bashrc

/etc/bash.bashrc appears to be Debian-specific[0] (or specific to bash
versions compiled with -DSYS_BASHRC), which doesn't seem to be the case
for C8S. Let's use ~/.bashrc instead to make the CIs happy again.

[0] https://sources.debian.org/src/bash/5.1-6/debian/README/#L50-L56

2 years agotest: make the code less error-prone
Frantisek Sumsal [Mon, 31 Jan 2022 15:48:15 +0000 (16:48 +0100)] 
test: make the code less error-prone

2 years agoMerge pull request #22316 from yuwata/network-mac-address-length
Luca Boccassi [Mon, 31 Jan 2022 14:21:28 +0000 (14:21 +0000)] 
Merge pull request #22316 from yuwata/network-mac-address-length

network: several cleanups related to MAC address length

2 years agoMerge pull request #22300 from yuwata/bus-fix-error-handling
Luca Boccassi [Mon, 31 Jan 2022 14:03:00 +0000 (14:03 +0000)] 
Merge pull request #22300 from yuwata/bus-fix-error-handling

tree-wide: fix bus method error handling

2 years agoboot: Don't require a machine ID to be available
Daan De Meyer [Fri, 28 Jan 2022 15:40:09 +0000 (15:40 +0000)] 
boot: Don't require a machine ID to be available

Regression introduced in https://github.com/systemd/systemd/pull/21807.

Fixes #22224

2 years agoMerge pull request #22274 from yuwata/resolve-comment
Luca Boccassi [Mon, 31 Jan 2022 13:56:04 +0000 (13:56 +0000)] 
Merge pull request #22274 from yuwata/resolve-comment

resolve: cleanups for on_stream_io()

2 years agocore: don't fail on EEXIST when creating mount point
Luca Boccassi [Fri, 28 Jan 2022 22:56:10 +0000 (22:56 +0000)] 
core: don't fail on EEXIST when creating mount point

systemd[1016]: Failed to mount /tmp/app1 (type n/a) on /run/systemd/unit-extensions/1 (MS_BIND ): No such file or directory
systemd[1016]: Failed to create destination mount point node '/run/systemd/unit-extensions/1': File exists

2 years agocore: check argc/argv uncoditionally
Frantisek Sumsal [Sun, 30 Jan 2022 14:49:27 +0000 (15:49 +0100)] 
core: check argc/argv uncoditionally

as `assert()` might be dropped with `-DNDEBUG`.

Follow-up to cf3095a and 1637e75.

2 years agoMerge pull request #21838 from lnussel/logind-refactor
Yu Watanabe [Mon, 31 Jan 2022 10:45:33 +0000 (19:45 +0900)] 
Merge pull request #21838 from lnussel/logind-refactor

Logind shutdown refactor

2 years agomeson: use bpftool based strip when available
James Hilliard [Mon, 31 Jan 2022 04:47:38 +0000 (21:47 -0700)] 
meson: use bpftool based strip when available

This should be useable in bpftool v5.13 or newer based on:
https://github.com/torvalds/linux/commit/d80b2fcbe0a023619e0fc73112f2a02c2662f6ab

2 years agomeson: set minimum clang/llvm versions for bpf support
James Hilliard [Mon, 31 Jan 2022 02:33:55 +0000 (19:33 -0700)] 
meson: set minimum clang/llvm versions for bpf support

The minimum clang/llvm-strip version needed for building libbpf based
programs is 10.0.0, this is documented here:
https://github.com/libbpf/libbpf/tree/v0.6.1#bpf-co-re-compile-once--run-everywhere

Using an older version such as 9.0.0 will generate objects that
bpftool will not be able to generate skeletons for.

2 years agonetwork: currently IPv4ACD requires MAC address whose length is ETH_ALEN 22316/head
Yu Watanabe [Mon, 31 Jan 2022 04:07:34 +0000 (13:07 +0900)] 
network: currently IPv4ACD requires MAC address whose length is ETH_ALEN

2 years agonetwork: currently RADV requires MAC address whose length is ETH_ALEN
Yu Watanabe [Mon, 31 Jan 2022 04:02:57 +0000 (13:02 +0900)] 
network: currently RADV requires MAC address whose length is ETH_ALEN

2 years agonetwork: disable NDisc for CAN interfaces
Yu Watanabe [Mon, 31 Jan 2022 03:54:21 +0000 (12:54 +0900)] 
network: disable NDisc for CAN interfaces

We already disabled DHCP clients for CAN interfaces.

2 years agonetwork: configure NDisc after MAC address is assigned
Yu Watanabe [Mon, 31 Jan 2022 03:35:44 +0000 (12:35 +0900)] 
network: configure NDisc after MAC address is assigned

2 years agonetwork: configure DHCP clients after MAC address is assigned
Yu Watanabe [Mon, 31 Jan 2022 03:08:24 +0000 (12:08 +0900)] 
network: configure DHCP clients after MAC address is assigned

Prompted by #20090.

2 years agobasic: update CIFS magic
Frantisek Sumsal [Sun, 30 Jan 2022 22:40:05 +0000 (23:40 +0100)] 
basic: update CIFS magic

Kernel commit dea2903719283c156b53741126228c4a1b40440f exposed (and
renamed) CIFS_MAGIC_NUMBER as CIFS_SUPER_MAGIC along with
SMB2_SUPER_MAGIC.

This fixes the following build fail on current Fedora Rawhide:
```
../src/basic/meson.build:389:8: ERROR: Problem encountered: found unknown filesystem(s) defined in kernel headers:

Filesystem found in kernel header but not in filesystems-gperf.gperf: CIFS_SUPER_MAGIC
Filesystem found in kernel header but not in filesystems-gperf.gperf: SMB2_SUPER_MAGIC
```

2 years agohwdb: add support for Surface Laptop 2 & 3 (#22303)
Dorian Clay [Sun, 30 Jan 2022 19:50:09 +0000 (11:50 -0800)] 
hwdb: add support for Surface Laptop 2 & 3 (#22303)

2 years agohwdb: add new database file for PDA devices
Davide Cavalca [Sun, 30 Jan 2022 17:28:52 +0000 (09:28 -0800)] 
hwdb: add new database file for PDA devices

Add a new database for handhelds (PDAs, calculators, etc.) that should be
accessible the seat owner.

The database is initially populated with Texas Instruments calculators
and linking cables, which removes the need to installing dedicated udev
rules for them.

2 years agobasic: mac_[selinux,smack]_apply_fd does not work when applying labels
Donald Chan [Fri, 28 Jan 2022 22:53:46 +0000 (22:53 +0000)] 
basic: mac_[selinux,smack]_apply_fd does not work when applying labels

Commit a7fdc6c introduced a regression where file descriptors are opened
using O_PATH option. mac_smack_apply_fd() calls fsetxattr() and would fail
with a -EBADF (Bad file descriptor) error.

Use FORMAT_PROC_FD_PATH(fd) to convert the fd back into a full path and
call setxattr() or setfilecon() instead.

Signed-off-by: Donald Chan <hoiho@amazon.com>
2 years agoshared: Handle filesystems that don't support hole punching in COPY_HOLES
Daan De Meyer [Fri, 28 Jan 2022 16:18:49 +0000 (16:18 +0000)] 
shared: Handle filesystems that don't support hole punching in COPY_HOLES

2 years agoMerge pull request #22294 from evverx/fuzz-dhcp-client
Yu Watanabe [Sun, 30 Jan 2022 19:41:07 +0000 (04:41 +0900)] 
Merge pull request #22294 from evverx/fuzz-dhcp-client

tests: fuzz client_handle_offer

2 years agoMerge pull request #22302 from evverx/merge-oss-fuzz-corpora
Frantisek Sumsal [Sun, 30 Jan 2022 18:35:28 +0000 (18:35 +0000)] 
Merge pull request #22302 from evverx/merge-oss-fuzz-corpora

ci: merge seed corpora with public OSS-Fuzz corpora on CFLite

2 years agocore: check if argc > 0 and argv[0] is set
Yu Watanabe [Sun, 30 Jan 2022 08:54:55 +0000 (17:54 +0900)] 
core: check if argc > 0 and argv[0] is set

Follow-up for 1637e757070a61b12b26a2a4ef547330562dc77f.

2 years agoci: no longer upload the latest builds on commits 22302/head
Evgeny Vereshchagin [Sun, 30 Jan 2022 09:18:53 +0000 (09:18 +0000)] 
ci: no longer upload the latest builds on commits

The idea behind this action is to make it possible to compare the
latest fuzz targets with PRs to figure out whether bugs are really
reproducible in PRs only. Since forks (including systemd-stable) are
usually based on the upstream repository where almost all the bugs
are fixed before releases are cut it should be safe to assume that
if CFLite finds bugs in PRs they are most likely introduced in those
PRs.

It should probably be brought back once https://github.com/google/clusterfuzzlite/issues/84
is fixed.

2 years agoci: merge seed corpora with public OSS-Fuzz corpora on CFLite
Evgeny Vereshchagin [Sat, 29 Jan 2022 21:36:41 +0000 (21:36 +0000)] 
ci: merge seed corpora with public OSS-Fuzz corpora on CFLite

to let it cover as much code as possible. It should help to catch
most regressions in a few minutes.

2 years agoshared: be extra paranoid and check if argc > 0
Frantisek Sumsal [Fri, 28 Jan 2022 20:44:32 +0000 (21:44 +0100)] 
shared: be extra paranoid and check if argc > 0

and also if argv[0] is non-empty as a precaution for issues similar to
CVE-2021-4034.

2 years agoMerge pull request #22301 from mrc0mmand/cocci-tweaks
Yu Watanabe [Sun, 30 Jan 2022 00:34:44 +0000 (09:34 +0900)] 
Merge pull request #22301 from mrc0mmand/cocci-tweaks

fstab-generator: use str(n)dupa_safe() instead of plain str(n)dupa()