]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 years agoMerge pull request #16106 from yuwata/network-tc-ets
Lennart Poettering [Wed, 24 Jun 2020 17:04:43 +0000 (19:04 +0200)] 
Merge pull request #16106 from yuwata/network-tc-ets

network: tc: introduce ETS

3 years agoMerge pull request #16238 from keszybz/set-handling-more
Zbigniew Jędrzejewski-Szmek [Wed, 24 Jun 2020 15:42:13 +0000 (17:42 +0200)] 
Merge pull request #16238 from keszybz/set-handling-more

Fix handling of cases where a duplicate item is added to a set and related cleanups

3 years agolog: introduce log_parse_environment_cli() and log_setup_cli()
Filipe Brandenburger [Wed, 17 Jun 2020 19:17:54 +0000 (12:17 -0700)] 
log: introduce log_parse_environment_cli() and log_setup_cli()

Presently, CLI utilities such as systemctl will check whether they have a tty
attached or not to decide whether to parse /proc/cmdline or EFI variable
SystemdOptions looking for systemd.log_* entries.

But this check will be misleading if these tools are being launched by a
daemon, such as a monitoring daemon or automation service that runs in
background.

Make log handling of CLI tools uniform by never checking /proc/cmdline or EFI
variables to determine the logging level.

Furthermore, introduce a new log_setup_cli() shortcut to set up common options
used by most command-line utilities.

3 years agosysv-generator: reduce scope of variables 16238/head
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jun 2020 13:53:55 +0000 (15:53 +0200)] 
sysv-generator: reduce scope of variables

3 years agosocket-proxy: use structured initialization in one place
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jun 2020 13:53:44 +0000 (15:53 +0200)] 
socket-proxy: use structured initialization in one place

3 years agobasic/hashmap,set: propagate allocation location info in _copy()
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jun 2020 12:55:41 +0000 (14:55 +0200)] 
basic/hashmap,set: propagate allocation location info in _copy()

Also use double space before the tracking args at the end. Without
the comma this looks ugly, but it's a bit better with the double space.
At least it doesn't look like a variable with a type.

3 years agotree-wide: use set_ensure_consume() in various places
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jun 2020 12:40:08 +0000 (14:40 +0200)] 
tree-wide: use set_ensure_consume() in various places

No funtional change.

3 years agonetworkd: take ref immediately after storing item in set
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jun 2020 12:24:57 +0000 (14:24 +0200)] 
networkd: take ref immediately after storing item in set

I'm not sure if I understand the code correctly, but it seems that if
storig in the second set failed, we'd return with the first set having
no reference on the link object, and the link object could be freed in the
future, leaving the set with a dangling reference.

3 years agocore/bpf-firewall: use the correct cleanup function
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jun 2020 12:16:04 +0000 (14:16 +0200)] 
core/bpf-firewall: use the correct cleanup function

On error, we'd just free the object, and not close the fd.

While at it, let's use set_ensure_consume() to make sure we don't leak
the object if it was already in the set. I'm not sure if that condition
can be achieved.

3 years agologind: fix possible memleak of message if the message was already in the set
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jun 2020 12:07:44 +0000 (14:07 +0200)] 
logind: fix possible memleak of message if the message was already in the set

I'm not sure if it is actually possible to encounter this condition. But
let's make the handling correct regardless.

3 years agoportable: rework set handling in portable_detach()
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jun 2020 12:06:02 +0000 (14:06 +0200)] 
portable: rework set handling in portable_detach()

_cleanup_set_free_ is enough for unit_files, because unit_files is
allocated in set_put_strdup(), which uses string_hash_ops_free.

This fixes a leak if marker was already present in the table.

3 years agoresolved: fix memleak on duplicate host lines in /etc/hosts
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jun 2020 12:03:30 +0000 (14:03 +0200)] 
resolved: fix memleak on duplicate host lines in /etc/hosts

3 years agoresolved: simplify allocation failure handling in dns_stub_process_query()
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jun 2020 06:46:08 +0000 (08:46 +0200)] 
resolved: simplify allocation failure handling in dns_stub_process_query()

Old code was correct, but let's make things more explicit.

3 years agobasic/set,hashmap: pass through allocation info in more cases
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jun 2020 17:58:18 +0000 (19:58 +0200)] 
basic/set,hashmap: pass through allocation info in more cases

3 years agobasic/set: add set_ensure_consume()
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jun 2020 17:46:14 +0000 (19:46 +0200)] 
basic/set: add set_ensure_consume()

This combines set_ensure_allocated() with set_consume(). The cool thing is that
because we know the hash ops, we can correctly free the item if appropriate.
Similarly to set_consume(), the goal is to simplify handling of the case where
the item needs to be freed on error and if already present in the set.

3 years agofeature to honor first shutdown request to completion
Jay Burger [Fri, 10 Apr 2020 21:38:42 +0000 (16:38 -0500)] 
feature to honor first shutdown request to completion

Create unit tests per established norm at position 52

check in_set first before getting unit

