Lennart Poettering [Wed, 14 Nov 2018 12:00:12 +0000 (13:00 +0100)]
core: drop dbus queue recursion check
We don't dispatch the queue recursively anymore, hence let's simplify
things a bit.
As pointed out by @fbuihuu:
https://github.com/systemd/systemd/pull/10763#discussion_r233209550
Lennart Poettering [Wed, 14 Nov 2018 15:21:14 +0000 (16:21 +0100)]
Merge pull request #10759 from keszybz/udevd-more-configuration
Udevd more configuration options
Evgeny Vereshchagin [Wed, 14 Nov 2018 09:38:59 +0000 (10:38 +0100)]
travis: use double the normal timeout in the ASan & UBSan stage
This should somewhat address https://github.com/systemd/systemd/issues/10696.
Zbigniew Jędrzejewski-Szmek [Wed, 14 Nov 2018 11:47:56 +0000 (12:47 +0100)]
Merge pull request #10747 from poettering/machinectl-list-fix
properly acquire os-release file from containers
Zbigniew Jędrzejewski-Szmek [Wed, 14 Nov 2018 09:44:50 +0000 (10:44 +0100)]
Merge pull request #10763 from poettering/pending-reload-fix
when reloading, don't throttle unit/job dbus change signal generation
Yu Watanabe [Tue, 13 Nov 2018 00:05:59 +0000 (09:05 +0900)]
json: decrease DEPTH_MAX to 4k
This makes DEPTH_MAX lower value, as test-json fails with stack
overflow.
Note that the test can pass with 8k, but for safety, here set to 4k.
Fixes #10738.
Ruben Suarez Alvarez [Wed, 14 Nov 2018 07:18:23 +0000 (08:18 +0100)]
hwdb: Add accelerometer orientation quirk for the Chuwi CoreBook tablet
Evgeny Vereshchagin [Wed, 14 Nov 2018 06:41:06 +0000 (07:41 +0100)]
travis: also compile and run unsafe unit tests
jambonmcyeah [Wed, 14 Nov 2018 03:03:21 +0000 (22:03 -0500)]
hwdb: Add Onda V820w accelerometer transformation matrix
Added accelerometer transformation matrix for the Onda V820w Tablet
Lennart Poettering [Tue, 13 Nov 2018 19:51:31 +0000 (20:51 +0100)]
unit: don't claim there was no IP traffic generated by a unit when we don't know
Only if we have some IP traffic accounting at all we should claim that.
Lennart Poettering [Tue, 13 Nov 2018 19:59:20 +0000 (20:59 +0100)]
core: split out audit message generation from unit_notify()
Just some refactoring, no change in behaviour.
Lennart Poettering [Tue, 13 Nov 2018 22:09:32 +0000 (23:09 +0100)]
man: document that env vars are not suitable for passing secrets
Prompted by the thread around:
https://lists.freedesktop.org/archives/systemd-devel/2018-November/041665.html
Lennart Poettering [Tue, 13 Nov 2018 22:05:36 +0000 (23:05 +0100)]
update TODO
Lennart Poettering [Tue, 13 Nov 2018 21:03:10 +0000 (22:03 +0100)]
Merge pull request #10757 from Antique/cgroupv2
Fix cgroupv2 bpf-devices issues
Zbigniew Jędrzejewski-Szmek [Tue, 13 Nov 2018 13:53:04 +0000 (14:53 +0100)]
udev: downgrade message when we fail to set inotify watch up
My logs are full of:
systemd-udevd[6586]: seq 13515 queued, 'add' 'block'
systemd-udevd[6586]: seq 13516 queued, 'change' 'block'
systemd-udevd[6586]: seq 13517 queued, 'change' 'block'
systemd-udevd[6586]: seq 13518 queued, 'remove' 'bdi'
systemd-udevd[6586]: seq 13519 queued, 'remove' 'block'
systemd-udevd[9865]: seq 13514 processed
systemd-udevd[9865]: seq 13515 running
systemd-udevd[9865]: GROUP 6 /usr/lib/udev/rules.d/50-udev-default.rules:59
systemd-udevd[9865]: IMPORT builtin 'blkid' /usr/lib/udev/rules.d/60-persistent-storage.rules:95
systemd-udevd[9865]: IMPORT builtin 'blkid' fails: No such file or directory
systemd-udevd[9865]: loop4: Failed to add device '/dev/loop4' to watch: No such file or directory
(the last line is at error level).
If we are too slow to set up a watch and the device is already gone by the time
we try, this is not an error.
Zbigniew Jędrzejewski-Szmek [Tue, 13 Nov 2018 10:33:32 +0000 (11:33 +0100)]
udev: also allow resolve_names= to be specified in udev.conf
Zbigniew Jędrzejewski-Szmek [Tue, 13 Nov 2018 12:42:42 +0000 (13:42 +0100)]
udev: move ResolveNameTiming definition and parsers to udev-util.h
Follow-up for
c4d44cba4d9bd9d92c86e06f21d5936cca1b8c16. No functional change,
but the parser is moved to libsystemd-shared.so.
Zbigniew Jędrzejewski-Szmek [Tue, 13 Nov 2018 10:10:13 +0000 (11:10 +0100)]
udevd: allow more parameters to be set through udev.conf
Rebooting to set change the kernel command line to set some udev parameters is
inconvenient. Let's allow setting more stuff in the config file.
Also drop quotes from around "info" in udev.conf. We need to accept them for
compatibility, but there is no reason to use them.
Pavel Hrdina [Mon, 12 Nov 2018 09:53:47 +0000 (10:53 +0100)]
bpf-devices: fix order of removing and adding BPF programs
The current code has multiple issues and it should never be done like
that. If someone updates list of allowed devices we should attach new
program before we remove the old one for two reasons:
1. It takes some time to attach new program so there is a period of time
when all devices are allowed.
2. BPF programs have limit for number of instructions (4096) and if user
adds a lot of devices we might hit the instruction limit and the new
program will not be accepted which will result in allow all devices
because the old program was already removed.
In order to attach the new program before we remove the old one we need
to use BPF_F_ALLOW_MULTI flag every time.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Zbigniew Jędrzejewski-Szmek [Tue, 13 Nov 2018 09:37:05 +0000 (10:37 +0100)]
udev: do not pass timeout_warn_usec around, calculate it on demand
It was always set to one third of timeout_usec, so let's simplify things by
calculating it using a helper function right before it is used.
Before
9d9264ba39f797d20100c8acfda3df895ab5aaa2, udevd.c would avoid setting
timeout_warn_usec to 0, using 1 instead. This wasn't necessary, because when
timeout_warn_usec is finally used in spawn_wait(), it is ignored if
timeout_usec is 0 or timeout_warn_usec is 0. So there was no need to handle
this case specially.
Pavel Hrdina [Mon, 12 Nov 2018 09:52:05 +0000 (10:52 +0100)]
bpf-devices: fix cgroup v2 devices detection
If cgroup v2 bpf devices is supported we need to return 1, not -1.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Lennart Poettering [Tue, 13 Nov 2018 11:48:49 +0000 (12:48 +0100)]
core: make sure we don't throttle change signal generator when a reload is pending
Fixes: #10627
Lennart Poettering [Tue, 13 Nov 2018 11:00:42 +0000 (12:00 +0100)]
core: when we can't send the pending reload message, say we ignore it in the warning we log
No change in behaviour, just better wording.
Lennart Poettering [Tue, 13 Nov 2018 10:59:06 +0000 (11:59 +0100)]
core: rename queued_message → pending_reload_message
This field is only used for pending Reload() replies, hence let's rename
it to be more descriptive and precise.
No change in behaviour.
Zbigniew Jędrzejewski-Szmek [Tue, 13 Nov 2018 08:08:24 +0000 (09:08 +0100)]
shared/dissect-image: drop parens
Zbigniew Jędrzejewski-Szmek [Tue, 13 Nov 2018 08:02:01 +0000 (09:02 +0100)]
nspawn: add a hint to the message we emit when a child dies
From #10526:
$ sudo systemd-nspawn -i image
Spawning container image on /home/zbyszek/src/mkosi/image.
Press ^] three times within 1s to kill container.
Short read while reading cgroup mode.
Lennart Poettering [Mon, 12 Nov 2018 22:42:24 +0000 (23:42 +0100)]
tree-wide: port over other candidates for namespace_fork()
Let's always use the same, correct, way to join a namespace.
Lennart Poettering [Mon, 12 Nov 2018 22:40:09 +0000 (23:40 +0100)]
machined: when reading os-release file, join PID namespace too
This is required for /proc/self/fd/xyz to work, but that's what we need
to convert the O_PATH fd returned by chase_symlinks() back to a regular
file fd. Hence, let's do the joining of the namespaces fully and
correctly, by doing fork()+setns()+fork() with the PID and fs
namespaces.
This makes use of the new namespace_fork() helper we just added.
Fixes: #10549
Lennart Poettering [Mon, 12 Nov 2018 22:39:01 +0000 (23:39 +0100)]
sd-bus: port over to namespace_fork()
This is pretty similar code, let's replace it with the generic
namespace_fork() implementation.
Lennart Poettering [Mon, 12 Nov 2018 22:37:13 +0000 (23:37 +0100)]
core: add namespace_fork() helper, that forks, joins a set of namespaces and forks again
This helper is useful to ensure pidns/userns joining is properly
executed (as that requires a fork after the setns()). This is
particularly important when it comes to /proc/self/ access or
SCM_CREDENTIALS, but is generally the safer mode of operation.
INSUN PYO [Tue, 13 Nov 2018 04:44:20 +0000 (13:44 +0900)]
core: use local variable m instead of u->manager
Lennart Poettering [Tue, 13 Nov 2018 09:38:47 +0000 (10:38 +0100)]
Merge pull request #10744 from poettering/logind-lock-down
units: lock down logind with fs namespacing options
Lennart Poettering [Mon, 12 Nov 2018 18:21:09 +0000 (19:21 +0100)]
units: also change portabled's syscall filter to a whitelist
Lennart Poettering [Mon, 12 Nov 2018 19:13:48 +0000 (20:13 +0100)]
Merge pull request #10614 from thom311/dhcp-identifier-set-iaid
endianness dependent behavior of dhcp_identifier_set_iaid()
Frantisek Sumsal [Sun, 11 Nov 2018 11:13:48 +0000 (12:13 +0100)]
tests: dbus.service was renamed to dbus-daemon.service in Rawhide
Fedora Rawhide renamed dbus.service to dbus-daemon.service - that
breaks tests which require working DBus (e.g. TEST-03-JOBS)
Excerpt from the dbus.spec:
The 'dbus' package is only retained for compatibility purposes. It will
eventually be removed and then replaced by 'Provides: dbus' in the
dbus-daemon package. It will then exclusively be used for other packages to
describe their dependency on a system and user bus. It does not pull in any
particular dbus *implementation*, nor any libraries. These should be pulled
in, if required, via explicit dependencies.
Lennart Poettering [Mon, 12 Nov 2018 17:08:48 +0000 (18:08 +0100)]
units: lock down systemd-logind.service with various fs namespacing options
now that logind doesn't mount $XDG_RUNTIME_DIR anymore we can lock down
the service using fs namespacing (as we don't need the mount to
propagate to the host namespace anymore).
Thomas Haller [Thu, 1 Nov 2018 13:43:11 +0000 (14:43 +0100)]
dhcp: support endianness independent dhcp_identifier_set_iaid()
The previous code did htole64() followed by unaligned_write_be32() (the
XOR and shift in between is endianness agnostic). That means, on every
architeture there is always exactly one byte swap and the iaid is
dependent on endianness.
Since dhcp_identifier_set_iaid() is part of the DUID generation
algorithm, this cannot be fixed without changing the client-id.
In particular, as the client-id already depends on the machine-id (and
is thus inherrently host-specific), it is better to stick to the current
behavior.
However, add a parameter to switch between old and new behaviour.
Since the new behavior is unused, the only real purpose of this
change is to self-document the oddity of the function.
Fixes:
933f9caeeb2b3c1b951d330e04beb04226e5a890
Thomas Haller [Thu, 1 Nov 2018 13:46:27 +0000 (14:46 +0100)]
dhcp: add test for dhcp_identifier_set_iaid()
Lennart Poettering [Mon, 12 Nov 2018 16:57:45 +0000 (17:57 +0100)]
logind: drop CAP_KILL from caps bounding set
logind doesn't kill any processes anymore, hence let's drop the
capability.
Lennart Poettering [Mon, 12 Nov 2018 18:03:22 +0000 (19:03 +0100)]
Merge pull request #10741 from poettering/signal-check
propeperly handle sd_event_add_signal() errors
Lennart Poettering [Mon, 12 Nov 2018 16:19:48 +0000 (17:19 +0100)]
units: set NoNewPrivileges= for all long-running services
Previously, setting this option by default was problematic due to
SELinux (as this would also prohibit the transition from PID1's label to
the service's label). However, this restriction has since been lifted,
hence let's start making use of this universally in our services.
On SELinux system this change should be synchronized with a policy
update that ensures that NNP-ful transitions from init_t to service
labels is permitted.
An while we are at it: sort the settings in the unit files this touches.
This might increase the size of the change in this case, but hopefully
should result in stabler patches later on.
Fixes: #1219
Lennart Poettering [Mon, 12 Nov 2018 17:57:11 +0000 (18:57 +0100)]
update TODO
Mathieu Trudel-Lapierre [Fri, 25 May 2018 14:34:38 +0000 (10:34 -0400)]
Always rename an interface to its name specified in config if no NamePolicy= is specified
This is for issue #9006
Lennart Poettering [Mon, 12 Nov 2018 17:39:51 +0000 (18:39 +0100)]
Merge pull request #10603 from yuwata/udevd-parser
udevd: several cleanups for parsing options
Lennart Poettering [Mon, 12 Nov 2018 12:31:53 +0000 (13:31 +0100)]
journal-remote: log about inability to install signals
Lennart Poettering [Mon, 12 Nov 2018 12:31:03 +0000 (13:31 +0100)]
hostnamed,localed,timedate: properly propagate errors from sd_event_add_signal()
main() can't doesn't expect negative error codes as return.
Lennart Poettering [Mon, 12 Nov 2018 16:44:33 +0000 (17:44 +0100)]
update TODO
Tommi Rantala [Thu, 8 Nov 2018 12:15:25 +0000 (14:15 +0200)]
core: include unit name in emergency_action() reason message
Add unit name in StartLimitAction=, FailureAction= and SuccessAction=
emergency_action() reason messages, so that the problematic unit is
easily visible, for example:
"unit dbus.service failed"
Yu Watanabe [Thu, 25 Oct 2018 09:18:35 +0000 (18:18 +0900)]
udev: use structured initializer at one more place
Yu Watanabe [Thu, 25 Oct 2018 08:41:17 +0000 (17:41 +0900)]
udev: drop redundant initializations for file descriptors
As udev_ctrl_new_from_fd() or udev_monitor_new_from_netlink_fd()
creates fd if negative fd is passed.
Yu Watanabe [Thu, 25 Oct 2018 08:39:53 +0000 (17:39 +0900)]
udev: handle sd_is_socket() failure
Yu Watanabe [Mon, 29 Oct 2018 07:50:39 +0000 (16:50 +0900)]
udev: drop util_log_priority() and use log_level_from_string()
The function util_log_priority() is almost same as
log_level_from_string(). The difference between them is only that
util_log_priority() accepts such that '3 hogehoge'.
Yu Watanabe [Thu, 25 Oct 2018 09:06:44 +0000 (18:06 +0900)]
udev: use parse_sec() to parse --event-timeout option
Yu Watanabe [Thu, 25 Oct 2018 09:13:55 +0000 (18:13 +0900)]
udev: include error cause of parsing --children-max option in log message
Yu Watanabe [Thu, 25 Oct 2018 06:30:51 +0000 (15:30 +0900)]
udev: introduce enum ResolveNameTiming for --resolve-names argument
Yu Watanabe [Thu, 25 Oct 2018 05:56:12 +0000 (14:56 +0900)]
udevd: use parse_sec() to parse --exec-delay option
Yu Watanabe [Thu, 25 Oct 2018 05:51:58 +0000 (14:51 +0900)]
udevd: explicitly set default value of global variables
Lennart Poettering [Mon, 12 Nov 2018 10:43:38 +0000 (11:43 +0100)]
update TODO
Lennart Poettering [Mon, 12 Nov 2018 10:42:16 +0000 (11:42 +0100)]
Merge pull request #10736 from yuwata/coredump-comment
fuzz: fix oss-fuzz#8658
Lennart Poettering [Mon, 12 Nov 2018 10:42:02 +0000 (11:42 +0100)]
Merge pull request #10734 from yuwata/network-use-structured-initializers
network: several cleanups
seb128 [Fri, 9 Nov 2018 15:54:02 +0000 (16:54 +0100)]
hwdb: revert airplane mode keys handling on Dell
That reverts the commits #8762 and #9868, those created double key events issues on some Dell laptops.
Lennart Poettering [Mon, 12 Nov 2018 09:25:26 +0000 (10:25 +0100)]
Merge pull request #10730 from yuwata/udev_device_get_ifindex_returns_zero
libudev: conserve previous behavior
Lennart Poettering [Mon, 12 Nov 2018 09:23:23 +0000 (10:23 +0100)]
Merge pull request #10731 from yuwata/fix-oss-fuzz-11344
Fixes oss-fuzz#11344
Yu Watanabe [Mon, 12 Nov 2018 09:10:24 +0000 (18:10 +0900)]
fuzz: add testcase of oss-fuzz#8658
Yu Watanabe [Mon, 12 Nov 2018 09:08:45 +0000 (18:08 +0900)]
fuzz: decrease DATA_SIZE_MAX
Fixes oss-fuzz#8658.
Yu Watanabe [Mon, 12 Nov 2018 08:56:20 +0000 (17:56 +0900)]
coredump: update comments
Yu Watanabe [Mon, 12 Nov 2018 07:45:04 +0000 (16:45 +0900)]
tree-wide: use CONFIG_PARSER_PROTOTYPE() macro
Yu Watanabe [Mon, 12 Nov 2018 06:34:39 +0000 (15:34 +0900)]
wait-online: use hashmap_free_with_destructor()
Yu Watanabe [Mon, 12 Nov 2018 06:33:18 +0000 (15:33 +0900)]
network: use hashmap_steal_first() rather than hashmap_first()+hashmap_remove()
Yu Watanabe [Mon, 12 Nov 2018 06:32:26 +0000 (15:32 +0900)]
network: use hashmap_clear_with_destructor() at one more place
Yu Watanabe [Mon, 12 Nov 2018 06:24:11 +0000 (15:24 +0900)]
network: allocate hashmap objects when they are required
Yu Watanabe [Mon, 12 Nov 2018 06:21:40 +0000 (15:21 +0900)]
network: do not assign unused value
Yu Watanabe [Mon, 12 Nov 2018 05:57:04 +0000 (14:57 +0900)]
network: fixes related to NetworkConfigSection
- Do not allocate NetworkConfigSection when filename == NULL
- set .network element before calling hashmap_put()
- Always free NetworkConfigSection in each object.
Yu Watanabe [Mon, 12 Nov 2018 05:55:52 +0000 (14:55 +0900)]
network: use structured initializers
Yu Watanabe [Mon, 12 Nov 2018 05:54:04 +0000 (14:54 +0900)]
network: use NetworkConfigSection in fdb entries
Yu Watanabe [Mon, 12 Nov 2018 05:52:35 +0000 (14:52 +0900)]
network: make ndisc related handlers return negative errno but caller ignore the errors
Yu Watanabe [Mon, 12 Nov 2018 04:30:20 +0000 (13:30 +0900)]
sd-bus: use SD_BUS_ERROR_NULL macro
Follow-up for
e8f280bd0af47158a9d6c3da940754cdd6f51d3e.
Yu Watanabe [Mon, 12 Nov 2018 04:20:20 +0000 (13:20 +0900)]
test: make test-udev accept only check when argc == 2
Follow-up for
110a13202eab6d92678abcde08372d4afac1cc45.
Yu Watanabe [Mon, 12 Nov 2018 06:55:03 +0000 (15:55 +0900)]
Merge pull request #10669 from danderson/networkd-6rd
networkd: add 6rd support for sit netdevs
Markus Grimm [Mon, 12 Nov 2018 06:47:47 +0000 (07:47 +0100)]
journal-remote: bugfix to re-enable ssl key check (#10707)
Alexander Kurtz [Mon, 12 Nov 2018 06:44:55 +0000 (07:44 +0100)]
man: fix default value in resolved.conf man page (#10733)
See https://github.com/systemd/systemd/blob/v239/meson_options.txt#L190
Yu Watanabe [Mon, 12 Nov 2018 04:12:09 +0000 (13:12 +0900)]
Merge pull request #10694 from evverx/udev-test-in-container
udev-test: remove a check for whether the test is run in a container
Yu Watanabe [Mon, 12 Nov 2018 04:07:06 +0000 (13:07 +0900)]
udevd: do not treat negative value as valid ifindex
Also, some conditions in is_devpath_busy() are similified.
Yu Watanabe [Sun, 11 Nov 2018 14:33:17 +0000 (23:33 +0900)]
libudev: conserve previous behavior
The commit
dcfbde3a43d632ff6e286c77e1081087eca59d8e changes
sd_device_get_ifindex() returns -ENOENT instead of zero if the device
does not have ifindex.
Let's keep the original behavior of udev_device_get_ifindex().
Fixes #10699.
Lennart Poettering [Sun, 11 Nov 2018 20:16:14 +0000 (21:16 +0100)]
Merge pull request #10728 from keszybz/four-unrelated-cleanups
Four unrelated cleanups
Lennart Poettering [Sun, 11 Nov 2018 20:15:50 +0000 (21:15 +0100)]
Merge pull request #10732 from yuwata/network-sock_cloexec
dhcp, fuzz: set SOCK_CLOEXEC and SOCK_NONBLOCK
Yu Watanabe [Sun, 11 Nov 2018 17:04:23 +0000 (02:04 +0900)]
fuzz: add testcase of oss-fuzz#10734
Yu Watanabe [Sun, 11 Nov 2018 17:03:22 +0000 (02:03 +0900)]
libsystemd-network: set SOCK_CLOEXEC and SOCK_NONBLOCK
Yu Watanabe [Sun, 11 Nov 2018 16:58:17 +0000 (01:58 +0900)]
fuzz: explicitly set initial value of global variables
Yu Watanabe [Sun, 11 Nov 2018 16:57:27 +0000 (01:57 +0900)]
fuzz: set SOCK_CLOEXEC and SOCK_NONBLOCK
Yu Watanabe [Sun, 11 Nov 2018 16:56:08 +0000 (01:56 +0900)]
fuzz: use SOCK_STREAM instead of SOCK_DGRAM
Fixes oss-fuzz#10734.
Yu Watanabe [Sun, 11 Nov 2018 16:17:45 +0000 (01:17 +0900)]
fuzz: add testcase of already fixed issue 10908
Yu Watanabe [Sun, 11 Nov 2018 15:48:30 +0000 (00:48 +0900)]
network: use IN_ADDR_NULL
Yu Watanabe [Sun, 11 Nov 2018 15:36:48 +0000 (00:36 +0900)]
fuzz: add testcase of oss-fuzz#11344
Yu Watanabe [Sun, 11 Nov 2018 15:35:57 +0000 (00:35 +0900)]
util: specify the maximum-size element when initialize union
Fixes oss-fuzz#11344.
Lennart Poettering [Sun, 11 Nov 2018 14:43:45 +0000 (15:43 +0100)]
Merge pull request #10722 from yuwata/sd-device-monitor-change-arguments
sd-device-monitor: slightly re-design API arguments
Lennart Poettering [Sun, 11 Nov 2018 14:42:46 +0000 (15:42 +0100)]
Merge pull request #10723 from yuwata/fix-oss-fuzz-11345
network: add missing free() in network_free()
Yu Watanabe [Sun, 11 Nov 2018 14:19:50 +0000 (23:19 +0900)]
Merge pull request #10726 from michaelolbrich/meson-fixes
Meson fixes
Zbigniew Jędrzejewski-Szmek [Sun, 11 Nov 2018 11:33:06 +0000 (12:33 +0100)]
journalctl: do not treat EINTR as an error when waiting for events
Fixup for
2a1e0f2228bbdfbc18635e959f47df7da50b62fe. Fixes #10724.
Reproducer: start 'journalctl -f' in a terminal window, change window size.
Michael Olbrich [Sun, 11 Nov 2018 10:30:53 +0000 (11:30 +0100)]
meson: fix building with -Ddns-over-tls=false
Assigning multiple variables in one line is no valid meson syntax.
Without this running meson with -Ddns-over-tls=false fails with:
meson.build:1191:8: ERROR: Tried to assign an invalid value to variable.