Commit Graph

36391 Commits

Author SHA1 Message Date
Mike Gilbert 33dbab6fde random-util: allow RDRAND to be used in 32-bit x86 binaries
Rename rdrand64 to rdrand, and switch from uint64_t to unsigned long.
This produces code that will compile/assemble on both x86-64 and x86-32.

This could be useful when running a 32-bit copy of systemd on a modern
Intel processor.

RDRAND is inherently arch-specific, so relying on the compiler-defined
'long' type seems reasonable.
2018-11-10 14:56:53 +01:00
Yu Watanabe deb2b7348e sd-device: drop priority and description from sd_device_monitor_attach_event() and sd_device_monitor_start()
Now we have sd_device_monitor_get_event_soruce(). So, it is not
necessary to include these parameters in the functions for sd_device_monitor.
2018-11-10 22:53:00 +09:00
Yu Watanabe bf7712b63e sd-device: add sd_device_monitor_get_event_source() 2018-11-10 22:53:00 +09:00
Lennart Poettering e29a9fcb29
Merge pull request #10717 from yuwata/fix-oss-fuzz-11324
network: add missing verification for ip6gretap and sit
2018-11-10 14:18:22 +01:00
Yu Watanabe 8d578a2e73 sd-device: fix possible use of uninitialized value 2018-11-10 11:59:32 +01:00
Yu Watanabe 20a51f6a26 id128,analyze: fix layout of help message 2018-11-10 11:58:50 +01:00
Evgeny Vereshchagin 313992dfb5 basic: make rdrand64 a little bit more MSAn-friendly
MSan doesn't instrument inline asm calls so let's help it
by marking err as initialized manually.

Fixes: https://github.com/systemd/systemd/issues/10714.
2018-11-10 11:58:09 +01:00
Evgeny Vereshchagin 110a13202e udev-test: skip the test only if it can't setup its environment
This is basically a replacement for 0eb3cc8850.
2018-11-10 11:56:59 +01:00
Yu Watanabe 3ee0942908 fuzz: add testcase for oss-fuzz#11324 2018-11-10 15:53:32 +09:00
Yu Watanabe 30dce346d8 network: add missing verification for ip6gretap and sit
Fixes oss-fuzz#11324.
2018-11-10 15:53:18 +09:00
Zbigniew Jędrzejewski-Szmek a90db619ca shared: fix typo 2018-11-10 07:43:57 +01:00
David Anderson d29dc4f1b8 Add a networkd test for 6rd interface creation.
Unfortunately we can't check the 6rd attribute, because it's not
exposed in /sys or anywhere other than netlink... But at least we
can check that networkd brings up an interface that looks right.
2018-11-09 18:45:38 -08:00
David Anderson 6e42bd5504 Add 6rd directive to the netdev fuzzing corpus. 2018-11-09 17:56:33 -08:00
David Anderson d067cab35c networkd: support 6rd tunnel netdev setup. 2018-11-09 17:56:33 -08:00
Evgeny Vereshchagin b0395ac5cd travis: treat warnings as errors while building systemd 2018-11-10 03:27:19 +03:00
Zbigniew Jędrzejewski-Szmek b98a3c286e man: add missing link in sd-bus(3)
Follow-up for 576af73f4a.
2018-11-09 21:40:21 +01:00
Zbigniew Jędrzejewski-Szmek e8f280bd0a sd_bus: use structured intialization in one more place 2018-11-09 21:40:21 +01:00
Michael Biebl 631e393a21 man: fix system.generator in systemd.unit
Fixes: #10713
2018-11-09 21:39:59 +01:00
Zbigniew Jędrzejewski-Szmek 15e9a42074
Merge pull request #10306 from poettering/nspawn-ref-unref
nspawn scope lifecycle fixes
2018-11-09 20:49:31 +01:00
Zbigniew Jędrzejewski-Szmek 826bc13135
Merge pull request #10711 from poettering/sd-bus-close-man
sd-bus: add docs for a couple of sd-bus APIs
2018-11-09 20:46:45 +01:00
Lennart Poettering 067e995c72 sd-path: drop redundant "= 0ULL" assignment in enum
This has exactly zero effect as the type of an enum is not derived from
the integer types assigned to its items.
2018-11-09 17:19:45 +01:00
Lennart Poettering 7685329311 TODO 2018-11-09 17:15:34 +01:00
Lennart Poettering bedea99dce core: expose bus client names currently reffing a unit as property
This is useful for debugging client-side ref counting of units: for each
ref taken on a unit the client's sender name is listed. If a client has
multiple refs on the same unit it is listed multiple times.
2018-11-09 17:15:34 +01:00
Lennart Poettering b92d0b4c5a machined: rework referencing of machine scopes from machined, too
When a machine scope is registered by machined, let's add a reference to
it, and change the GC mode so that the unit is cleaned up as soon as
machined drops the reference, regardless of the fail state.

