Commit Graph

36421 Commits

Author SHA1 Message Date
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
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
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
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
Yu Watanabe c52cff0748 udev: handle sd_is_socket() failure 2018-11-12 23:25:59 +09:00
Yu Watanabe 46f0fbd8fd 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'.
2018-11-12 23:25:40 +09:00
Yu Watanabe 9d9264ba39 udev: use parse_sec() to parse --event-timeout option 2018-11-12 23:25:34 +09:00
Yu Watanabe 389f9bf2cf udev: include error cause of parsing --children-max option in log message 2018-11-12 23:21:49 +09:00
Yu Watanabe c4d44cba4d udev: introduce enum ResolveNameTiming for --resolve-names argument 2018-11-12 23:20:53 +09:00
Yu Watanabe 6b92f42934 udevd: use parse_sec() to parse --exec-delay option 2018-11-12 23:16:54 +09:00
Yu Watanabe 216e8bbe34 udevd: explicitly set default value of global variables 2018-11-12 23:12:06 +09:00
Lennart Poettering bc137cf45d update TODO 2018-11-12 11:44:02 +01:00
Lennart Poettering 8a26dae88f
Merge pull request #10736 from yuwata/coredump-comment
fuzz: fix oss-fuzz#8658
2018-11-12 11:42:16 +01:00
Lennart Poettering 192602cb1e
Merge pull request #10734 from yuwata/network-use-structured-initializers
network: several cleanups
2018-11-12 11:42:02 +01:00
seb128 8cc9fefe2e 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.
2018-11-12 10:44:24 +01:00
Lennart Poettering f007824996
Merge pull request #10730 from yuwata/udev_device_get_ifindex_returns_zero
libudev: conserve previous behavior
2018-11-12 10:25:26 +01:00
Lennart Poettering bdc0bcf014
Merge pull request #10731 from yuwata/fix-oss-fuzz-11344
Fixes oss-fuzz#11344
2018-11-12 10:23:23 +01:00
Yu Watanabe 9544a1ceb0 fuzz: add testcase of oss-fuzz#8658 2018-11-12 18:10:24 +09:00
Yu Watanabe 25cad95c82 fuzz: decrease DATA_SIZE_MAX
Fixes oss-fuzz#8658.
2018-11-12 18:08:48 +09:00
Yu Watanabe 27f931d1cd coredump: update comments 2018-11-12 17:56:20 +09:00
Yu Watanabe 538f15cf06 tree-wide: use CONFIG_PARSER_PROTOTYPE() macro 2018-11-12 16:45:04 +09:00
Yu Watanabe 3b00878ef6 wait-online: use hashmap_free_with_destructor() 2018-11-12 16:32:11 +09:00
Yu Watanabe f61365e516 network: use hashmap_steal_first() rather than hashmap_first()+hashmap_remove() 2018-11-12 16:32:11 +09:00
Yu Watanabe c6dbb5c43f network: use hashmap_clear_with_destructor() at one more place 2018-11-12 16:32:11 +09:00
Yu Watanabe 3e5700428e network: allocate hashmap objects when they are required 2018-11-12 16:32:11 +09:00
Yu Watanabe a0e8e4cf3f network: do not assign unused value 2018-11-12 16:32:11 +09:00
Yu Watanabe 0f7f27694e 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.
2018-11-12 16:32:11 +09:00
Yu Watanabe 17f9c355d5 network: use structured initializers 2018-11-12 16:32:10 +09:00
Yu Watanabe 1a75764a32 network: use NetworkConfigSection in fdb entries 2018-11-12 16:32:10 +09:00