3 years agoMerge pull request #16112 from poettering/nss-systemd-block-fix
Lennart Poettering [Wed, 24 Jun 2020 06:39:44 +0000 (08:39 +0200)] 
Merge pull request #16112 from poettering/nss-systemd-block-fix

rework nss-systemd recursion lock

3 years agoMerge pull request #16223 from cgzones/user_selinux
Lennart Poettering [Wed, 24 Jun 2020 06:39:13 +0000 (08:39 +0200)] 
Merge pull request #16223 from cgzones/user_selinux

Initialize SELinux in user instances

3 years agoselinux: update mac_selinux_free()
Christian Göttsche [Tue, 23 Jun 2020 10:26:59 +0000 (12:26 +0200)] 
selinux: update mac_selinux_free()

* Drop mac_selinux_use() condition from mac_selinux_free(): if the
  passed pointer holds memory we want to free it even if SELinux is
  disabled

* Drop NULL-check cause man:freecon(3) states that freecon(NULL) is a
  well-defined NOP

* Assert that on non-SELinux builds the passed pointer is always NULL,
  to avoid memory leaks

3 years agohwdb: add another Logitech G502 Hero variant (#16256)
Gigadoc2 [Tue, 23 Jun 2020 23:46:46 +0000 (23:46 +0000)] 
hwdb: add another Logitech G502 Hero variant (#16256)

The commit 67551ea already adds the G502 Hero mouse, but apparently
there are multiple variants with the same ID but different names.

3 years agoMerge pull request #16246 from benzea/benzea/xdg-autostart
Zbigniew Jędrzejewski-Szmek [Tue, 23 Jun 2020 19:13:07 +0000 (21:13 +0200)] 
Merge pull request #16246 from benzea/benzea/xdg-autostart

Minor xdg-autostart changes

3 years agoMerge pull request #16213 from yuwata/network-cleanup-link-state-file
Zbigniew Jędrzejewski-Szmek [Tue, 23 Jun 2020 19:09:24 +0000 (21:09 +0200)] 
Merge pull request #16213 from yuwata/network-cleanup-link-state-file

network: cleanup link state file

3 years agomake-autosuspend-rules: restore compatibility with Python3 < 3.6
Luca Boccassi [Tue, 23 Jun 2020 10:45:50 +0000 (11:45 +0100)] 
make-autosuspend-rules: restore compatibility with Python3 < 3.6

The f'...' format was introduced in Python 3.6 ( https://www.python.org/dev/peps/pep-0498/ )
and returns an error when systemd is built on a system with an older Python3 version:

<...>
  File /home/bluca/git/systemd/tools/make-autosuspend-rules.py, line 15
    print(f'pci:v{vendor:08X}d{device:08X}*')
                                           ^
SyntaxError: invalid syntax
[2/388] Generating version.h with a custom command.
ninja: build stopped: subcommand failed.
$ python3 --version
Python 3.5.6

Use an older format to keep backward compatibility.

3 years agoMake failures of mac_selinux_init() fatal 16223/head
Christian Göttsche [Fri, 19 Jun 2020 17:29:24 +0000 (19:29 +0200)] 
Make failures of mac_selinux_init() fatal

3 years agoInitialize SELinux in user instances
Christian Göttsche [Fri, 19 Jun 2020 16:24:10 +0000 (18:24 +0200)] 
Initialize SELinux in user instances

Call mac_selinux_init() to setup the label cache, so objects can be
created with default SELinux context.

Fixes: #8004
3 years agouserdb: replace recursion lock 16112/head
Lennart Poettering [Thu, 4 Jun 2020 09:46:36 +0000 (11:46 +0200)] 
userdb: replace recursion lock

Previously we'd used the existance of a specific AF_UNIX socket in the
abstract namespace as lock for disabling lookup recursions. (for
breaking out of the loop: userdb synthesized from nss → nss synthesized
from userdb → userdb synthesized from nss → …)

I did it like that because it promised to work the same both in static
and in dynmically linked environments and is accessible easily from any
programming language.

However, it has a weakness regarding reuse attacks: the socket is
securely hashed (siphash) from the thread ID in combination with the
AT_RANDOM secret. Thus it should not be guessable from an attacker in
advance. That's only true if a thread takes the lock only once and
keeps it forever. However, if a thread takes and releases it multiple
times an attacker might monitor that and quickly take the lock
after the first iteration for follow-up iterations.

It's not a big issue given that userdb (as the primary user for this)
never released the lock and we never made the concept a public
interface, and it was only included in one release so far, but it's
something that deserves fixing. (moreover it's a local DoS only, only
permitting to disable native userdb lookups)

With this rework the libnss_systemd.so.2 module will now export two
additional symbols. These symbols are not used by glibc, but can be used
by arbitrary programs: one can be used to disable nss-systemd, the other
to check if it is currently disabled.

The lock is per-thread. It's slightly less pretty, since it requires
people to manually link against C code via dlopen()/dlsym(), but it
should work safely without the aforementioned weakness.

3 years agonss-systemd: skip /etc/gshadow look-ups when we just need the GID of a group
Lennart Poettering [Tue, 9 Jun 2020 08:47:43 +0000 (10:47 +0200)] 
nss-systemd: skip /etc/gshadow look-ups when we just need the GID of a group

3 years agoutil: add dlfcn-util.h
Lennart Poettering [Thu, 4 Jun 2020 09:25:46 +0000 (11:25 +0200)] 
util: add dlfcn-util.h

This just adds a _cleanup_ helper call encapsulating dlclose().

This also means libsystemd-shared is linked against libdl now. I don't
think this is much of an issue, since libdl is part of glibc anyway, and
anything from exotic. It's not an optional part of the OS (think: NSS
requires dynamic linking), hence this pulls in no deps and is almost
certainly loaded into all process' memory anyway.

[zj: use DEFINE_TRIVIAL_CLEANUP_FUNC().]

3 years agoman: replace perl bug tracker link that went away with link to paper
Lennart Poettering [Tue, 23 Jun 2020 15:11:47 +0000 (17:11 +0200)] 
man: replace perl bug tracker link that went away with link to paper

Fixes: #16245
3 years agoman: s/PROGRAMM/PROGRAM/
Lennart Poettering [Tue, 23 Jun 2020 15:06:42 +0000 (17:06 +0200)] 
man: s/PROGRAMM/PROGRAM/

3 years agoRevert "cgroup: Allow empty assignments of Memory{Low,Min}="
Zbigniew Jędrzejewski-Szmek [Tue, 23 Jun 2020 09:35:39 +0000 (11:35 +0200)] 
Revert "cgroup: Allow empty assignments of Memory{Low,Min}="

This reverts commit 53aa85af24cda4470b6750f88e181b775385e228.
The reason is that that patch changes the dbus api to be different than
the types declared by introspection api.

Replaces #16122.

3 years agonetworkctl: display DHCPv4 server address 16213/head
Susant Sahani [Thu, 18 Jun 2020 15:01:21 +0000 (00:01 +0900)] 
networkctl: display DHCPv4 server address

3 years agodhcp: fix entry name in parsing lease file
Yu Watanabe [Thu, 18 Jun 2020 14:59:38 +0000 (23:59 +0900)] 
dhcp: fix entry name in parsing lease file

3 years agonetwork: drop duplicated information from link state file
Yu Watanabe [Thu, 18 Jun 2020 14:35:09 +0000 (23:35 +0900)] 
network: drop duplicated information from link state file

Those entries are already in DHCP4 lease file, and not used anymore.

3 years agosd-network: drop unused functions
Yu Watanabe [Thu, 18 Jun 2020 14:31:32 +0000 (23:31 +0900)] 
sd-network: drop unused functions

3 years agonetworkctl: use lease file to get DHCPv4 client ID
Yu Watanabe [Thu, 18 Jun 2020 14:24:06 +0000 (23:24 +0900)] 
networkctl: use lease file to get DHCPv4 client ID

3 years agonetworkctl: use lease file to get DHCPv4 address
Yu Watanabe [Thu, 18 Jun 2020 14:18:27 +0000 (23:18 +0900)] 
networkctl: use lease file to get DHCPv4 address

3 years agonetworkctl: load DHCPv4 lease file and use timezone data from the lease file
Yu Watanabe [Thu, 18 Jun 2020 14:02:31 +0000 (23:02 +0900)] 
networkctl: load DHCPv4 lease file and use timezone data from the lease file

3 years agolibsystemd-network: move prototypes of dhcp_lese_save/load() to network-internal.h
Yu Watanabe [Thu, 18 Jun 2020 14:01:05 +0000 (23:01 +0900)] 
libsystemd-network: move prototypes of dhcp_lese_save/load() to network-internal.h

3 years agoRevert "job: Don't mark as redundant if deps are relevant"
Dave Reisner [Thu, 11 Jun 2020 14:34:13 +0000 (10:34 -0400)] 
Revert "job: Don't mark as redundant if deps are relevant"

This reverts commit 097537f07a2fab3cb73aef7bc59f2a66aa93f533.

At least Fedora and Debian have already reverted this at the distro
level because it causes more problems than it solves. Arch is debating
reverting it as well [0] but would strongly prefer that this happens
upstream first. Fixes #15188.

[0] https://bugs.archlinux.org/task/66458

3 years agoxdg-autostart: Ignore all files with GNOME autostart phase 16246/head
Benjamin Berg [Tue, 23 Jun 2020 08:44:50 +0000 (10:44 +0200)] 
xdg-autostart: Ignore all files with GNOME autostart phase

If an autostart file for GNOME has a phase specified, then this implies
it is a session service that needs to be started at a specific time.

We have no way of handling the ordering, and while it does make sense
to explicitly hide these services with X-systemd-skip, there is no point
in even trying to handle them.

3 years agoxdg-autostart: Fix info message if Type= is not Application
Benjamin Berg [Tue, 23 Jun 2020 08:38:08 +0000 (10:38 +0200)] 
xdg-autostart: Fix info message if Type= is not Application

The message was copy-pasted and not changed to correctly specify what
the problem was.

3 years agocore: add RootHash and RootVerity service parameters
Luca Boccassi [Wed, 3 Jun 2020 08:50:45 +0000 (09:50 +0100)] 
core: add RootHash and RootVerity service parameters

Allow to explicitly pass root hash (explicitly or as a file) and verity
device/file as unit options. Take precedence over implicit checks.

3 years agonspawn: mkdir selinux mount point once, but not twice
Lennart Poettering [Tue, 16 Jun 2020 14:50:46 +0000 (16:50 +0200)] 
nspawn: mkdir selinux mount point once, but not twice

Since #15533 we didn't create the mount point for selinuxfs anymore.

Before it we created it twice because we mount selinuxfs twice: once the
superblock, and once we remount its bind mound read-only. The second
mkdir would mean we'd chown() the host version of selinuxfs (since
there's only one selinuxfs superblock kernel-wide).

The right time to create mount point point is once: before we mount the
selinuxfs. But not a second time for the remount.

Fixes: #16032
3 years agoMerge pull request #16196 from mrc0mmand/travis-simplification
Zbigniew Jędrzejewski-Szmek [Tue, 23 Jun 2020 08:16:18 +0000 (10:16 +0200)] 
Merge pull request #16196 from mrc0mmand/travis-simplification

travis: use a matrix for similar jobs

3 years agoMerge pull request #16216 from nabijaczleweli/make-a-fuss
Zbigniew Jędrzejewski-Szmek [Tue, 23 Jun 2020 08:12:47 +0000 (10:12 +0200)] 
Merge pull request #16216 from nabijaczleweli/make-a-fuss

man/sd-makefs: mention that mkswap can also be run and fix deadlink to btrfs-man5(5)

3 years agoselinux-util: tweak log_enforcing_errno() to return the errno passed in or 0 when...
Lennart Poettering [Mon, 22 Jun 2020 13:37:12 +0000 (15:37 +0200)] 
selinux-util: tweak log_enforcing_errno() to return the errno passed in or 0 when in non-enforcing mode

Also, some other, minor modernizations.

3 years agotest-functions: read /usr/etc/nsswitch.conf if /etc/nsswitch.conf does not exist...
Elisei Roca [Tue, 23 Jun 2020 05:42:15 +0000 (07:42 +0200)] 
test-functions: read /usr/etc/nsswitch.conf if /etc/nsswitch.conf does not exist (#16195)

See this for more info why and since when this change is needed: https://build.opensuse.org/request/show/807179.

3 years agoman/sd-makefs: link to btrfs.wiki.kernel.org for btrfs-man5, since the man-pages... 16216/head
наб [Thu, 18 Jun 2020 23:55:09 +0000 (01:55 +0200)] 
man/sd-makefs: link to btrfs.wiki.kernel.org for btrfs-man5, since the man-pages link is dead

This also adds a <citerefentry project="url"> type,
since the other btrfs manpages use man-pages/die-net and are alive,
and btrfs.w.k.o won't be used anywhere else

3 years agoMerge pull request #16237 from keszybz/revert-message-type-check
Zbigniew Jędrzejewski-Szmek [Mon, 22 Jun 2020 20:46:13 +0000 (22:46 +0200)] 
Merge pull request #16237 from keszybz/revert-message-type-check

Revert "bus-message: immediately reject messages with invalid type"

3 years agoMerge pull request #16179 from keszybz/auto-suspend-hwdb
Lennart Poettering [Mon, 22 Jun 2020 15:38:42 +0000 (17:38 +0200)] 
Merge pull request #16179 from keszybz/auto-suspend-hwdb

Convert autosuspend rules to hwdb

3 years agobus-message: add macro for calculation of offset from the page 16237/head
Zbigniew Jędrzejewski-Szmek [Mon, 22 Jun 2020 15:18:35 +0000 (17:18 +0200)] 
bus-message: add macro for calculation of offset from the page

3 years agobus-message: avoid dereferencing a NULL pointer
Zbigniew Jędrzejewski-Szmek [Mon, 22 Jun 2020 15:09:49 +0000 (17:09 +0200)] 
bus-message: avoid dereferencing a NULL pointer

We'd try to map a zero-byte buffer from a NULL pointer, which is undefined behaviour.

src/systemd/src/libsystemd/sd-bus/bus-message.c:3161:60: runtime error: applying zero offset to null pointer
    #0 0x7f6ff064e691 in find_part /work/build/../../src/systemd/src/libsystemd/sd-bus/bus-message.c:3161:60
    #1 0x7f6ff0640788 in message_peek_body /work/build/../../src/systemd/src/libsystemd/sd-bus/bus-message.c:3283:16
    #2 0x7f6ff064e8db in enter_struct_or_dict_entry /work/build/../../src/systemd/src/libsystemd/sd-bus/bus-message.c:3967:21
    #3 0x7f6ff06444ac in bus_message_enter_struct /work/build/../../src/systemd/src/libsystemd/sd-bus/bus-message.c:4009:13
    #4 0x7f6ff0641dde in sd_bus_message_enter_container /work/build/../../src/systemd/src/libsystemd/sd-bus/bus-message.c:4136:21
    #5 0x7f6ff0619874 in sd_bus_message_dump /work/build/../../src/systemd/src/libsystemd/sd-bus/bus-dump.c:178:29
    #6 0x4293d9 in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/fuzz/fuzz-bus-message.c:39:9
    #7 0x441986 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/libfuzzer/FuzzerLoop.cpp:558:15
    #8 0x44121e in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool*) /src/libfuzzer/FuzzerLoop.cpp:470:3
    #9 0x443164 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__1::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /src/libfuzzer/FuzzerLoop.cpp:770:7
    #10 0x4434bc in fuzzer::Fuzzer::Loop(std::__1::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /src/libfuzzer/FuzzerLoop.cpp:799:3
    #11 0x42d2bc in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/libfuzzer/FuzzerDriver.cpp:846:6
    #12 0x42978a in main /src/libfuzzer/FuzzerMain.cpp:19:10
    #13 0x7f6fef13c82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #14 0x407808 in _start (out/fuzz-bus-message+0x407808)

3 years agoRevert "bus-message: immediately reject messages with invalid type"
Zbigniew Jędrzejewski-Szmek [Sun, 21 Jun 2020 14:15:23 +0000 (16:15 +0200)] 
Revert "bus-message: immediately reject messages with invalid type"

This reverts commit a2dd991d0fde59dc0574bd4d0c1438f01dc0b8ff.
Creation of such messages is evidently useful, and at least sdbus-c++ test
suite depends on that.

Fixes #16193.

3 years agoshared/bus-util: fix misleading error handling
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jun 2020 15:41:18 +0000 (17:41 +0200)] 
shared/bus-util: fix misleading error handling

set_put()/set_ensure_put() return 0, not -EEXIST, if the entry is already
found in the set. In this case this does not make any difference, but let's
not confuse the reader.

3 years agoudevadm-monitor: simplify creation of arg_tag_filter set
Zbigniew Jędrzejewski-Szmek [Thu, 4 Jun 2020 15:21:42 +0000 (17:21 +0200)] 
udevadm-monitor: simplify creation of arg_tag_filter set

This version is more efficient, which doesn't matter, but it allows us
to remove a bunch of error handling, which is always nice.

3 years agofuzz-netdev-parser: add test case for earlier version of preceding patches
Zbigniew Jędrzejewski-Szmek [Mon, 22 Jun 2020 14:27:02 +0000 (16:27 +0200)] 
fuzz-netdev-parser: add test case for earlier version of preceding patches

AddressSanitizer:DEADLYSIGNAL
=================================================================
==12==ERROR: AddressSanitizer: ABRT on unknown address 0x00000000000c (pc 0x7f0a518b3428 bp 0x7fffa463bfd0 sp 0x7fffa463be68 T0)
SCARINESS: 10 (signal)
    #0 0x7f0a518b3428 in raise (/lib/x86_64-linux-gnu/libc.so.6+0x35428)
    #1 0x7f0a518b5029 in abort (/lib/x86_64-linux-gnu/libc.so.6+0x37029)
    #2 0x7f0a52ca635a in log_assert_failed_realm /work/build/../../src/systemd/src/basic/log.c:819:9
    #3 0x4eea92 in config_parse_wireguard_endpoint /work/build/../../src/systemd/src/network/netdev/wireguard.c:808:9
    #4 0x7f0a52b2f74e in next_assignment /work/build/../../src/systemd/src/shared/conf-parser.c:133:32
    #5 0x7f0a52b2954e in parse_line /work/build/../../src/systemd/src/shared/conf-parser.c:242:16
    #6 0x7f0a52b28911 in config_parse /work/build/../../src/systemd/src/shared/conf-parser.c:377:21
    #7 0x7f0a52b29ec6 in config_parse_many_files /work/build/../../src/systemd/src/shared/conf-parser.c:439:21
    #8 0x7f0a52b2a5a6 in config_parse_many /work/build/../../src/systemd/src/shared/conf-parser.c:507:16
    #9 0x4d8d6c in netdev_load_one /work/build/../../src/systemd/src/network/netdev/netdev.c:732:13
    #10 0x4d3e2b in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/network/fuzz-netdev-parser.c:23:16
    #11 0x6b3266 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/libfuzzer/FuzzerLoop.cpp:558:15
    #12 0x6af860 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool*) /src/libfuzzer/FuzzerLoop.cpp:470:3
    #13 0x6b6970 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__1::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /src/libfuzzer/FuzzerLoop.cpp:770:7
    #14 0x6b7376 in fuzzer::Fuzzer::Loop(std::__1::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /src/libfuzzer/FuzzerLoop.cpp:799:3
    #15 0x67573f in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/libfuzzer/FuzzerDriver.cpp:846:6
    #16 0x667097 in main /src/libfuzzer/FuzzerMain.cpp:19:10
    #17 0x7f0a5189e82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #18 0x4295a8 in _start (out/fuzz-netdev-parser+0x4295a8)

DEDUP_TOKEN: raise--abort--log_assert_failed_realm
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: ABRT (/lib/x86_64-linux-gnu/libc.so.6+0x35428) in raise
==12==ABORTING

3 years agonetdev/wireguard: do not invalidate peer on invalid syntax
Zbigniew Jędrzejewski-Szmek [Mon, 22 Jun 2020 13:55:04 +0000 (15:55 +0200)] 
netdev/wireguard: do not invalidate peer on invalid syntax

We would say "ignoring", but invalidate the peer anyway.
Let's only do that if we modified the peer irreperably.

Also add comments explaining allocation handling.

3 years agotree-wide: use set_ensure_put()
Zbigniew Jędrzejewski-Szmek [Fri, 5 Jun 2020 13:12:29 +0000 (15:12 +0200)] 
tree-wide: use set_ensure_put()

Patch contains a coccinelle script, but it only works in some cases. Many
parts were converted by hand.

Note: I did not fix errors in return value handing. This will be done separate
to keep the patch comprehensible. No functional change is intended in this
patch.

3 years agobasic/set: add set_ensure_put()
Zbigniew Jędrzejewski-Szmek [Wed, 3 Jun 2020 12:25:18 +0000 (14:25 +0200)] 
basic/set: add set_ensure_put()

It's such a common operation to allocate the set and put an item in it,
that it deserves a helper. set_ensure_put() has the same return values
as set_put().

Comes with tests!

3 years agosd-device: use set_put_strdup() in one more place
Zbigniew Jędrzejewski-Szmek [Wed, 3 Jun 2020 12:58:01 +0000 (14:58 +0200)] 
sd-device: use set_put_strdup() in one more place

3 years agoresolved: introduce dns_transaction_gcp()
Zbigniew Jędrzejewski-Szmek [Wed, 3 Jun 2020 12:25:18 +0000 (14:25 +0200)] 
resolved: introduce dns_transaction_gcp()

3 years agomake-autosuspend-rules: remove one instance of "whitelist" 16179/head
Zbigniew Jędrzejewski-Szmek [Mon, 22 Jun 2020 12:41:50 +0000 (14:41 +0200)] 
make-autosuspend-rules: remove one instance of "whitelist"

Let's be clear what we mean exactly. Also see https://lwn.net/Articles/823224/
for general justification.

3 years agorules: remove 61-autosuspend-manual.rules
Zbigniew Jędrzejewski-Szmek [Mon, 22 Jun 2020 12:38:01 +0000 (14:38 +0200)] 
rules: remove 61-autosuspend-manual.rules

It doesn't hurt, but there's no point in keeping it now. Any changes
can be added to 60-autosuspend.hwdb.

3 years agohwdb: enable autosuspend for Wacom Pen and EMV Smartcard Reader
Zbigniew Jędrzejewski-Szmek [Thu, 18 Jun 2020 16:38:58 +0000 (18:38 +0200)] 
hwdb: enable autosuspend for Wacom Pen and EMV Smartcard Reader

Replaces #16113.

3 years agotest: also verify the generated autosuspend hwdb file
Zbigniew Jędrzejewski-Szmek [Sun, 14 Jun 2020 10:43:42 +0000 (12:43 +0200)] 
test: also verify the generated autosuspend hwdb file

Hint: meson test -C build parse-hwdb -v

3 years agotools: rewrite make-autosuspend-rules.py and add udev rules
Zbigniew Jędrzejewski-Szmek [Sat, 13 Jun 2020 15:52:41 +0000 (17:52 +0200)] 
tools: rewrite make-autosuspend-rules.py and add udev rules

Concatenating strings is not a very efficient approach. And in this case fully
unnecessary. We also need some rules to make use of those hwdb entries.

PCI needs to be 8 characters, not 4. And we need to use uppercase hexadecimal
for both. With udev rules this made no difference, but hwdb match is case
sensitive.

Fixes #16119.

3 years agoMerge pull request #16235 from yuwata/network-fix-warning-16224
Zbigniew Jędrzejewski-Szmek [Mon, 22 Jun 2020 12:29:50 +0000 (14:29 +0200)] 
Merge pull request #16235 from yuwata/network-fix-warning-16224

network: fix compile error

3 years agolog: Prefer logging to CLI unless JOURNAL_STREAM is set
Daan De Meyer [Wed, 10 Jun 2020 18:19:41 +0000 (20:19 +0200)] 
log: Prefer logging to CLI unless JOURNAL_STREAM is set

3 years agoMerge pull request #16059 from keszybz/resolve-single-label-names
Lennart Poettering [Mon, 22 Jun 2020 12:00:31 +0000 (14:00 +0200)] 
Merge pull request #16059 from keszybz/resolve-single-label-names

Optionally resolve single label names

3 years agoMerge pull request #15926 from fbuihuu/rework-show-status
Lennart Poettering [Mon, 22 Jun 2020 11:55:06 +0000 (13:55 +0200)] 
Merge pull request #15926 from fbuihuu/rework-show-status

Rework show status

3 years agoman: add note regarding editing user groups
ignapk [Fri, 19 Jun 2020 06:29:59 +0000 (08:29 +0200)] 
man: add note regarding editing user groups

Currently the manual doesn't clearly say whether `homectl update username -G group` will append the group to the user, or overwrite the list and remove user from the groups that aren't specified.

Fix this by updating the manual, basing the change on the usermod manual.

3 years agonetwork: add missing break
Yu Watanabe [Mon, 22 Jun 2020 04:10:39 +0000 (13:10 +0900)] 
network: add missing break

Follow-up for 2a71d57f4e63e4492a7c2d6d747e498d0c5521cd.

3 years agoMerge pull request #16239 from keszybz/cleanups
Lennart Poettering [Mon, 22 Jun 2020 10:48:49 +0000 (12:48 +0200)] 
Merge pull request #16239 from keszybz/cleanups

Two minor tweaks

3 years agoci: pass -Werror using CFLAGS 16235/head
Evgeny Vereshchagin [Fri, 19 Jun 2020 22:44:09 +0000 (00:44 +0200)] 
ci: pass -Werror using CFLAGS

Judging by https://github.com/systemd/systemd/issues/16224, it seems
`--werror` doesn't work with `-Db_lto=true`

3 years agonetwork: drop unnecessary "&"
Yu Watanabe [Mon, 22 Jun 2020 03:13:20 +0000 (12:13 +0900)] 
network: drop unnecessary "&"

This confuses gcc-10 with -O3 -flto.

Closes #16224.

3 years agoman: Fix a typo of session
Matthew Leeds [Fri, 19 Jun 2020 03:43:40 +0000 (20:43 -0700)] 
man: Fix a typo of session

3 years agoman/sd-makefs: also mention /sbin/mkswap
наб [Thu, 18 Jun 2020 23:15:20 +0000 (01:15 +0200)] 
man/sd-makefs: also mention /sbin/mkswap

3 years agoman: document the new option 16059/head
Zbigniew Jędrzejewski-Szmek [Wed, 3 Jun 2020 15:01:34 +0000 (17:01 +0200)] 
man: document the new option

Also correct "stub resolver" → "systemd-resolved" in one other option.

3 years agoresolved: optionally allow single-label A/AAAA queries
Zbigniew Jędrzejewski-Szmek [Wed, 3 Jun 2020 11:10:23 +0000 (13:10 +0200)] 
resolved: optionally allow single-label A/AAAA queries

3 years agoresolved: drop bit-field annotations for fields in Manager
Zbigniew Jędrzejewski-Szmek [Wed, 3 Jun 2020 11:09:59 +0000 (13:09 +0200)] 
resolved: drop bit-field annotations for fields in Manager

Access to bit fields is less efficient, and since the Manager is a singleton,
a byte or two of space in the structure doesn't matter at all. (And in this
particular case, because of alignment issues, we wouldn't save anything
anyway.)

3 years agoresolved: add dns_query_candidate_freep()
Zbigniew Jędrzejewski-Szmek [Wed, 3 Jun 2020 10:53:27 +0000 (12:53 +0200)] 
resolved: add dns_query_candidate_freep()

3 years agoman: rework description of Domains=
Zbigniew Jędrzejewski-Szmek [Tue, 2 Jun 2020 16:21:04 +0000 (18:21 +0200)] 
man: rework description of Domains=

We said that ~domains "do not define a search path", which is mighty confusing,
because this is exactly what they do. So let's try to make this a bit easier
for the reader: start by saying that there are two things going on here, and
describe each one from user's POV.

3 years agoudev: do not execute hwdb builtin import twice or thrice
Zbigniew Jędrzejewski-Szmek [Sun, 14 Jun 2020 16:34:27 +0000 (18:34 +0200)] 
udev: do not execute hwdb builtin import twice or thrice

Running the import more than once shouldn't matter, but it's a bit confusing
and causes a slowdown too. This patch reworks the rules to avoid duplicted runs,
but tries to keep the same imports. (E.g. import for pci devices without MODALIAS
is only done for tty devices.)

Note that this is only about hwdb import with argument, which uses MODALIAS as
the lookup key. There are other imports done with different lookup keys.

3 years agotest-network: add tests for ETS 16106/head
Yu Watanabe [Tue, 9 Jun 2020 08:24:04 +0000 (17:24 +0900)] 
test-network: add tests for ETS

3 years agonetwork: tc: introduce Enhanced Transmission Selection (ETS)
Yu Watanabe [Tue, 9 Jun 2020 08:23:11 +0000 (17:23 +0900)] 
network: tc: introduce Enhanced Transmission Selection (ETS)

Closes #15264.

3 years agosd-netlink: add netlink properties of Enhanced Transmission Selection (ETS)
Yu Watanabe [Tue, 9 Jun 2020 08:21:57 +0000 (17:21 +0900)] 
sd-netlink: add netlink properties of Enhanced Transmission Selection (ETS)

3 years agosd-boot: Add small comments after device-specific key macros
Paul Cercueil [Mon, 15 Jun 2020 10:54:28 +0000 (12:54 +0200)] 
sd-boot: Add small comments after device-specific key macros

The key macros added in commit 6fe95d3020 look strange at first sight.
Add a comment with just the tablet name after each line, so that it's
obvious that these lines address device-specific issues of the EFI
firmware, and not broken/old code.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
3 years agoMerge pull request #16191 from poettering/repart-spec
Lennart Poettering [Thu, 18 Jun 2020 13:53:31 +0000 (15:53 +0200)] 
Merge pull request #16191 from poettering/repart-spec

repart: add specifier expansion to Label= + bump default mininum size to 10M

3 years agoMerge pull request #16208 from yuwata/udev-fix-16207
Lennart Poettering [Thu, 18 Jun 2020 13:52:07 +0000 (15:52 +0200)] 
Merge pull request #16208 from yuwata/udev-fix-16207

udev: fixes error handling of sd_device_get_parent()

3 years agonetwork: do not fail to configure non-nl80211 wifi interfaces
Yu Watanabe [Wed, 17 Jun 2020 04:54:56 +0000 (13:54 +0900)] 
network: do not fail to configure non-nl80211 wifi interfaces

Also, make wifi_get_interface() and wifi_get_station() initialize
destination buffer when they return a non-negatinve value.

Closes #16160.

3 years agonetwork: drop casting in memcpy()ing IPv6 address
Yu Watanabe [Thu, 18 Jun 2020 06:35:27 +0000 (15:35 +0900)] 
network: drop casting in memcpy()ing IPv6 address

Follow-up for #16067.

3 years agoudev: udev_event_apply_format() always make buf NUL terminated 16208/head
Yu Watanabe [Thu, 18 Jun 2020 04:48:45 +0000 (13:48 +0900)] 
udev: udev_event_apply_format() always make buf NUL terminated

The return value of udev_event_apply_format() is always ignored.
So, the destination buffer must be always NUL terminated.

3 years agoudev: fix error handling of sd_device_get_parent()
Yu Watanabe [Thu, 18 Jun 2020 04:48:44 +0000 (13:48 +0900)] 
udev: fix error handling of sd_device_get_parent()

sd_device_get_parent() returns -EINVAL or -ENOENT on error, not -ENODEV.

Fixes #16207.

3 years agonetwork: clean-up DHCP lease server data configuration
Lennart Poettering [Tue, 16 Jun 2020 18:35:18 +0000 (20:35 +0200)] 
network: clean-up DHCP lease server data configuration

This is an attempt to clean up the POP3/SMTP/LPR/… DHCP lease server
data logic in networkd. This reduces code duplication and fixes a number
of bugs.

This removes any support for collecting POP3/SMPT/LPR servers acquired
via local DHCP client releases since noone uses that, and given how old
these protocols are I doubt this will change. It keeps support for
configuring them for the dhcp server however.

The differences between the DNS/NTP/SIP/POP3/SMTP/LPR configuration
logics are minimized.

This removes the relevant symbols from sd-network.h (which is an
internal API only at this point after all).

This is unfortunately not well test, given the old code for this had
barely any tests. But the new code should not perform worse at least,
and allow us to release, since it corrects some interfaces visible in
the .network configuration format.

Fixes: #15943
3 years agoMerge pull request #16061 from filbranden/standalone1
Zbigniew Jędrzejewski-Szmek [Wed, 17 Jun 2020 22:09:42 +0000 (00:09 +0200)] 
Merge pull request #16061 from filbranden/standalone1

meson: add a new -Dstandalone-binaries=true option

3 years agonetwork: DHCPv6 - Add support to set token on the LAN interface
Susant Sahani [Wed, 10 Jun 2020 02:57:35 +0000 (04:57 +0200)] 
network: DHCPv6 - Add support to set token on the LAN interface

This patch adds support to set a token on the LAN interface for
the acquired delegated prefixes for the DHCPv6 to generate address.

3 years agoefi: use stub for cache_efi_options_variable if !ENABLE_EFI
Luca Boccassi [Mon, 15 Jun 2020 18:50:56 +0000 (19:50 +0100)] 
efi: use stub for cache_efi_options_variable if !ENABLE_EFI

../src/core/main.c: In function 'main':
../src/core/main.c:2637:32: error: implicit declaration of function 'cache_efi_options_variable'; did you mean 'systemd_efi_options_variable'? [-Werror=implicit-function-declaration]
                         (void) cache_efi_options_variable();
                                ^~~~~~~~~~~~~~~~~~~~~~~~~~
                                systemd_efi_options_variable

3 years agoUSER_RECORD: fix typo
Lennart Poettering [Tue, 16 Jun 2020 14:10:37 +0000 (16:10 +0200)] 
USER_RECORD: fix typo

Fixes: #16172
3 years agotravis: sort dependencies 16196/head
Frantisek Sumsal [Tue, 16 Jun 2020 16:49:37 +0000 (18:49 +0200)] 
travis: sort dependencies