Fixes: #2809
2018-11-09 17:15:34 +01:00
Lennart Poettering 48c3512269 man: document sd_bus_attach_event() 2018-11-09 17:09:52 +01:00
Lennart Poettering eda0d9a13b man: document sd_bus_flush_close_unref() 2018-11-09 17:09:52 +01:00
Lennart Poettering 576af73f4a man: document sd_bus_close() + sd_bus_flush() 2018-11-09 17:09:52 +01:00
Lennart Poettering 1d78fea2d6 nspawn: rework how we allocate/kill scopes
Fixes: #6347
2018-11-09 17:08:59 +01:00
Lennart Poettering df61bc5e4a nspawn: merge two variable declaration lines 2018-11-09 17:08:59 +01:00
Lennart Poettering 11d81e506e nspawn: simplify machine terminate bus call
We have the machine name anyway, let's use TerminateMachine() on
machined's Manager object directly with it. That way it's a single
method call only, instead of two, to terminate the machine.
2018-11-09 17:08:59 +01:00
Lennart Poettering e5a2d8b5b5 nspawn: make use of the new sd_bus_set_close_on_exit() call in nspawn 2018-11-09 17:08:59 +01:00
Lennart Poettering c4e48030cf sd-bus: make "close+flush-on-exit" optional when using sd-event with sd-bus
This adds a new pair of API calls sd_bus_set_close_on_exit() and
sd_bus_get_close_on_exit(). They control whether an sd_bus object
attached to a an sd-event loop shall automatically be flushed/closed
when the event loop goes down. Usually that's a good thing, except for
very few cases where the bus connection is longer living than the event
loop it is attached on. Specifically, this is the case for nspawn, where
we run the event loop only while the container is up, but afterwards
still want to be able to use the bus connection.
2018-11-09 17:08:59 +01:00
Lennart Poettering e5c36295d8 unit: enqueue cgroup empty check event if the last ref on a unit is dropped 2018-11-09 17:08:59 +01:00
Lennart Poettering c20076a8c1 pid1: add a new AbandonScope() method call on the Manager object
This is the same as Abandon() on the Scope object, but saves clients
from first translating a unit name into a unit object path. This logic
matches how all the other unit methods have counterparts on the Manager
object too (e.g. StopUnit() on the Manager object matching Stop() on the
Unit object), this one was simply forgotten so far.
2018-11-09 17:08:59 +01:00
Frantisek Sumsal 7a30256588 tests: keep SYS_PTRACE when running under ASan 2018-11-09 16:26:19 +01:00
Lennart Poettering 3306711ffb
Merge pull request #10695 from yuwata/fuzz-network-fixes
network: fix recent issues found by oss-fuzz
2018-11-09 14:49:37 +01:00
Yu Watanabe 872faf59c0 fuzz: add testcases of recent issues 2018-11-09 11:45:43 +09:00
Yu Watanabe e512c6c1aa network: fix potential segfault in network_free() 2018-11-09 11:45:12 +09:00
Yu Watanabe d493d82647 network: fix offset for IPv6MTUByte=
Fixes oss-fuzz#11302 and oss-fuzz#11314.
2018-11-09 11:44:51 +09:00
Evgeny Vereshchagin 881886ef08 udev-test: remove a check for whether the test is run in a container
It's too broad a check that prevents the test from running on Travis CI.
2018-11-09 03:34:08 +01:00
Evgeny Vereshchagin 911efe0fbf
Merge pull request #10678 from evverx/more-travis-tweaks
travis: also rebuild everything with ASan and UBSan and install dependencies necessary for running parse-hwdb.py
2018-11-09 01:43:57 +03:00
Lennart Poettering c2baf11c36 cgroup: actually reset the cgroup invalidation mask after we made our changes
Previously we never unmasked the mask after it was set once. Let's fix
that.
2018-11-08 15:20:52 +01:00
Lennart Poettering 6529ccfa20 unit: replace three non-type-safe macros by type-safe inline functions
Behaviour is prett ymuch the same, but there's some additional type
checking done on the input parameters.

