Commit Graph

35569 Commits

Author SHA1 Message Date
Yu Watanabe f55f2dce05 resolve: use structured initializers 2018-10-11 18:35:04 +09:00
Zbigniew Jędrzejewski-Szmek abc8caf76c meson: use vars we already have defined in status 2018-10-11 11:10:53 +02:00
Zbigniew Jędrzejewski-Szmek a5d8835c78 mempool: only enable mempool use when linked to libsystemd-shared.so
Mempool use is enabled or disabled based on the mempool_use_allowed symbol that
is linked in.

Should fix assert crashes in external programs caused by #9792.
Replaces #10286.

v2:
- use two different source files instead of a gcc constructor
2018-10-11 11:10:37 +02:00
Zbigniew Jędrzejewski-Szmek 7c48ea0280 Move use_pool() to mempool.c and rename to mempool_enabled()
The only user is in hashmap.c, but it's a mempool thing.
2018-10-11 10:55:41 +02:00
Zbigniew Jędrzejewski-Szmek 6939fb9eb4 meson: update bug reference
https://github.com/mesonbuild/meson/issues/1644 was resolved in 0.42:
be4428005d,
but still no-go.
2018-10-11 10:55:41 +02:00
Zbigniew Jędrzejewski-Szmek c42c981924 meson: remove old comment
The linked page is gone, and I can't quite remember what the
warning was about. Something about recursive copying... Everything
seems to work.
2018-10-11 10:55:41 +02:00
Zbigniew Jędrzejewski-Szmek 5dbf13fa6c meson: drop workaround
It was added way back, and seems to work fine now without it.
2018-10-11 10:55:41 +02:00
Evgeny Vereshchagin 2614d83aa0 tests: pass halt_on_error=1 to UBSan
By default, UBSan neither crashes nor exits with a non-zero exit code
when undefined behavior has been detected. This is problematic because
it makes it much harder to catch issues like https://github.com/systemd/systemd/issues/10346,
 https://github.com/systemd/systemd/issues/10347, and https://github.com/systemd/systemd/issues/10333.
In fact, those issue were found just because I decided to grep
the test log, which isn't something that I normally do :-)

As it turns out, the only way to make UBSan signal that something is wrong that works more or less
reliably everywhere is to pass halt_on_error=1 (though, it's probably worth noting that it's currently
not set for PID1 in order not to trigger kernel panics).

See https://reviews.llvm.org/D35085#804183 and https://chromium.googlesource.com/chromium/src/testing/libfuzzer/+/HEAD/reference.md
2018-10-11 08:55:04 +02:00
Yu Watanabe 07a26e42da udev-builtin: move definitions related to builtin commands to udev-builtin.h 2018-10-11 04:21:14 +09:00
Yu Watanabe 7d68eb1bdf udev-ctrl: move prototypes of udev_ctrl_*() to udev-ctrl.h 2018-10-11 04:21:14 +09:00
Yu Watanabe a2554acec6 udev-node: replace udev_device by sd_device and modernize code a bit 2018-10-11 04:21:14 +09:00
Yu Watanabe 7006860271 udev-watch: replace udev_device by sd_device and modernize code a bit 2018-10-11 04:21:14 +09:00
Yu Watanabe da4bb75f59 udev: drop unused function udev_build_argv() 2018-10-11 04:21:14 +09:00
dana 3118a4cf17 man: clarify behaviour of RandomizedDelaySec= 2018-10-10 16:15:05 +02:00
Zbigniew Jędrzejewski-Szmek 2a56a88f46
Merge pull request #10316 from poettering/json-api
just the json stuff from #9762
2018-10-10 14:21:18 +02:00
Yu Watanabe 12a509e512
Merge pull request #10351 from keszybz/meson-cpp-fixups
Meson c++-related fixups
2018-10-10 19:50:35 +09:00
Zbigniew Jędrzejewski-Szmek f436470ae1
Merge pull request #10343 from poettering/manager-state-fix
various fixes for PID1's Manager object
2018-10-10 12:36:16 +02:00
Zbigniew Jędrzejewski-Szmek 98359a012a
Merge pull request #10349 from poettering/bus-creds-shift-overflow
sd-bus creds bitshift overflow fix
2018-10-10 12:04:33 +02:00
Lennart Poettering 65f95765d0 tree-wide: various ubsan zero size memory fixes
Fixes: #10346
2018-10-10 12:00:56 +02:00
Zbigniew Jędrzejewski-Szmek c09edc79ab meson: c++ is required for the fuzzer builds
The configuration would fail with an error about cpp being an unknown language
anyway, but it's nicer to fail early and explicitly.

