Lennart Poettering [Wed, 7 Nov 2018 17:27:57 +0000 (18:27 +0100)]
random-util: rename acquire_random_bytes() → genuine_random_bytes()
It's more descriptive, since we also have a function random_bytes()
which sounds very similar.
Also rename pseudorandom_bytes() to pseudo_random_bytes(). This way the
two functions are nicely systematic, one returning genuine random bytes
and the other pseudo random ones.
Lennart Poettering [Thu, 8 Nov 2018 08:37:35 +0000 (09:37 +0100)]
Merge pull request #10682 from yuwata/fix-oss-fuzz-network-issues
network: fix memleak
Yu Watanabe [Thu, 8 Nov 2018 05:08:10 +0000 (14:08 +0900)]
core: introduce exec_params_clear()
Follow-up for
1ad6e8b302e87b6891a2bfc35ad397b0afe3d940.
Fixes #10677.
Matthew Leeds [Thu, 8 Nov 2018 03:41:06 +0000 (19:41 -0800)]
man: Fix implicit dep info for timer units (#10679)
This reorganizes the systemd.timer man page so that it doesn't claim
there are no implicit dependencies right after specifying the implicit
dependencies, and so that it matches the other man pages for units. This
fixes a mistake introduced by commit
aed5cb03db.
Yu Watanabe [Thu, 8 Nov 2018 03:31:02 +0000 (12:31 +0900)]
fuzz: add a testcase for oss-fuzz#11285
Yu Watanabe [Thu, 8 Nov 2018 03:30:00 +0000 (12:30 +0900)]
network: adds missing strv_free()
Fixes oss-fuzz#11285.
Yu Watanabe [Thu, 8 Nov 2018 03:29:38 +0000 (12:29 +0900)]
network: make config_parse_radv_search_domains() log error in dns_name_apply_idna()
Yu Watanabe [Thu, 8 Nov 2018 03:15:09 +0000 (12:15 +0900)]
fuzz: add more testcases of already fixed issue about multiple netdev kind
This adds testcases of oss-fuzz#11286, oss-fuzz#11287, oss-fuzz#11296,
oss-fuzz#11297, and oss-fuzz#11299.
The issue was fixed by
62facba19ad645df7fb425ce170bdbda208b303c.
Zbigniew Jędrzejewski-Szmek [Wed, 7 Nov 2018 18:31:31 +0000 (19:31 +0100)]
Merge pull request #10670 from yuwata/oss-fuzz-netdev-fixes
network: ignore multiple assignment of netdev kind
Steven Allen [Wed, 7 Nov 2018 16:29:21 +0000 (08:29 -0800)]
logind: fix compilation without utmp (#10674)
Jan Synacek [Mon, 8 Oct 2018 13:14:38 +0000 (15:14 +0200)]
ask-password: improve log message when inotify limit is reached
When inotify_add_watch() fails because of the inotify limit, errno is
set to ENOSPC and then gets shown to users as "No space left on device".
That is very confusing and requires in-depth knowledge of the C library.
Therefore, show user-friendly message when inotify limit is reached.
Fixes #6030.
Zbigniew Jędrzejewski-Szmek [Wed, 7 Nov 2018 11:49:13 +0000 (12:49 +0100)]
Merge pull request #10594 from poettering/env-reload-fix
change handling of environment block of PID1's manager object
Zbigniew Jędrzejewski-Szmek [Wed, 7 Nov 2018 10:34:33 +0000 (11:34 +0100)]
Merge pull request #10610 from yuwata/udev-rules-cleanups
udev-rules: replace udev_device by sd_device
Yu Watanabe [Wed, 7 Nov 2018 09:14:11 +0000 (18:14 +0900)]
network: drop unused members in Wireguard object
Yu Watanabe [Wed, 7 Nov 2018 08:24:41 +0000 (17:24 +0900)]
fuzz: add testcases for oss-fuzz#11279 and #11280
Yu Watanabe [Wed, 7 Nov 2018 08:21:41 +0000 (17:21 +0900)]
network: ignore multiple assignment of netdev kind
Fixes oss-fuzz#11279 and oss-fuzz#11280.
Yu Watanabe [Wed, 7 Nov 2018 05:56:20 +0000 (14:56 +0900)]
Evgeny Vereshchagin [Wed, 7 Nov 2018 07:13:21 +0000 (10:13 +0300)]
Merge pull request #10668 from evverx/travis-tweaks
travis: build and run fuzzers against crash reproducers
Evgeny Vereshchagin [Wed, 7 Nov 2018 06:49:50 +0000 (07:49 +0100)]
travis: show all commands when building systemd
This should prevent Travis CI from terminating build jobs
that don't print anything for more than 10 minutes.
See https://travis-ci.org/systemd/systemd/builds/
451737177.
Evgeny Vereshchagin [Wed, 7 Nov 2018 06:47:22 +0000 (07:47 +0100)]
travis: build and run fuzzers against crash reproducers
Yu Watanabe [Wed, 7 Nov 2018 06:31:26 +0000 (15:31 +0900)]
in-addr-util: make in_addr_default_prefix_from_string() or friend set 0 to prefixlen when family == AF_INET6 (#10665)
Follow-up for
a4798d4e6d88c2be2625ce62d8326eaa9b80f2ee.
Fixes #10662.
Yu Watanabe [Thu, 1 Nov 2018 13:58:42 +0000 (22:58 +0900)]
test: replace udev_device by sd_device in test-udev
Yu Watanabe [Thu, 1 Nov 2018 13:52:39 +0000 (22:52 +0900)]
udevadm-test: replace udev_device by sd_device
Yu Watanabe [Mon, 29 Oct 2018 07:27:13 +0000 (16:27 +0900)]
udev-event: make udev_event_new() take sd_device instead of udev_device
Yu Watanabe [Mon, 29 Oct 2018 07:15:07 +0000 (16:15 +0900)]
udev-rules: replace udev_device by sd_device in udev_rules_apply_to_event()
Yu Watanabe [Mon, 29 Oct 2018 06:39:53 +0000 (15:39 +0900)]
udev-rules: replace two udev_list_entry_foreach() by corresponding FOREACH_DEVICE_*() macros
Yu Watanabe [Thu, 1 Nov 2018 13:30:43 +0000 (22:30 +0900)]
udev-rules: use structured initializer
Yu Watanabe [Thu, 1 Nov 2018 13:28:01 +0000 (22:28 +0900)]
udev-rules: drop unused member file_list in struct udev_rules
Yu Watanabe [Mon, 29 Oct 2018 06:31:19 +0000 (15:31 +0900)]
udev-rules: make import_parent_into_properties() take sd_device
Yu Watanabe [Mon, 29 Oct 2018 06:26:39 +0000 (15:26 +0900)]
udev-rules: make import_file_into_properties() take sd_device
Yu Watanabe [Mon, 29 Oct 2018 06:24:14 +0000 (15:24 +0900)]
udev-rules: make import_property_from_string() take sd_device
Also, this makes the function return negative errno, though its
return value is always ignored.
Yu Watanabe [Mon, 29 Oct 2018 06:16:00 +0000 (15:16 +0900)]
udev: use sd_device for udev_event.dev_parent
Yu Watanabe [Mon, 29 Oct 2018 06:15:25 +0000 (15:15 +0900)]
udev-rules: make match_attr() take sd_device instead of udev_device
Yu Watanabe [Mon, 29 Oct 2018 06:01:39 +0000 (15:01 +0900)]
udev: use sd_device for udev_event.dev_db
Also, this adds sd_device_unref for the object in udev_event_free()
for safety and readability of code.
Yu Watanabe [Thu, 1 Nov 2018 13:19:31 +0000 (22:19 +0900)]
udev-event: make udev_event_new() take sd_netlink and take a reference of that
Yu Watanabe [Thu, 1 Nov 2018 13:13:57 +0000 (22:13 +0900)]
udev-event: make udev_event_new() take exec_delay
Evgeny Vereshchagin [Wed, 7 Nov 2018 03:36:57 +0000 (04:36 +0100)]
travis: make the directory with coverity tools available in a container
Otherwise `coverity.sh build` will fail with
```
find: '/var/tmp/coverity-scan-analysis': No such file or directory
```
See https://travis-ci.org/systemd/systemd/jobs/
451683385.
imayoda [Wed, 7 Nov 2018 03:59:24 +0000 (04:59 +0100)]
hwdb: IdeaPad Miix 310 with another bios version (#10661)
another bios version for same model with portrait screen.
Evgeny Vereshchagin [Wed, 7 Nov 2018 02:11:02 +0000 (05:11 +0300)]
Merge pull request #10644 from mrc0mmand/travis-fix
Fix & re-enable Travis CI
Evgeny Vereshchagin [Wed, 7 Nov 2018 01:25:52 +0000 (02:25 +0100)]
travis: overwrite test-capability with a simple script that is just skipped
so that it will be possible to work on the test failure and try to make
Travis CI work at the same time.
Yu Watanabe [Tue, 6 Nov 2018 23:50:25 +0000 (08:50 +0900)]
Merge pull request #10640 from evverx/networkd-fuzzers
Add a couple of fuzzers for network_load_one and netdev_load_one
Frantisek Sumsal [Tue, 6 Nov 2018 19:55:07 +0000 (20:55 +0100)]
travis: workaround for dnf upgrade
dnf upgrade on Fedora Rawhide pulls in unwanted selinux-policy
packages which breaks the system in several ways (and usually
ends up with crashed systemd)
Evgeny Vereshchagin [Tue, 6 Nov 2018 18:51:45 +0000 (19:51 +0100)]
oss-fuzz.sh: copy dictionaries along with "options" files
We currently don't have any upstream but it doesn't mean that
it should be impossible to experiment with local ones :-)
Evgeny Vereshchagin [Tue, 6 Nov 2018 18:42:29 +0000 (19:42 +0100)]
tests: add a couple of files containing all the sections and directives
This should help the fuzzers to discover code paths faster.
In case anyone is interested, they were generated with the following script
```
perl -aF'/[\s,]+/' -ne '
if (my ($s, $d) = ($F[0] =~ /^([^\s\.]+)\.([^\s\.]+)$/)) { $d{$s}{$d} = 1; }
END { while (my ($key, $value) = each %d) {
printf "[%s]\n%s\n", $key, join("\n", keys(%$value))
}}'
```
by passing src/network/networkd-network-gperf.gperf and
src/network/netdev/netdev-gperf.gperf to it.
Evgeny Vereshchagin [Tue, 6 Nov 2018 18:36:40 +0000 (19:36 +0100)]
tests: replace AdActorSysPrio with AdActorSystemPriority
This is a follow-up to https://github.com/systemd/systemd/pull/10653.
Evgeny Vereshchagin [Sun, 4 Nov 2018 23:39:47 +0000 (00:39 +0100)]
tests: add a reporoducer for https://github.com/systemd/systemd/issues/10639
Evgeny Vereshchagin [Sun, 4 Nov 2018 22:04:43 +0000 (23:04 +0100)]
tests: add some data that can be fed to fuzz-network-parser
Evgeny Vereshchagin [Sun, 4 Nov 2018 22:01:46 +0000 (23:01 +0100)]
tests: add a reproducer for https://github.com/systemd/systemd/issues/10629
Evgeny Vereshchagin [Sun, 4 Nov 2018 21:27:07 +0000 (22:27 +0100)]
networkd: make network_load_one "public" and add a fuzzer for it
Evgeny Vereshchagin [Sun, 4 Nov 2018 21:06:03 +0000 (22:06 +0100)]
networkd: make netdev_load_one "public" and add a fuzzer for it
Evgeny Vereshchagin [Sun, 4 Nov 2018 20:49:09 +0000 (21:49 +0100)]
networkd: remove a weird assertion from network_load_one
The assertion was added in
dbffab87f1504abc9f but I'm not exactly sure
why. Now it just crashes a fuzzer I wrote. I, of course, could fix the fuzzer
so that it would generate names ending in ".network" if anyone would tell
me why the assertion should be kept here.
Evgeny Vereshchagin [Sun, 4 Nov 2018 20:43:08 +0000 (21:43 +0100)]
util: initialize _argtypes in VA_FORMAT_ADVANCE when systemd is built with MSan
This gets around https://github.com/google/sanitizers/issues/992.
Yu Watanabe [Tue, 6 Nov 2018 17:03:09 +0000 (02:03 +0900)]
Merge pull request #10654 from poettering/srand-rdrand
random-util.c mini-fixes
Marco Trevisan (Treviño) [Thu, 1 Nov 2018 02:04:50 +0000 (03:04 +0100)]
login: Don't mark framebuffer devices as master-of-seat devices
Currently we consider any framebuffer device as enough to have a
valid graphical session, but this might lead to many false postives
like in the case of framebuffer devices that have a linked drm card
which is still in the process of being added, or for vesa fb, and
so it doesn't ensure us that we can have a proper graphical session.
Since these days we normally don't consider anything without a DRM
card able to provide a full graphical session, let's not set this
at this level.
Drivers which can provide a graphical session with the sole fb are
still free to mark any device as `master-of-seat`
Fixes #10435
Lennart Poettering [Tue, 6 Nov 2018 17:01:37 +0000 (20:01 +0300)]
Merge pull request #10658 from yuwata/udevd-worker-performance
udev: improve performance
Lennart Poettering [Tue, 6 Nov 2018 16:33:51 +0000 (19:33 +0300)]
Merge pull request #10602 from yuwata/sd-device-logs
update log messages
Lennart Poettering [Tue, 6 Nov 2018 16:30:59 +0000 (19:30 +0300)]
Merge pull request #10633 from yuwata/sd-resolve-destroy
Another solution to fix wireguard issues
Yu Watanabe [Tue, 6 Nov 2018 03:36:54 +0000 (12:36 +0900)]
time-util: make parse_sec() not accept "12.34.56"
This also changes the rational number treatment.
So, the limitations introduced by
8079c90333422bbc008b68a9b7cefbdb8a15a4e9
and
f6a178e91dd5fccf43f659eca887788fd5dcdccf are relaxed.
Fixes #10619.
Frantisek Sumsal [Tue, 6 Nov 2018 16:16:45 +0000 (17:16 +0100)]
travis: drop the unnecessary /etc/machine-id magic
Frantisek Sumsal [Tue, 6 Nov 2018 14:59:34 +0000 (15:59 +0100)]
travis: run Coverity on a more stable Fedora release
Yu Watanabe [Thu, 1 Nov 2018 07:54:10 +0000 (16:54 +0900)]
udevd: increase default number of workers
The uevent handling in udevd is not cpu hungry.
So, let's increase the default number of workers per cpu.
This decrease the number of queued uevents.
Without this commit (children_max is 16 on my laptop)
```
$ journalctl -b -u systemd-udevd.service | grep reached | wc -l
1544
```
With this commit (children_max is 30 on my laptop)
```
$ journalctl -b -u systemd-udevd.service | grep reached | wc -l
7
```
Yu Watanabe [Thu, 1 Nov 2018 01:37:51 +0000 (10:37 +0900)]
udevd: wait 3 seconds before killing worker processes
During boot process, many worker processes are forked and killed.
To decrease cycles of forking and killing worker, let's wait
3 seconds before killing workers. If new uevent or inotify event
comes within the delay, the killing porcess will be cancelled.
Frantisek Sumsal [Tue, 6 Nov 2018 08:04:10 +0000 (09:04 +0100)]
travis: move Docker setup to a separate script
This should make debugging somewhat easier
Yu Watanabe [Tue, 6 Nov 2018 08:46:00 +0000 (17:46 +0900)]
udevd: drop redundant logic of receiving uevent
If there exists pending uevents, then sd-event invokes uevent handler.
So, it is not necessary to receive the next uevent in inotify event.
Yu Watanabe [Tue, 6 Nov 2018 06:58:41 +0000 (15:58 +0900)]
udevd: decrease indentation
Lennart Poettering [Tue, 6 Nov 2018 14:44:24 +0000 (17:44 +0300)]
Merge pull request #10597 from toanju/fix-networkd-l3-loss
networkd: don't remove ip address or route
Yu Watanabe [Tue, 6 Nov 2018 06:55:09 +0000 (15:55 +0900)]
udevd: merge conditions to decrease indentation
Lennart Poettering [Tue, 6 Nov 2018 13:46:25 +0000 (16:46 +0300)]
Merge pull request #10650 from yuwata/udevadm-trigger-use-write-string-file
udevadm: use write_string_file() helper function
Tobias Jungel [Tue, 6 Nov 2018 08:55:35 +0000 (09:55 +0100)]
networkd: cleanup for #10542
fixes: 53b1f7d
Lennart Poettering [Tue, 6 Nov 2018 13:41:48 +0000 (16:41 +0300)]
Merge pull request #10652 from yuwata/lldp-ndisc-string-table
lldp,ndisc: update debug logs
Giuseppe Scrivano [Mon, 5 Nov 2018 22:06:14 +0000 (23:06 +0100)]
core, sysctl: skip ENOENT for /proc/sys/net/unix/max_dgram_qlen
sysctl is disabled for /proc mounted from an user namespace thus entries like
/proc/sys/net/unix/max_dgram_qlen do not exist. In this case, skip the error
and do not try to change the default for the AF_UNIX datagram queue length.
Lennart Poettering [Tue, 6 Nov 2018 11:34:01 +0000 (12:34 +0100)]
ask-password: fix minor memory leak on error path
CID 1396557
Tobias Jungel [Tue, 6 Nov 2018 12:28:12 +0000 (13:28 +0100)]
networkd: don't remove route
In case networkd is restarted this prevents a removal of an already existing
route that would be configured using networkd. With the proposed changes the
route will be kept on the interface without removing. This happens only on
physical hosts or VMs since networkd handles interface configuration slightly
different in containers.
Tobias Jungel [Wed, 31 Oct 2018 12:33:54 +0000 (13:33 +0100)]
networkd: don't remove ip address
In case networkd is restarted this prevents a removal of an already existing IP
address that would be configured using networkd. With the proposed changes the
IP address will be kept on the interface without removing. This happens only on
physical hosts or VMs since networkd handles interface configuration slightly
different in containers.
Yu Watanabe [Tue, 6 Nov 2018 12:23:52 +0000 (21:23 +0900)]
sd-device: use write_string_file() helper to write sysattr
Yu Watanabe [Tue, 6 Nov 2018 12:23:03 +0000 (21:23 +0900)]
fileio: introduce WRITE_STRING_FILE_NOFOLLOW flag for write_string_file() and friends
Yu Watanabe [Tue, 6 Nov 2018 12:00:07 +0000 (21:00 +0900)]
tree-wide: set WRITE_STRING_FILE_DISABLE_BUFFER flag when we write files under /proc or /sys
Yu Watanabe [Tue, 6 Nov 2018 11:28:25 +0000 (20:28 +0900)]
udevd: use set_oom_score_adjust() to set OOM score
Yu Watanabe [Tue, 6 Nov 2018 03:58:29 +0000 (12:58 +0900)]
udevadm: use write_string_file() helper function
Yu Watanabe [Tue, 6 Nov 2018 05:15:33 +0000 (14:15 +0900)]
test: add tests for string tables for lldp and ndisc events
Yu Watanabe [Tue, 6 Nov 2018 05:07:19 +0000 (14:07 +0900)]
ndisc: improve debug log message
Yu Watanabe [Tue, 6 Nov 2018 04:59:48 +0000 (13:59 +0900)]
lldp: improve debug log message
Lennart Poettering [Tue, 6 Nov 2018 11:08:26 +0000 (12:08 +0100)]
random-util: initialize srand() from RDRAND
It's cheap to get RDRAND and given that srand() is anyway not really
useful for trusted randomness let's use RDRAND for it, after all we have
all the hard work for that already in place.
Lennart Poettering [Tue, 6 Nov 2018 11:08:07 +0000 (12:08 +0100)]
random-util: we don't intend to write to auxv, hence make it const
Lennart Poettering [Tue, 6 Nov 2018 09:28:00 +0000 (12:28 +0300)]
Merge pull request #10611 from yuwata/udev-watch-log
udev-watch: update log levels and messages
Yu Watanabe [Tue, 30 Oct 2018 04:29:44 +0000 (13:29 +0900)]
udev-node: add one more debug log when failed to create symlink
Yu Watanabe [Tue, 30 Oct 2018 04:24:57 +0000 (13:24 +0900)]
udev-node: drop redundant log message
As node_symlink() logs almost same message.
Yu Watanabe [Fri, 26 Oct 2018 00:45:35 +0000 (09:45 +0900)]
udev: setting the same log level to SYSTEMD realm
Otherwise, many debug logs from libsystemd are dropped.
Yu Watanabe [Wed, 31 Oct 2018 05:47:50 +0000 (14:47 +0900)]
test: check returned value of sd_device_get_usec_since_initialized()
Yu Watanabe [Wed, 31 Oct 2018 01:01:45 +0000 (10:01 +0900)]
test: show is_initialized flag in log message of test-sd-device
And drop devpath, as it is redundant for most cases.
Yu Watanabe [Wed, 31 Oct 2018 01:01:11 +0000 (10:01 +0900)]
test: show name of testing functions in test-sd-device
Yu Watanabe [Thu, 1 Nov 2018 07:15:50 +0000 (16:15 +0900)]
sd-device: normalize debug messages
Yu Watanabe [Thu, 1 Nov 2018 07:12:46 +0000 (16:12 +0900)]
sd-device: drop subsystem from log_device_*()
The sd_device object always has syspath and sysname, but subsytem may not.
Also, it may take some costs to get subsystem.
So, let's drop subsystem from logs.
Yu Watanabe [Fri, 26 Oct 2018 23:24:25 +0000 (08:24 +0900)]
udev-watch: adjust level of log messages
Yu Watanabe [Fri, 26 Oct 2018 23:19:51 +0000 (08:19 +0900)]
udev-watch: make udev_watch_lookup() return 1 when device found
Yu Watanabe [Fri, 26 Oct 2018 23:06:40 +0000 (08:06 +0900)]
udev: drop redundant log message and fix returned error code
Frantisek Sumsal [Sun, 4 Nov 2018 17:23:30 +0000 (18:23 +0100)]
travis: rewrite .travis.yml and re-enable Travis CI for Fedora
Lennart Poettering [Mon, 5 Nov 2018 20:14:42 +0000 (23:14 +0300)]
Merge pull request #10606 from yuwata/udev-tests
test: mask hwdb-update.services in most tests
Lennart Poettering [Mon, 5 Nov 2018 14:37:25 +0000 (17:37 +0300)]
Merge pull request #10618 from yuwata/fix-10615
network: fix several issues in config parser
Lennart Poettering [Mon, 5 Nov 2018 13:11:50 +0000 (16:11 +0300)]
Merge pull request #10641 from yuwata/fix-10639
network: check the value of prefix length