Commit Graph

36496 Commits

Author SHA1 Message Date
Lennart Poettering f6dd5e7c18 proc-cmdline: turn flags parameter into a proper typedef'ed enum
Let's add some extra typesafety.
2018-11-14 16:22:28 +01:00
Lennart Poettering 8755568681
Merge pull request #10759 from keszybz/udevd-more-configuration
Udevd more configuration options
2018-11-14 16:21:14 +01:00
Evgeny Vereshchagin d419b75ce9 travis: use double the normal timeout in the ASan & UBSan stage
This should somewhat address https://github.com/systemd/systemd/issues/10696.
2018-11-14 16:17:04 +01:00
Zbigniew Jędrzejewski-Szmek b5be61d1ed
Merge pull request #10747 from poettering/machinectl-list-fix
properly acquire os-release file from containers
2018-11-14 12:47:56 +01:00
Zbigniew Jędrzejewski-Szmek eff162bf96
Merge pull request #10763 from poettering/pending-reload-fix
when reloading, don't throttle unit/job dbus change signal generation
2018-11-14 10:44:50 +01:00
Yu Watanabe d4a389eb5f 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.
2018-11-14 10:44:18 +01:00
Ruben Suarez Alvarez 080a0178f8 hwdb: Add accelerometer orientation quirk for the Chuwi CoreBook tablet 2018-11-14 09:56:50 +01:00
Evgeny Vereshchagin 7970a52509 travis: also compile and run unsafe unit tests 2018-11-14 09:55:23 +01:00
jambonmcyeah d08819ed74 hwdb: Add Onda V820w accelerometer transformation matrix
Added accelerometer transformation matrix for the Onda V820w Tablet
2018-11-14 09:54:38 +01:00
Lennart Poettering 8204470252 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.
2018-11-14 09:53:50 +01:00
Lennart Poettering 6eb65e7ca4 core: split out audit message generation from unit_notify()
Just some refactoring, no change in behaviour.
2018-11-14 09:51:47 +01:00
Lennart Poettering 438311a518 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
2018-11-14 09:12:49 +03:00
Lennart Poettering 06bd149a71 update TODO 2018-11-13 23:48:53 +01:00
Lennart Poettering 862d9d9503
Merge pull request #10757 from Antique/cgroupv2
Fix cgroupv2 bpf-devices issues
2018-11-13 22:03:10 +01:00
Zbigniew Jędrzejewski-Szmek 7fe0d0d5c0 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.
2018-11-13 22:02:55 +01:00
Zbigniew Jędrzejewski-Szmek a14e7af162 udev: also allow resolve_names= to be specified in udev.conf 2018-11-13 14:35:36 +01:00
Zbigniew Jędrzejewski-Szmek bc768f0475 udev: move ResolveNameTiming definition and parsers to udev-util.h
Follow-up for c4d44cba4d. No functional change,
but the parser is moved to libsystemd-shared.so.
2018-11-13 14:04:29 +01:00
Zbigniew Jędrzejewski-Szmek 4b3ca79ea9 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.
2018-11-13 14:03:47 +01:00
Pavel Hrdina 2af3eed1aa 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>
2018-11-13 14:03:01 +01:00
Zbigniew Jędrzejewski-Szmek 66f737b415 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 9d9264ba39, 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.
2018-11-13 14:00:32 +01:00
Pavel Hrdina 0b82cd2502 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>
2018-11-13 12:58:05 +01:00
Lennart Poettering b8d381c477 core: make sure we don't throttle change signal generator when a reload is pending
Fixes: #10627
2018-11-13 12:51:48 +01:00
Lennart Poettering 4b66bccab0 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.
2018-11-13 12:01:22 +01:00
Lennart Poettering 209de5256b 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.
2018-11-13 11:59:06 +01:00
Zbigniew Jędrzejewski-Szmek 705727fd76 shared/dissect-image: drop parens 2018-11-13 11:58:44 +01:00
Zbigniew Jędrzejewski-Szmek bd897e729a 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.
2018-11-13 11:58:44 +01:00
Lennart Poettering 1edcb6a91c tree-wide: port over other candidates for namespace_fork()
Let's always use the same, correct, way to join a namespace.
2018-11-13 10:49:18 +01:00
Lennart Poettering 2bb21fc928 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
2018-11-13 10:49:18 +01:00
Lennart Poettering 0a885dd055 sd-bus: port over to namespace_fork()
This is pretty similar code, let's replace it with the generic
namespace_fork() implementation.
2018-11-13 10:49:18 +01:00
Lennart Poettering 2709698279 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.
2018-11-13 10:49:18 +01:00
INSUN PYO 8724defeae core: use local variable m instead of u->manager 2018-11-13 10:39:35 +01:00
Lennart Poettering 53a3e8fc7a
Merge pull request #10744 from poettering/logind-lock-down
units: lock down logind with fs namespacing options
2018-11-13 10:38:47 +01:00
Lennart Poettering 99cd001d4c units: also change portabled's syscall filter to a whitelist 2018-11-13 10:38:17 +01:00
Lennart Poettering cc9cc1b126
Merge pull request #10614 from thom311/dhcp-identifier-set-iaid
endianness dependent behavior of dhcp_identifier_set_iaid()
2018-11-12 20:13:48 +01:00
Frantisek Sumsal a978c9f292 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.
2018-11-12 19:16:55 +01:00
Lennart Poettering 45ae3f6117 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).
2018-11-12 19:14:33 +01:00
Thomas Haller 6d13616b9e 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: 933f9caeeb
2018-11-12 19:08:35 +01:00
Thomas Haller 43fc095532 dhcp: add test for dhcp_identifier_set_iaid() 2018-11-12 19:08:35 +01:00
Lennart Poettering 1bded6b28f logind: drop CAP_KILL from caps bounding set
logind doesn't kill any processes anymore, hence let's drop the
capability.
2018-11-12 19:05:36 +01:00
Lennart Poettering 7d7c8ea944
Merge pull request #10741 from poettering/signal-check
propeperly handle sd_event_add_signal() errors
2018-11-12 19:03:22 +01:00
Lennart Poettering 3ca9940cb9 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
2018-11-12 19:02:55 +01:00
Lennart Poettering d49881a06a update TODO 2018-11-12 18:57:52 +01:00
Mathieu Trudel-Lapierre 55b6530baa Always rename an interface to its name specified in config if no NamePolicy= is specified
This is for issue #9006
2018-11-12 18:45:57 +01:00
Lennart Poettering 60d540fabd
Merge pull request #10603 from yuwata/udevd-parser
udevd: several cleanups for parsing options
2018-11-12 18:39:51 +01:00
Lennart Poettering 83a4333919 journal-remote: log about inability to install signals 2018-11-12 17:51:34 +01:00
Lennart Poettering 4b670f8688 hostnamed,localed,timedate: properly propagate errors from sd_event_add_signal()
main() can't doesn't expect negative error codes as return.
2018-11-12 17:51:34 +01:00
Lennart Poettering cd0504a395 update TODO 2018-11-12 17:44:46 +01:00
Tommi Rantala 429926e9cc 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"
2018-11-12 16:36:03 +01:00
Yu Watanabe 6f19b42f24 udev: use structured initializer at one more place 2018-11-12 23:25:59 +09:00
Yu Watanabe c4b69e990f 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.
2018-11-12 23:25:59 +09:00