https://github.com/systemd/systemd/pull/10339#issuecomment-428279175
2018-10-10 11:56:45 +02:00
Zbigniew Jędrzejewski-Szmek 9b0ca01903 meson: rename cpp_cmd to cxx_cmd
cpp is a really bad alias for c++ because it's also the name of the
preprocessor. Let's rename the variable.
2018-10-10 11:50:57 +02:00
Lennart Poettering 92a40e20bf sd-bus: call cap_last_cap() only once in has_cap()
Also, use the same type everywhere for dealing with it.
2018-10-10 11:13:00 +02:00
Lennart Poettering 3cae6c21e7 sd-bus: use size_t when dealing with memory offsets 2018-10-10 11:12:22 +02:00
Lennart Poettering 5f00c5684f capability: introduce CAP_TO_MASK_CORRECTED() macro replacing CAP_TO_MASK()
linux/capability.h's CAP_TO_MASK potentially shifts a signed int "1"
(i.e. 32bit wide) left by 31 which means it becomes negative. That's
just weird, and ubsan complains about it. Let's introduce our own macro
CAP_TO_MASK_CORRECTED which doesn't fall into this trap, and make use of
it.

Fixes: #10347
2018-10-10 11:11:48 +02:00
Evgeny Vereshchagin 6315d12bba tests: add a fuzzer for the json parser and dumper 2018-10-10 10:13:30 +02:00
Lennart Poettering 788c34be32 json: add test 2018-10-10 10:13:30 +02:00
Lennart Poettering cd0b6c5390 json: add a nice JSON parser
As preparation for OCI support in nspawn, let's add a JSON parser.

The json.h file contains an explanation why this is new code instead of
just us linking against an existing JSON library.
2018-10-10 10:13:30 +02:00
Asbjørn Apeland ca92fe36e0 man: fix typo 2018-10-10 09:57:57 +02:00
Yu Watanabe 0ae286e697 network: make netlink callbacks return 1
This is not necessary. But most of netlink callbacks in networkd
return 1.
2018-10-10 14:43:05 +09:00
Yu Watanabe c8ee637e7f network: use '_handler' suffix for netlink callbacks 2018-10-10 14:43:05 +09:00
Yu Watanabe c6de4729b1 network: rename ndisc_netlink_handler() to ndisc_route_handler() 2018-10-10 14:43:05 +09:00
Yu Watanabe 26d6b2147e network: drop break line in comment 2018-10-10 14:43:05 +09:00
Yu Watanabe e6bf77744a network: make netlink callback not return negative value
Fixes #10320.
2018-10-10 14:43:05 +09:00
Yu Watanabe e8d1666687 network: drop route_expire_callback() as it is duplicate of link_route_remove_handler() 2018-10-10 14:43:05 +09:00
Yu Watanabe fdb20b7c59 network: make manager_dhcp6_prefix_remove() static 2018-10-10 14:43:05 +09:00
Yu Watanabe 09dd32eea7 network: make netdev_enslave() static 2018-10-10 14:43:05 +09:00
Yu Watanabe 17e57d3cae networkd: drop unused element from AddressLabel struct 2018-10-10 14:43:05 +09:00
Yu Watanabe 9bcb210ebc network: add missing set_free() for Manager.dirty_links 2018-10-10 14:43:05 +09:00
Yu Watanabe 1046bf9b1a network: add destroy callbacks for asynchronous netlink calls 2018-10-10 14:43:05 +09:00
Yu Watanabe 0d0f02cd15 test: add tests for destroy callback of asynchronous netlink call 2018-10-10 14:43:05 +09:00
Yu Watanabe 545bab1f0a sd-netlink: add destroy_callback argument to sd_netlink_call_async() 2018-10-10 14:43:05 +09:00
Yu Watanabe 2fea60901d sd-netlink: use structured initializers 2018-10-10 14:43:05 +09:00
Yu Watanabe f6bdbd9e00 sd-netlink: fix error handling in sd_netlink_call_async() 2018-10-10 14:43:05 +09:00
Lennart Poettering 3316429f19
Merge pull request #10062 from rgushchin/device
Support cgroup v2 bpf-based device controller
2018-10-09 23:29:27 +02:00
Zbigniew Jędrzejewski-Szmek 1b2acaa7a6 meson: we cannot call get_compiler('cpp') if we didn't "add" it
Follow-up for f6d783ac3d.
2018-10-09 21:12:00 +02:00
Lennart Poettering 13711093ef bpf-firewall: always use log_unit_xyz() insteadof log_xyz()
That way it's easier to figure out what the various messages belong to
2018-10-09 21:11:41 +02:00
Lennart Poettering 4cf997befa device: clean up DeviceFound flags set
No need to avoid bit 0. Also the U suffix has no effect, don't use it.
2018-10-09 21:11:22 +02:00
Lennart Poettering 5f616d5feb core: add missing 'continue' statement 2018-10-09 21:11:06 +02:00
Lennart Poettering eb523bfb51 core: include environment generator runtime in generator timestamps
Currently they aren't covered and it probably isn't worth adding another
kind of timestamp just for this, hence simply include it in the regular
generator timestamps.
2018-10-09 19:43:43 +02:00
Lennart Poettering 5ce5e1ad08 core: add a common helper call manager_ready() sharing some common code between manager_reload() and manager_startup()
Just sharing some common code. No functional changes
2018-10-09 19:43:43 +02:00