]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agomkosi: Enable --qemu-headless option for all distros
Daan De Meyer [Mon, 7 Dec 2020 23:00:37 +0000 (23:00 +0000)] 
mkosi: Enable --qemu-headless option for all distros

--qemu-headless configures the generated image and mkosi's qemu
command to connect to the VM via the serial port. This allows
spawning a qemu VM within the user's terminal instead of spawning
a graphical GTK GUI. --qemu-headless sets TERM, COLUMNS and LINES
in serial-getty@ttyS0.service in the container which makes the
terminal in the VM behave almost equivalent to the one on the host.

This change makes testing changes to systemd using mkosi + QEMU a
lot easier compared to before as commands can be executed in the VM
from the comfort of one's terminal compared to the Linux console
available when running via the GTK GUI.

3 years agohwdb: add funcional keys for MSI Modern series (tested on Modern 14) (#17880)
l4gfcm [Tue, 8 Dec 2020 08:57:17 +0000 (10:57 +0200)] 
hwdb: add funcional keys for MSI Modern series (tested on Modern 14) (#17880)

3 years agoman: synthetize(d) -> synthesize(d)
Yu Watanabe [Tue, 8 Dec 2020 00:26:00 +0000 (09:26 +0900)] 
man: synthetize(d) -> synthesize(d)

3 years agoMerge pull request #17855 from poettering/more-socktops
Luca Boccassi [Mon, 7 Dec 2020 21:15:28 +0000 (21:15 +0000)] 
Merge pull request #17855 from poettering/more-socktops

socket-util: some helpers for various sockopts

3 years agosystemd-nspawn: Allow setting ambient capability set
Torsten Hilbrich [Fri, 4 Dec 2020 10:27:12 +0000 (11:27 +0100)] 
systemd-nspawn: Allow setting ambient capability set

The old code was only able to pass the value 0 for the inheritable
and ambient capability set when a non-root user was specified.

However, sometimes it is useful to run a program in its own container
with a user specification and some capabilities set. This is needed
when the capabilities cannot be provided by file capabilities (because
the file system is mounted with MS_NOSUID for additional security).

This commit introduces the option --ambient-capability and the config
file option AmbientCapability=. Both are used in a similar way to the
existing Capability= setting. It changes the inheritable and ambient
set (which is 0 by default). The code also checks that the settings
for the bounding set (as defined by Capability= and DropCapability=)
and the setting for the ambient set (as defined by AmbientCapability=)
are compatible. Otherwise, the operation would fail in any way.

Due to the current use of -1 to indicate no support for ambient
capability set the special value "all" cannot be supported.

Also, the setting of ambient capability is restricted to running a
single program in the container payload.

3 years agoMerge pull request #17766 from weblate/weblate-systemd-master
Zbigniew Jędrzejewski-Szmek [Mon, 7 Dec 2020 18:56:13 +0000 (19:56 +0100)] 
Merge pull request #17766 from weblate/weblate-systemd-master

Translations update from Weblate

3 years agoMake support for nscd flushing optional
Zbigniew Jędrzejewski-Szmek [Mon, 7 Dec 2020 07:45:15 +0000 (08:45 +0100)] 
Make support for nscd flushing optional

Fedora will deprecate support for nscd in the upcoming release [1] and plans to
drop it in the next one [2]. At that point we might as well build systemd
without that support too, since there'll be nothing to talk too.

[1] https://fedoraproject.org/wiki/Changes/DeprecateNSCD
[2] https://fedoraproject.org/wiki/Changes/RemoveNSCD

3 years agosocket-util: add common API for querying socket MTU 17855/head
Lennart Poettering [Mon, 16 Nov 2020 14:01:03 +0000 (15:01 +0100)] 
socket-util: add common API for querying socket MTU

3 years agosocket-util: add getsockopt_int() helper
Lennart Poettering [Mon, 16 Nov 2020 11:41:39 +0000 (12:41 +0100)] 
socket-util: add getsockopt_int() helper

3 years agosocket-util: add sockopt helper for controlling IP_RECVFRAGSIZE
Lennart Poettering [Mon, 16 Nov 2020 11:41:23 +0000 (12:41 +0100)] 
socket-util: add sockopt helper for controlling IP_RECVFRAGSIZE

3 years agoMerge pull request #17874 from DaanDeMeyer/mkosi-build-verbosity
Zbigniew Jędrzejewski-Szmek [Mon, 7 Dec 2020 09:12:33 +0000 (10:12 +0100)] 
Merge pull request #17874 from DaanDeMeyer/mkosi-build-verbosity

Reduce mkosi build script verbosity

3 years agonss-resolve: varlink_call() set error_id only when r >= 0
Yu Watanabe [Sun, 6 Dec 2020 13:41:35 +0000 (22:41 +0900)] 
nss-resolve: varlink_call() set error_id only when r >= 0

Fixes #17870.

3 years agonetwork: mtu is neither a boolean nor a pointer
Yu Watanabe [Mon, 7 Dec 2020 05:10:45 +0000 (14:10 +0900)] 
network: mtu is neither a boolean nor a pointer

3 years agomissing: Define several syscall numbers for Alpha arch
Matt Turner [Sun, 6 Dec 2020 23:45:49 +0000 (18:45 -0500)] 
missing: Define several syscall numbers for Alpha arch

3 years agomeson: Respect MESON_INSTALL_QUIET 17874/head
Daan De Meyer [Sun, 6 Dec 2020 18:16:59 +0000 (18:16 +0000)] 
meson: Respect MESON_INSTALL_QUIET

MESON_INSTALL_QUIET is set when --quiet is passed to meson install.
Make sure we check the variable in our custom install scripts and
don't output anything if it is set.

3 years agomkosi: Silence locale checking in mkosi.build
Daan De Meyer [Sun, 6 Dec 2020 18:16:00 +0000 (18:16 +0000)] 
mkosi: Silence locale checking in mkosi.build

Avoid warning and error logs from locale charmap and export LC_CTYPE
by piping to dev/null and checking if locales are available before
using them.

3 years agomkosi: Remove explicit default_hierarchy=unified option from mkosi.build
Daan De Meyer [Sun, 6 Dec 2020 16:47:25 +0000 (16:47 +0000)] 
mkosi: Remove explicit default_hierarchy=unified option from mkosi.build

default_hierarchy is set to unified in meson_options already so
we can remove it from mkosi.build.

3 years agomkosi: Add --quiet and --no-rebuild options to meson install in mkosi.build
Daan De Meyer [Sun, 6 Dec 2020 16:45:45 +0000 (16:45 +0000)] 
mkosi: Add --quiet and --no-rebuild options to meson install in mkosi.build

By default, meson install prints a line for every file it installs.
This is verbose and doesn't provide much value. Let's silence the
meson install step to remove this output from the mkosi build step.

The --no-rebuild option removes some additional duplicate output
by the meson install step.

Ubuntu Focal still has meson 0.53.0 so we add a version check and
only use the new feature if the meson version supports it.

3 years agomkosi: Remove bash -x option from mkosi.build
Daan De Meyer [Sun, 6 Dec 2020 16:45:01 +0000 (16:45 +0000)] 
mkosi: Remove bash -x option from mkosi.build

-x is for debugging purposes. During regular usage, using -x mostly
prints useless output when building the mkosi image.

3 years agomkosi: Use meson install instead of ninja install in build script
Daan De Meyer [Sun, 6 Dec 2020 16:43:58 +0000 (16:43 +0000)] 
mkosi: Use meson install instead of ninja install in build script

Allows using extra options not available when using ninja.

3 years agoMerge pull request #17760 from mrc0mmand/revert-semaphore-timedated
Luca Boccassi [Sat, 5 Dec 2020 11:12:35 +0000 (11:12 +0000)] 
Merge pull request #17760 from mrc0mmand/revert-semaphore-timedated

Revert "semaphore: temporarily disable the timedated test suite"

3 years agoDon't assume /run/systemd exists when creating unit-root
Daan De Meyer [Thu, 3 Dec 2020 23:08:21 +0000 (23:08 +0000)] 
Don't assume /run/systemd exists when creating unit-root

When running tests in a mkosi container, /run/systemd might not
exist yet in the container which causes test-execute to fail.

Fixes #17842.

3 years agoMerge pull request #17787 from DaanDeMeyer/mkosi-boot-tests
Luca Boccassi [Fri, 4 Dec 2020 23:38:29 +0000 (23:38 +0000)] 
Merge pull request #17787 from DaanDeMeyer/mkosi-boot-tests

CI: Add mkosi boot tests

3 years agoCI: Add mkosi boot tests 17787/head
Daan De Meyer [Mon, 30 Nov 2020 20:57:52 +0000 (20:57 +0000)] 
CI: Add mkosi boot tests

Using the new mkosi Github Action, we can add some simple boot tests
for the systemd mkosi configs. This makes sure these keep working
as expected.

3 years agomkosi: Add findutils to Fedora config
Daan De Meyer [Fri, 4 Dec 2020 22:23:11 +0000 (22:23 +0000)] 
mkosi: Add findutils to Fedora config

find is needed by test_exec_dynamicuser.

3 years agomkosi: Add rpm to Fedora BuildPackages as it's needed by pkg-config
Daan De Meyer [Fri, 4 Dec 2020 20:05:19 +0000 (20:05 +0000)] 
mkosi: Add rpm to Fedora BuildPackages as it's needed by pkg-config

3 years agoRevert "semaphore: temporarily disable the timedated test suite" 17760/head
Frantisek Sumsal [Sat, 28 Nov 2020 10:31:13 +0000 (11:31 +0100)] 
Revert "semaphore: temporarily disable the timedated test suite"

This reverts commit ed9192bb55e23c00bf9ba810a949e7ffe1bbe959.

3 years agodissect: don't declare unused variables on archs that have no GPT discovery
Lennart Poettering [Thu, 3 Dec 2020 19:58:00 +0000 (20:58 +0100)] 
dissect: don't declare unused variables on archs that have no GPT discovery

Fixes: #17839
3 years agosocket-util: make several socket_set_xxx() functions inline
Yu Watanabe [Fri, 4 Dec 2020 02:20:25 +0000 (11:20 +0900)] 
socket-util: make several socket_set_xxx() functions inline

3 years agocryptsetup: give command line parameters proper names
Lennart Poettering [Wed, 25 Nov 2020 10:42:09 +0000 (11:42 +0100)] 
cryptsetup: give command line parameters proper names

It's highly confusing to reference the command line parameters via
argv[] indexes. Let's clean this up, and introduce properly named local
variables that make this easier to follow.

No actualy code changes, just some renaming of variables.

3 years agoMerge pull request #17854 from poettering/dns-domain-ret-fix
Lennart Poettering [Fri, 4 Dec 2020 16:49:05 +0000 (17:49 +0100)] 
Merge pull request #17854 from poettering/dns-domain-ret-fix

dns-domain: fix some coding style issues

3 years agoMerge pull request #17829 from anitazha/testoomdfix
Luca Boccassi [Fri, 4 Dec 2020 12:22:46 +0000 (12:22 +0000)] 
Merge pull request #17829 from anitazha/testoomdfix

test: fix TEST-56-OOMD thresholds for linux 5.9 changes

3 years agoMerge pull request #17834 from yuwata/network-ipv6-reject-type-route
Zbigniew Jędrzejewski-Szmek [Fri, 4 Dec 2020 11:19:35 +0000 (12:19 +0100)] 
Merge pull request #17834 from yuwata/network-ipv6-reject-type-route

network: handle IPv6 routes with reject type correctly

3 years agommap-cache: replace stats accessors with log func
Vito Caputo [Tue, 1 Dec 2020 07:00:34 +0000 (23:00 -0800)] 
mmap-cache: replace stats accessors with log func

In preparation for logging more mmap-cache statistics get rid of this
piecemeal stats accessor api and just have a debug log output function
for producing the stats.

Updates the one call site using these accessors, moving what that site
did into the new log function.  So the output is unchanged for now,
just a trivial refactor.

3 years agoMerge pull request #17843 from poettering/dlfcn-dlsym-arg
Lennart Poettering [Fri, 4 Dec 2020 11:00:53 +0000 (12:00 +0100)] 
Merge pull request #17843 from poettering/dlfcn-dlsym-arg

add DLSYM_ARG() macro helper

3 years agodns-domain: initialize return param on success 17854/head
Lennart Poettering [Mon, 9 Nov 2020 21:26:36 +0000 (22:26 +0100)] 
dns-domain: initialize return param on success

3 years agodns-domain: follow coding style, initialize ret params on success
Lennart Poettering [Fri, 6 Nov 2020 19:24:30 +0000 (20:24 +0100)] 
dns-domain: follow coding style, initialize ret params on success

3 years agotree-wide: make use of new DLSYM_ARG() macro everywhere 17843/head
Lennart Poettering [Thu, 3 Dec 2020 19:21:11 +0000 (20:21 +0100)] 
tree-wide: make use of new DLSYM_ARG() macro everywhere

3 years agodlfcn-util: add DLSYM_ARG() helper
Lennart Poettering [Mon, 30 Nov 2020 16:22:35 +0000 (17:22 +0100)] 
dlfcn-util: add DLSYM_ARG() helper

3 years agotest-network: add tests for IPv6 routes with reject type 17834/head
Yu Watanabe [Thu, 3 Dec 2020 10:09:55 +0000 (19:09 +0900)] 
test-network: add tests for IPv6 routes with reject type

3 years agomeson: check that cxx variable is set before using it
Luca Boccassi [Thu, 3 Dec 2020 16:17:43 +0000 (16:17 +0000)] 
meson: check that cxx variable is set before using it

In some cases it is not defined. Eg in a yocto build:

src/systemd/meson.build:61:15: ERROR: Unknown variable cxx.

3 years agotest-network: sleep 1s after reloading configs
Yu Watanabe [Thu, 3 Dec 2020 05:16:41 +0000 (14:16 +0900)] 
test-network: sleep 1s after reloading configs

As interfaces will be reconfigured asynchronously after `networkctl reload`.
So, right after `networkctl reload` is finished, interfaces may be still
in 'configured' state with the old .network files.

3 years agonetwork: set protocol to route assigned through DHCP6 or DHCP6-PD
Yu Watanabe [Thu, 3 Dec 2020 10:00:56 +0000 (19:00 +0900)] 
network: set protocol to route assigned through DHCP6 or DHCP6-PD

3 years agonetwork: make IPv6 routes with reject type managed by Manager
Yu Watanabe [Thu, 3 Dec 2020 09:51:53 +0000 (18:51 +0900)] 
network: make IPv6 routes with reject type managed by Manager

3 years agonetwork: introduce route_type_is_reject() helper
Yu Watanabe [Thu, 3 Dec 2020 09:44:37 +0000 (18:44 +0900)] 
network: introduce route_type_is_reject() helper

3 years agoMerge pull request #17821 from poettering/local-address-fix
Yu Watanabe [Fri, 4 Dec 2020 02:03:35 +0000 (11:03 +0900)] 
Merge pull request #17821 from poettering/local-address-fix

fix ipv4/ipv6 NXDOMAIN/NODATA confusion for synthesized local addresses

3 years agoresolved: synthesize NODATA instead of NXDOMAIN if gateway exists, but of other protocol 17821/head
Lennart Poettering [Fri, 6 Nov 2020 09:26:44 +0000 (10:26 +0100)] 
resolved: synthesize NODATA instead of NXDOMAIN if gateway exists, but of other protocol

Fixes: #11192
3 years agolocal-addresses: make returning accumulated list optional
Lennart Poettering [Fri, 6 Nov 2020 09:26:40 +0000 (10:26 +0100)] 
local-addresses: make returning accumulated list optional

3 years agoresolved: improve log message when we use TCP a bit
Lennart Poettering [Tue, 10 Nov 2020 17:45:59 +0000 (18:45 +0100)] 
resolved: improve log message when we use TCP a bit

DNS-over-TLS being in use isn't precisely the same as "UDP not
supported". Let's make this clearer.

3 years agoMerge pull request #17809 from yuwata/network-address-fixes-17803
Lennart Poettering [Thu, 3 Dec 2020 20:04:58 +0000 (21:04 +0100)] 
Merge pull request #17809 from yuwata/network-address-fixes-17803

network: two fixes for configuring address correctly

3 years agorandom-util: open /dev/urandom implicitly in random_write_entropy() if needed
Lennart Poettering [Sat, 28 Nov 2020 14:24:44 +0000 (15:24 +0100)] 
random-util: open /dev/urandom implicitly in random_write_entropy() if needed

3 years agoMerge pull request #17836 from poettering/tpm2-condition
Lennart Poettering [Thu, 3 Dec 2020 19:13:45 +0000 (20:13 +0100)] 
Merge pull request #17836 from poettering/tpm2-condition

Add ConditionSecurity=tpm2

3 years agomkosi: Replace iptables-dev with libiptc-dev in debian config
Daan De Meyer [Mon, 30 Nov 2020 23:03:52 +0000 (23:03 +0000)] 
mkosi: Replace iptables-dev with libiptc-dev in debian config

Latest debian unstable doesn't have iptables-dev anymore. Instead,
let's use libiptc-dev.

3 years agoMerge pull request #17079 from keszybz/late-exec-resolution
Lennart Poettering [Thu, 3 Dec 2020 13:58:20 +0000 (14:58 +0100)] 
Merge pull request #17079 from keszybz/late-exec-resolution

Resolve executable paths before execution, use fexecve()

3 years agoMerge pull request #17812 from poettering/systemctl-version-feature-update
Lennart Poettering [Thu, 3 Dec 2020 13:34:08 +0000 (14:34 +0100)] 
Merge pull request #17812 from poettering/systemctl-version-feature-update

build.h: add a bunch of missing features strings

3 years agoshared/build: make the version string definition less terrible 17812/head
Zbigniew Jędrzejewski-Szmek [Thu, 3 Dec 2020 10:12:59 +0000 (11:12 +0100)] 
shared/build: make the version string definition less terrible

The BLKID and ELFUTILS strings were present twice. Let's reaarange things so that
each times requires definition in exactly one place.

Also let's sort things a bit:
the "heavy hitters" like PAM/MAC first,
then crypto libs,
then other libs, alphabetically,
compressors,
and external compat integrations.

I think it's useful for users to group similar concepts together to some extent.
For example, when checking what compression is available, it helps a lot to have
them listed together.

FDISK is renamed to LIBFDISK to make it clear that this is about he library and
the executable.

3 years agoupdate TODO 17836/head
Lennart Poettering [Thu, 3 Dec 2020 11:04:11 +0000 (12:04 +0100)] 
update TODO

3 years agocore: add ConditionSecurity=tpm2 support
Lennart Poettering [Sat, 28 Nov 2020 19:33:53 +0000 (20:33 +0100)] 
core: add ConditionSecurity=tpm2 support

3 years agofw_add_masquerade: remove unused function arguments
Florian Westphal [Fri, 19 Jun 2020 10:41:49 +0000 (12:41 +0200)] 
fw_add_masquerade: remove unused function arguments

Similar to the previous commit.  All callers pass NULL.  This will
ease initial nftables backend implementation (less features to cover).

Add the function parameters as local variables and let compiler
remove branches.  Followup patch can remove the if (NULL) conditionals.

3 years agofw_add_local_dnat: remove unused function arguments
Florian Westphal [Fri, 19 Jun 2020 11:33:19 +0000 (13:33 +0200)] 
fw_add_local_dnat: remove unused function arguments

All users pass a NULL/0 for those, things haven't changed since 2015
when this was added originally, so remove the arguments.

THe paramters are re-added as local function variables, initalised
to NULL or 0.  A followup patch can then manually remove all
if (NULL) rather than leaving dead-branch optimization to compiler.

Reason for not doing it here is to ease patch review.

Not requiring support for this will ease initial nftables backend
implementation.
In case a use-case comues up later this feature can be re-added.

3 years agobuild.h: add a bunch of missing features strings
Lennart Poettering [Wed, 2 Dec 2020 14:36:00 +0000 (15:36 +0100)] 
build.h: add a bunch of missing features strings

Let's make "systemctl --version" more useful for detecting when
build-time features/deps are enabled and which ones arent't again.

3 years agoMerge pull request #17830 from yuwata/update-kernel-headers
Lennart Poettering [Thu, 3 Dec 2020 08:22:01 +0000 (09:22 +0100)] 
Merge pull request #17830 from yuwata/update-kernel-headers

Update kernel headers

3 years agoethtool: add two new link modes 17830/head
Yu Watanabe [Thu, 3 Dec 2020 02:23:50 +0000 (11:23 +0900)] 
ethtool: add two new link modes

3 years agoshared/kernel: update kernel headers
Yu Watanabe [Thu, 3 Dec 2020 02:20:18 +0000 (11:20 +0900)] 
shared/kernel: update kernel headers

From kernel commit 34816d20f173a90389c8a7e641166d8ea9dce70a.

3 years agobasic/linux: update kernel headers
Yu Watanabe [Thu, 3 Dec 2020 02:07:52 +0000 (11:07 +0900)] 
basic/linux: update kernel headers

From kernel commit 34816d20f173a90389c8a7e641166d8ea9dce70a.

3 years agonetwork: ignore broadcast address for /31 or /32 addresses 17809/head
Yu Watanabe [Thu, 3 Dec 2020 01:19:35 +0000 (10:19 +0900)] 
network: ignore broadcast address for /31 or /32 addresses

As they do not have broadcast address.
See https://tools.ietf.org/html/rfc3021

3 years agonetwork: fix verification for broadcast address
Yu Watanabe [Wed, 2 Dec 2020 10:26:41 +0000 (19:26 +0900)] 
network: fix verification for broadcast address

Fixes a bug caused by fe841414ef157f7f01d339c5d5730126e7b5fe0a.

3 years agonetwork: do not set broadcast if prefixlen is 31 or 32
Yu Watanabe [Wed, 2 Dec 2020 10:19:06 +0000 (19:19 +0900)] 
network: do not set broadcast if prefixlen is 31 or 32

After fe841414ef157f7f01d339c5d5730126e7b5fe0a, broadcast address is
also compared with existing one to determine whether the address is
foregin or not. So, the address object should not contain unnecessary
information.

Fixes #17803.

3 years agostub: don't ever respond to datagrams coming in on non-localhost addreses, on the...
Lennart Poettering [Thu, 5 Nov 2020 14:51:12 +0000 (15:51 +0100)] 
stub: don't ever respond to datagrams coming in on non-localhost addreses, on the stub

3 years agoresolved: beef up logic for suppressing "localhost" entry in /etc/hosts
Lennart Poettering [Tue, 10 Nov 2020 22:30:25 +0000 (23:30 +0100)] 
resolved: beef up logic for suppressing "localhost" entry in /etc/hosts

Either suppress the entry entirely, or not at all. But do not suppress
the "localhost" names we recognize, leaving the ones we do not in place.

On Fedora, where "localhost4.localdomain4" is among those listed in
/etc/hosts for 127.0.0.1 we'd thus otherwise drop the "localhost" but
keep the "localhost4.localdomain4" and then on reverse lookups only
return that, which is highly confusing.

3 years agoresolved: use stat_inode_unmodified() to detect /etc/hosts changes
Lennart Poettering [Fri, 6 Nov 2020 13:56:16 +0000 (14:56 +0100)] 
resolved: use stat_inode_unmodified() to detect /etc/hosts changes

3 years agoresolved: never allow _gateway lookups to go to the network
Lennart Poettering [Wed, 11 Nov 2020 16:38:21 +0000 (17:38 +0100)] 
resolved: never allow _gateway lookups to go to the network

Make them rather fail than go to the network.

Previously we'd filter them on LLMNR (explicitly) and MDNS (implicitly,
because it doesn't have .local suffix), but not on DNS.

In order to make _gateway truly reliable, let's not allow it to go to
DNS either, and keep it local.

This is particular relevant, as clients can now request lookups without
local RR synthesis, where we'd rather have NXDOMAIN returned for
_gateway than have it hit the network.

3 years agoresolved: lower SERVFAIL cache timeout from 30s to 10s
Lennart Poettering [Thu, 12 Nov 2020 16:52:09 +0000 (17:52 +0100)] 
resolved: lower SERVFAIL cache timeout from 30s to 10s

Apparently 30s is a bit too long for some cases, see #5552. But not
caching SERVFAIL at all also breaks stuff, see explanation in
201d99584ed7af8078bb243ce2587e5455074713.

Let's try to find some middle ground, by lowering the cache timeout to
10s. This should be ample for the problem
201d99584ed7af8078bb243ce2587e5455074713 attackes, but not as long as
half a miute, as #5552 complains.

Fixes: #5552
3 years agoMerge pull request #17807 from poettering/bindtodevice
Yu Watanabe [Wed, 2 Dec 2020 23:50:43 +0000 (08:50 +0900)] 
Merge pull request #17807 from poettering/bindtodevice

use SO_BINDTOIFINDEX while connect()

3 years agoresolved: insert large dgram size into EDNS0 only when in LARGE UDP mode
Lennart Poettering [Wed, 11 Nov 2020 20:20:15 +0000 (21:20 +0100)] 
resolved: insert large dgram size into EDNS0 only when in LARGE UDP mode

Specifically, in TLS-DO there's no reason to set the exotic dgram size.

3 years agodns-domain: try IDN2003 rules if IDN2008 doesn't work
Lennart Poettering [Mon, 9 Nov 2020 22:10:43 +0000 (23:10 +0100)] 
dns-domain: try IDN2003 rules if IDN2008 doesn't work

This follows more closely what web browsers do, and makes sure emojis in
domains work.

Fixes: #14483
3 years agoAdds missing documentation for Assertions (#17825)
Steve Ramage [Wed, 2 Dec 2020 23:47:24 +0000 (15:47 -0800)] 
Adds missing documentation for Assertions (#17825)

3 years agotest: fix TEST-56-OOMD thresholds for linux 5.9 changes 17829/head
Anita Zhang [Wed, 2 Dec 2020 22:41:38 +0000 (14:41 -0800)] 
test: fix TEST-56-OOMD thresholds for linux 5.9 changes

Fixes #17533

The memory pressure values of the units in TEST-56-OOMD seemed to be a
lot lower after updating to linux 5.9. This is likely due to a fix from
https://github.com/torvalds/linux/commit/e22c6ed90aa91abc08f107344428ebb8c2629e98.

To account for this, I lowered memory.high on testbloat.service to
throttle it even more. This was enough to generate the 50%+ value to trigger
oomd for the test, but as an extra precaution I also lowered the oomd
threshold to 1% so it's certain to try and kill testbloat.service.

3 years agoMerge pull request #17810 from systemd/meson-allows-fuzzer-building
Yu Watanabe [Wed, 2 Dec 2020 22:36:43 +0000 (07:36 +0900)] 
Merge pull request #17810 from systemd/meson-allows-fuzzer-building

meson: always allow fuzzers to be built

3 years agoresolved: automatically flush caches on clock change
Lennart Poettering [Thu, 5 Nov 2020 13:17:37 +0000 (14:17 +0100)] 
resolved: automatically flush caches on clock change

DNSSEC validation takes the system clock into account to validate
signatures. This means if we had incorrect time and the time is then
changed to the correct one we should flush out everything and
re-validate taking the new time into account.

(This logic will also trigger after system suspend, which is not bad
either, given that quite possibly we are connected to a different
network, and thus would get different DNS data, without us noticing
otherwise via link beat).

3 years agovirt: Properly detect nested UML inside another hypervisor
Christopher Obbard [Wed, 2 Dec 2020 14:20:39 +0000 (14:20 +0000)] 
virt: Properly detect nested UML inside another hypervisor

UML runs as a user-process so it can quite easily be ran inside of
another hypervisor, for instance inside a KVM instance. UML passes
through the CPUID from the host machine so in this case detect_vm
incorrectly identifies as running under KVM. So check we are running
a UML kernel first, before we check any other hypervisors.

Resolves: #17754

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
3 years agoresolved: log when a bus client changes per-link DNS info
Lennart Poettering [Thu, 5 Nov 2020 17:45:46 +0000 (18:45 +0100)] 
resolved: log when a bus client changes per-link DNS info

Fixes: #16298
3 years agoMerge pull request #17804 from poettering/write-resolve-conf-less
Zbigniew Jędrzejewski-Szmek [Wed, 2 Dec 2020 15:56:52 +0000 (16:56 +0100)] 
Merge pull request #17804 from poettering/write-resolve-conf-less

write resolv.conf less often

3 years agoresolved: properly check per-link NTA list
Lennart Poettering [Tue, 17 Nov 2020 17:31:53 +0000 (18:31 +0100)] 
resolved: properly check per-link NTA list

We need to check for parent domains too. We did this correctly for the
system-wide NTA list, but not for the per-link one. Let's fix that.

3 years agoresolved: bind socket to interface during connect() 17807/head
Lennart Poettering [Thu, 5 Nov 2020 17:22:38 +0000 (18:22 +0100)] 
resolved: bind socket to interface during connect()

Apparently, IF_UNICAST_IF does not influence the routing decisions done
during connect(). But SO_BINDTODEVICE/SO_BINDTOINDEX does, which however
brings a lot of other semantics with it, we are not so interested in
(i.e. it doesn't not allow packets from any other iface to us, even if
routing otherwise allows it).

Hence, let's bind to the ifindex immediately before the connect() and
unbind right after again, so that we get the semantics we want, but not
the ones we don't.

Fixes: #11935
Replaces: #12004

3 years agosocket-util: add sockaddr_in_addr() helper
Lennart Poettering [Wed, 18 Nov 2020 09:25:27 +0000 (10:25 +0100)] 
socket-util: add sockaddr_in_addr() helper

This extracts the IP address (as union in_addr_union) from a socket
address (i.e. a struct sockaddr).

3 years agoMerge pull request #17707 from yuwata/network-fix-reconfigure
Zbigniew Jędrzejewski-Szmek [Wed, 2 Dec 2020 14:10:34 +0000 (15:10 +0100)] 
Merge pull request #17707 from yuwata/network-fix-reconfigure

network: fix race in reconfiguring link

3 years agoMerge pull request #17798 from yuwata/ipv4ll-follow-ups
Zbigniew Jędrzejewski-Szmek [Wed, 2 Dec 2020 13:59:33 +0000 (14:59 +0100)] 
Merge pull request #17798 from yuwata/ipv4ll-follow-ups

network: improve debug logs and add tests for IPv4LL

3 years agonetwork: add Protocol= to vlan netdev (#17794)
walbit-de [Wed, 2 Dec 2020 13:58:02 +0000 (14:58 +0100)] 
network: add Protocol= to vlan netdev (#17794)

3 years agomeson: allow fuzzers to be built even if fuzz testing is disabled 17810/head
Zbigniew Jędrzejewski-Szmek [Wed, 2 Dec 2020 12:49:24 +0000 (13:49 +0100)] 
meson: allow fuzzers to be built even if fuzz testing is disabled

This makes commands like 'ninja -C build fuzz-journal-remote' or
'ninja -C build fuzzers' work, even if we have -Dfuzz-tests=false.
Two advantages: correctness of the meson declarations is verified even
if fuzzers are not built, and it easier to do a one-off build to check for
regressions or such.

Follow-up for 1763ef1d49cc1263b40f157060a61cdd6e91d3a4.

3 years agonetwork: stop to assign UUID when reconfiguring link 17707/head
Yu Watanabe [Tue, 24 Nov 2020 06:47:13 +0000 (15:47 +0900)] 
network: stop to assign UUID when reconfiguring link

This fixes the following race in reconfiguring link:
1. an interface requests UUID.
2. the interface is reconfigured and link_configure() is called.
3. sd-lldp client is started on the interface (it is enabled by default).
4. networkd acquires UUID, and get_product_uuid_handler() calls
   link_configure() for the link again.
5. link_lldp_rx_configure() fails to set ifindex for already running
   sd-lldp client.
6. the link enters failed state.

3 years agonetwork: use bus_error_message()
Yu Watanabe [Tue, 24 Nov 2020 06:58:04 +0000 (15:58 +0900)] 
network: use bus_error_message()

3 years agomeson: use '_' as separator in fuzz test names
Yu Watanabe [Wed, 2 Dec 2020 09:05:06 +0000 (18:05 +0900)] 
meson: use '_' as separator in fuzz test names

Follow-up for d448888924c1d4815cb97bcd5d94419812c053b9 and ca121e20c42219e3bc4e5cb63dcc96cc5eae2879.

Fixes #17568.

3 years agotree-wide: fix typos
Yu Watanabe [Wed, 2 Dec 2020 08:53:32 +0000 (17:53 +0900)] 
tree-wide: fix typos

3 years agonetwork: add debug log about requesting DHCP address 17798/head
Yu Watanabe [Wed, 2 Dec 2020 07:20:52 +0000 (16:20 +0900)] 
network: add debug log about requesting DHCP address

This addresses
https://github.com/systemd/systemd/pull/17474#discussion_r515996491.

3 years agotest-network: confirm that IPv4ll address is dropped after DHCPv4 lease is acquired
Yu Watanabe [Wed, 2 Dec 2020 07:12:18 +0000 (16:12 +0900)] 
test-network: confirm that IPv4ll address is dropped after DHCPv4 lease is acquired

3 years agosd-ipv4acd: logs current state
Yu Watanabe [Wed, 2 Dec 2020 06:31:30 +0000 (15:31 +0900)] 
sd-ipv4acd: logs current state

3 years agosd-ipv4acd,sd-ipv4ll: include interface name in the debug logs
Yu Watanabe [Wed, 2 Dec 2020 06:21:35 +0000 (15:21 +0900)] 
sd-ipv4acd,sd-ipv4ll: include interface name in the debug logs

3 years agolog-link: introduce log_interface_full_errno() macro
Yu Watanabe [Wed, 2 Dec 2020 06:15:50 +0000 (15:15 +0900)] 
log-link: introduce log_interface_full_errno() macro

3 years agosd-ipv4acd,sd-ipv4ll: introduce _get_ifindex() and _get_ifname()
Yu Watanabe [Wed, 2 Dec 2020 06:00:06 +0000 (15:00 +0900)] 
sd-ipv4acd,sd-ipv4ll: introduce _get_ifindex() and _get_ifname()

They will be used in later commits.

This also makes sd_ipv4acd_set_ifindex() check the existence of the interface.