(In the case of UNIT_WRITE_FLAGS_NOOP() the C compiler won't actually do
the type checking necessarily, but static chckers at least could)
2018-11-08 13:55:25 +01:00
Evgeny Vereshchagin cdd116b4e1 travis: use 3 times the normal timeout when the tests are run under ASan+UBSan 2018-11-08 13:49:46 +01:00
Evgeny Vereshchagin 993476841a travis.yml: replace test-capability with a script exiting with 77
The test is currently failing when run under ASan in a docker container:
```
--- command ---
SYSTEMD_KBD_MODEL_MAP='/build/src/locale/kbd-model-map' PATH='/build/build:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' SYSTEMD_LANGUAGE_FALLBACK_MAP='/build/src/locale/language-fallback-map' /build/build/test-capability
--- stderr ---
have ambient caps: yes
Capabilities:= cap_chown,cap_dac_override,cap_dac_read_search,cap_fowner,cap_fsetid,cap_kill,cap_setgid,cap_setuid,cap_setpcap,cap_linux_immutable,cap_net_bind_service,cap_net_broadcast,cap_net_admin,cap_net_raw,cap_ipc_lock,cap_ipc_owner,cap_sys_module,cap_sys_rawio,cap_sys_chroot,cap_sys_ptrace,cap_sys_pacct,cap_sys_admin,cap_sys_boot,cap_sys_nice,cap_sys_resource,cap_sys_time,cap_sys_tty_config,cap_mknod,cap_lease,cap_audit_write,cap_audit_control,cap_setfcap,cap_mac_override,cap_mac_admin,cap_syslog,cap_wake_alarm,cap_block_suspend,cap_audit_read+eip
Capabilities:= cap_dac_override,cap_net_raw+ep
==7021==LeakSanitizer has encountered a fatal error.
==7021==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1
==7021==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)
Assertion 'WIFEXITED(status) && WEXITSTATUS(status) == 0' failed at ../src/test/test-capability.c:71, function fork_test(). Aborting.
-------
```

https://api.travis-ci.org/v3/job/452349948/log.txt
2018-11-08 13:49:46 +01:00
Frantisek Sumsal 6c8a51ed78 travis: run ASan job in parallel with the standard one 2018-11-08 13:49:46 +01:00
Evgeny Vereshchagin 6dfe7f43d0 travis: UBSan should be every C programmer's friend so let's build systemd with it too 2018-11-08 13:49:45 +01:00
Evgeny Vereshchagin 86f4edef54 test: initialize hwdb so that the test won't try to free memory it has never allocated
See https://github.com/systemd/systemd/pull/10678#issuecomment-436790906.
2018-11-08 13:49:45 +01:00
Evgeny Vereshchagin 79f6178ee1 travis: move the ASan part into a separate stage 2018-11-08 13:49:45 +01:00
Evgeny Vereshchagin 1667d63acc travis: also rebuild everything with ASan
It should help to catch issues like https://github.com/systemd/systemd/issues/10677.
2018-11-08 13:49:45 +01:00