Lennart Poettering [Wed, 17 Jul 2019 16:58:44 +0000 (18:58 +0200)]
swap: scan /proc/swaps before processing waitid() results
Similar to the previous commit, but for /proc/swaps, where the same
logic and rationale applies.
(cherry picked from commit
bcce581d65de68cca01c73e1c890e261e72d20af)
Related: #
1696178
Lennart Poettering [Wed, 17 Jul 2019 16:57:13 +0000 (18:57 +0200)]
mount: rescan /proc/self/mountinfo before processing waitid() results
(The interesting bits about the what and why are in a comment in the
patch, please have a look there instead of looking here in the commit
msg).
Fixes: #10872
(cherry picked from commit
350804867dbcc9b7ccabae1187d730d37e2d8a21)
Conflicts:
src/core/mount.c
Resolves: #
1696178
Lennart Poettering [Wed, 17 Jul 2019 12:53:07 +0000 (14:53 +0200)]
mount: simplify /proc/self/mountinfo handler
Our IO handler is only installed for one fd, hence there's no reason to
conditionalize on it again.
Also, split out the draining into a helper function of its own.
(cherry picked from commit
fcd8e119c28be19ffbc5227089cf4d3b8ba60238)
Conflicts:
src/core/mount.c
Related: #
1696178
Jan Synacek [Thu, 6 Jun 2019 07:35:27 +0000 (09:35 +0200)]
rules: skip memory hotplug on ppc64
Resolves (#
1713159)
Jan Synacek [Tue, 14 May 2019 08:45:08 +0000 (10:45 +0200)]
man: note that journal does not validate syslog fields
(cherry picked from commit
63ea8032f28052f7cda860e5324c0a83dee7ed23)
Resolves: #
1707175
Yu Watanabe [Thu, 6 Dec 2018 17:51:56 +0000 (18:51 +0100)]
bash-completion: analyze: support 'security'
(cherry picked from commit
83da42c3bf86e8787cfec2c7fb6ca379dfec3632)
Resolves: #
1733395
Jonathon Kowalski [Thu, 17 Jan 2019 17:08:00 +0000 (17:08 +0000)]
Change job mode of manager triggered restarts to JOB_REPLACE
Fixes: #11305
Fixes: #3260
Related: #11456
So, here's what happens in the described scenario in #11305. A unit goes
down, and that triggeres stop jobs for the other two units as they were
bound to it. Now, the timer for manager triggered restarts kicks in and
schedules a restart job with the JOB_FAIL job mode. This means there is
a stop job installed on those units, and now due to them being bound to
us they also get a restart job enqueued. This however is a conflicts, as
neither stop can merge into restart, nor restart into stop. However,
restart should be able to replace stop in any case. If the stop
procedure is ongoing, it can cancel the stop job, install itself, and
then after reaching dead finish and convert itself to a start job.
However, if we increase the timer, then it can always take those units
from inactive -> auto-restart.
We change the job mode to JOB_REPLACE so the restart job cancels the
stop job and installs itself.
Also, the original bug could be worked around by bumping RestartSec= to
avoid the conflicting.
This doesn't seem to be something that is going to break uses. That is
because for those who already had it working, there must have never been
conflicting jobs, as that would result in a desctructive transaction by
virtue of the job mode used.
After this change, the test case is able to work nicely without issues.
(cherry picked from commit
03ff2dc71ecb09272d728d458498b44f7f132f51)
Resolves: #
1712524
Zhang Xianwei [Mon, 13 May 2019 10:41:55 +0000 (18:41 +0800)]
udev/scsi_id: fix incorrect page length when get device identification VPD page
The length of device identification VPD page is filled with two bytes,
but scsi_id only gets the low byte. Fix it.
Signed-off-by: Zhang Xianwei <zhang.xianwei8@zte.com.cn>
(cherry picked from commit
1f7b6872dbe8ccae1f3bda9aa6aeb87c9b42e01e)
Resolves: #
1713227
Milan Broz [Mon, 27 May 2019 07:44:14 +0000 (09:44 +0200)]
cryptsetup: Add LUKS2 token support.
LUKS2 supports so-called tokens. The libcryptsetup internally
support keyring token (it tries to open device using specified
keyring entry).
Only if all token fails (or are not available), it uses a passphrase.
This patch aligns the functionality with the cryptsetup utility
(cryptsetup luksOpen tries tokens first) but does not replace
the systemd native ask-password function (can be used the same in
combination with this patch).
(cherry picked from commit
894bb3ca4c730cc9e9d46ef5004ba4ca5e201d8d)
Resolves: #
1719153
Milan Broz [Mon, 27 May 2019 07:43:03 +0000 (09:43 +0200)]
cryptsetup: call crypt_load() for LUKS only once
The crypt_load() for LUKS2 can read a quite big area of disk
(metadata area size is configurable and can increase up to megabytes).
This initialization is not needed to be repeated, just use the existing context.
(This patch is also required for the following change.)
(cherry picked from commit
ea9a9d49e4af31c49e5c216e7e5e2f533e727579)
Related: #
1719153
Milan Broz [Mon, 27 May 2019 07:27:54 +0000 (09:27 +0200)]
cryptsetup: Do not fallback to PLAIN mapping if LUKS data device set fails.
If crypt_load() for LUKS succeeds, we know that it is a LUKS device.
Failure of data device setting should fail in this case; remapping
as a PLAIN device late could mean data corruption.
(If a user wants to map PLAIN device over a device with LUKS header,
it should be said explicitly with "plain" argument type.)
Also, if there is no explicit PLAIN type requested and crypt device
is already initialized (crypt_data_type() is set), do not run
the initialization again.
(cherry picked from commit
2e4beb875bcb24e7d7d4339cc202b0b3f2953f71)
Related: #
1719153
Yu Watanabe [Fri, 10 Aug 2018 02:07:54 +0000 (11:07 +0900)]
journal: do not remove multiple spaces after identifier in syslog message
Single space is used as separator.
C.f. discussions in #156.
Fixes #9839 introduced by
a6aadf4ae0bae185dc4c414d492a4a781c80ffe5.
(cherry picked from commit
8595102d3ddde6d25c282f965573a6de34ab4421)
Resolves: #
1691817
Yu Watanabe [Mon, 11 Mar 2019 03:27:18 +0000 (12:27 +0900)]
journal-remote: do not request Content-Length if Transfer-Encoding is chunked
This fixes a bug introduced by
7fdb237f5473cb8fc2129e57e8a0039526dcb4fd.
Closes #11571.
(cherry picked from commit
a289dfd69b3ff4bccdde93e84b67c947bafa27e1)
Resolves: #
1708849
Lennart Poettering [Mon, 25 Feb 2019 10:02:46 +0000 (11:02 +0100)]
sd-bus: deal with cookie overruns
Apparently this happens IRL. Let's carefully deal with issues like this:
when we overrun, let's not go back to zero but instead leave the highest
cookie bit set. We use that as indication that we are in "overrun
territory", and then are particularly careful with checking cookies,
i.e. that they haven't been used for still outstanding replies yet. This
should retain the quick cookie generation behaviour we used to have, but
permits dealing with overruns.
Replaces: #11804
Fixes: #11809
(cherry picked from commit
1f82f5bb4237ed5f015daf93f818e9db95e764b8)
Resolves: #
1694999
Yu Watanabe [Wed, 27 Jun 2018 05:50:19 +0000 (14:50 +0900)]
journal-gateway: use localStorage["cursor"] only when it has valid value
Discovered by LGTM.
(cherry picked from commit
944072feddb73333023d0a98bf87fd2a17f894d3)
Resolves: #
1705971
Yu Watanabe [Sat, 8 Dec 2018 10:33:37 +0000 (19:33 +0900)]
tools: drop unused variable
(cherry picked from commit
2f6c9b6f3fb0128cee7f74985c143b4850feff6d)
Resolves: #
1705971
Yu Watanabe [Wed, 27 Jun 2018 05:22:24 +0000 (14:22 +0900)]
journal-gateway: explicitly declare local variables
Suggested by LGTM.
(cherry picked from commit
c497e449f41774a36e01ae2cc2abade6133dffe1)
Resolves: #
1705971
Lennart Poettering [Tue, 17 Jul 2018 10:35:12 +0000 (12:35 +0200)]
test: add test for Type=exec
(cherry picked from commit
0e1f17561f5f6061ec5503de044298372ed7ca37)
Resolves: #
1683334
Lennart Poettering [Tue, 17 Jul 2018 10:24:50 +0000 (12:24 +0200)]
sd-login: let's also make sd-login understand ".host"
if sd-bus and machined grok it, then sd-login should grok it too.
(cherry picked from commit
a8c9b7a0fc0aa02666042543ff9a652aae3c9499)
Resolves: #
1683334
Lennart Poettering [Tue, 17 Jul 2018 10:23:26 +0000 (12:23 +0200)]
sd-bus: allow connecting to the pseudo-container ".host"
machined exposes the pseudo-container ".host" as a reference to the host
system, and this means "machinectl login .host" and "machinectl shell
.host" get your a login/shell on the host. systemd-run currently doesn't
allow that. Let's fix that, and make sd-bus understand ".host" as an
alias for connecting to the host system.
(cherry picked from commit
1e5057b904473696ae0d591d7555233adcb51fa4)
Resolves: #
1683334
Lennart Poettering [Tue, 17 Jul 2018 10:01:26 +0000 (12:01 +0200)]
man: document the new Type=exec type
And while we are at it, let's rearrange and extend the Type=
documentation a bit. Let's make it an itemized list, and let's add a
paragraph explaining which type best to use.
(cherry picked from commit
79905a246d645d21633f09f564b3672d5085a85c)
Resolves: #
1683334
Lennart Poettering [Tue, 17 Jul 2018 09:47:14 +0000 (11:47 +0200)]
core: introduce new Type=exec service type
Users are often surprised that "systemd-run" command lines like
"systemd-run -p User=idontexist /bin/true" will return successfully,
even though the logs show that the process couldn't be invoked, as the
user "idontexist" doesn't exist. This is because Type=simple will only
wait until fork() succeeded before returning start-up success.
This patch adds a new service type Type=exec, which is very similar to
Type=simple, but waits until the child process completed the execve()
before returning success. It uses a pipe that has O_CLOEXEC set for this
logic, so that the kernel automatically sends POLLHUP on it when the
execve() succeeded but leaves the pipe open if not. This means PID 1
waits exactly until the execve() succeeded in the child, and not longer
and not shorter, which is the desired functionality.
Making use of this new functionality, the command line
"systemd-run -p User=idontexist -p Type=exec /bin/true" will now fail,
as expected.
(cherry picked from commit
5686391b006ee82d8a4559067ad9818e3e631247)
Resolves: #
1683334
Lennart Poettering [Thu, 5 Jul 2018 08:00:52 +0000 (10:00 +0200)]
execute: use our usual syntax for defining bit masks
(cherry picked from commit
ce0d60a7c4e07c5bdfed9f076bd48752287f0777)
Resolves: #
1683334
Lennart Poettering [Thu, 5 Jul 2018 07:56:54 +0000 (09:56 +0200)]
core: swap order of "n_storage_fds" and "n_socket_fds" parameters
When process fd lists to pass to activated programs we always place the
socket activation fds first, and the storage fds last. Irritatingly in
almost all calls the "n_storage_fds" parameter (i.e. the number of
storage fds to pass) came first so far, and the "n_socket_fds" parameter
second. Let's clean this up, and specify the number of fds in the order
the fds themselves are passed.
(Also, let's fix one more case where "unsigned" was used to size an
array, while we should use "size_t" instead.)
(cherry picked from commit
25b583d7ffd699384435eba8e49f6ce927a83af0)
Resolves: #
1683334
Filipe Brandenburger [Wed, 25 Jul 2018 01:46:01 +0000 (18:46 -0700)]
socket-util: Introduce send_one_fd_iov() and receive_one_fd_iov()
These take a struct iovec to send data together with the passed FD.
The receive function returns the FD through an output argument. In case data is
received, but no FD is passed, the receive function will set the output
argument to -1 explicitly.
Update code in dynamic-user to use the new helpers.
(cherry picked from commit
d34673ecb825aa9ecf6958b0caab792f5061c56a)
Resolves: #
1683319
Filipe Brandenburger [Wed, 25 Jul 2018 03:15:55 +0000 (20:15 -0700)]
test-socket-util: Add tests for receive_fd_iov() and friends.
Test it when sending an FD without any contents, or an FD and some contents,
or only contents and no FD (using a bare send().)
Also fix the previous test which forked but was missing an _exit() at the
end of the child execution code.
(cherry picked from commit
8a3386ab4fea9c4efa9c72e7c149cf510a46f03e)
Resolves: #
1683319
Frantisek Sumsal [Sat, 23 Feb 2019 21:28:05 +0000 (22:28 +0100)]
travis: switch from trusty to xenial
This should fix the timeout in test-event
Taken from:
b635e4ef6b2f35f07111bb66a68fe850a2ccab72
Resolves: #
1683319
Lennart Poettering [Sat, 8 Dec 2018 19:21:43 +0000 (20:21 +0100)]
mount-point: honour AT_SYMLINK_FOLLOW correctly
Fixes: #11092
(cherry picked from commit
be24321f3dae91a166166b239954032727439942)
Resolves: #
1683319
Lennart Poettering [Wed, 10 Oct 2018 09:12:54 +0000 (11:12 +0200)]
sd-bus: call cap_last_cap() only once in has_cap()
Also, use the same type everywhere for dealing with it.
(cherry picked from commit
92a40e20bf970c3ded8a50fbeeae882a7b970c9a)
Resolves: #
1683319
Lennart Poettering [Wed, 10 Oct 2018 09:12:22 +0000 (11:12 +0200)]
sd-bus: use size_t when dealing with memory offsets
(cherry picked from commit
3cae6c21e732fd46ff024d6625243d88ef6377ed)
Resolves: #
1683319
Lennart Poettering [Wed, 10 Oct 2018 09:07:54 +0000 (11:07 +0200)]
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
(cherry picked from commit
5f00c5684f96c93a22840f7241ee444b9a632b1e)
Resolves: #
1683319
Evgeny Vereshchagin [Fri, 12 Oct 2018 12:17:04 +0000 (12:17 +0000)]
sd-journal: escape binary data in match_make_string()
Fixes: #10383
(cherry picked from commit
9e8b1ec08e8eb0b4611b7caf6adb8828feb32312)
Resolves: #
1683319
Zbigniew Jędrzejewski-Szmek [Tue, 21 Aug 2018 17:44:48 +0000 (19:44 +0200)]
test-socket-util: avoid "memleak" reported by valgrind
valgrind reports the allocation done in the short-lived child as a leak.
Let's restructure the code to avoid this.
(cherry picked from commit
181c4ba750770b54a54b5abbe8ae8ff4f6db59b5)
Resolves: #
1683319
Yu Watanabe [Wed, 8 Aug 2018 07:22:55 +0000 (16:22 +0900)]
util: introduce memcmp_safe()
(cherry picked from commit
f30faf854b9bf01da294547a1bc3660506d750db)
Resolves: #
1683319
Lennart Poettering [Wed, 10 Oct 2018 09:34:30 +0000 (11:34 +0200)]
tree-wide: various ubsan zero size memory fixes
Fixes: #10346
(cherry picked from commit
65f95765d05ddcd9e5849b68c379afa7e87d1248)
Resolves: #
1683319
Frantisek Sumsal [Fri, 9 Nov 2018 11:47:30 +0000 (12:47 +0100)]
tests: keep SYS_PTRACE when running under ASan
(cherry picked from commit
7a3025658836c536f81fdd742fa338545294f5bf)
Resolves: #
1683319
Frantisek Sumsal [Sat, 23 Feb 2019 16:10:55 +0000 (17:10 +0100)]
travis: enable ASan and UBSan on RHEL8
Resolves: #
1683319
rhel-only
Yu Watanabe [Wed, 22 Aug 2018 03:33:27 +0000 (12:33 +0900)]
util: do not use stack frame for parsing arbitrary inputs
This replaces strndupa() by strndup() in socket_address_parse(),
as input string may be too long.
Fixes issue 10007 by ClusterFuzz-External:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10007
(cherry picked from commit
8d30fcb9b51b1d102a589171b6e28f5f370236f6)
Resolves: #
1696224
Zbigniew Jędrzejewski-Szmek [Thu, 23 Aug 2018 12:48:40 +0000 (14:48 +0200)]
bus-message: avoid wrap-around when using length read from message
We would read (-1), and then add 1 to it, call message_peek_body(..., 0, ...),
and when trying to make use of the data.
The fuzzer test case is just for one site, but they all look similar.
v2: fix two UINT8_MAX/UINT32_MAX mismatches founds by LGTM
(cherry picked from commit
902000c19830f5e5a96e8948d691b42e91ecb1e7)
Resolves: #
1696224
Zbigniew Jędrzejewski-Szmek [Sat, 11 Aug 2018 09:43:09 +0000 (11:43 +0200)]
bus-message: return -EBADMSG not -EINVAL on invalid !gvariant messages
(cherry picked from commit
d831fb6f2bde829f9309aea242f502587662d1cc)
Resolves: #
1696224
Zbigniew Jędrzejewski-Szmek [Sat, 11 Aug 2018 09:31:45 +0000 (11:31 +0200)]
fuzz-bus-message: add two test cases that pass now
It seems that they got fixed by one of the patches. Let's add them
just in case.
(cherry picked from commit
edde66ffc2404de58e8b19810951f376efb344da)
Resolves: #
1696224
Zbigniew Jędrzejewski-Szmek [Sat, 11 Aug 2018 07:02:48 +0000 (09:02 +0200)]
bus-message: also properly copy struct signature when skipping
The change is similar to that in the previous commit, but I don't have
a reproducer / test case case for this one, so I'm keeping it seperate.
(cherry picked from commit
3d338a302f56c0ef0445660d9856794abe1af8b5)
Resolves: #
1696224
Zbigniew Jędrzejewski-Szmek [Sat, 11 Aug 2018 06:32:20 +0000 (08:32 +0200)]
bus-message: fix skipping of array fields in !gvariant messages
We copied part of the string into a buffer that was off by two.
If the element signature had length one, we'd copy 0 bytes and crash when
looking at the "first" byte. Otherwise, we would crash because strncpy would
not terminate the string.
(cherry picked from commit
73777ddba5100fe6c0791cd37a91f24a515f3202)
Resolves: #
1696224
Zbigniew Jędrzejewski-Szmek [Fri, 3 Aug 2018 16:05:27 +0000 (18:05 +0200)]
bus-message: output debug information about offset troubles
(cherry picked from commit
0b4775b52747bebf7ecb62062798475629767044)
Resolves: #
1696224
Zbigniew Jędrzejewski-Szmek [Fri, 3 Aug 2018 14:36:51 +0000 (16:36 +0200)]
bus-message: drop asserts in functions which are wrappers for varargs version
The function does no processing on it's own, and just forwards arguments
to the other function. Let's just use the asserts there.
(cherry picked from commit
8792bdf8a3311f9e629daa0ec592c97c1cfb2a7c)
Resolves: #
1696224
Zbigniew Jędrzejewski-Szmek [Fri, 3 Aug 2018 12:46:57 +0000 (14:46 +0200)]
bus-message: fix calculation of offsets table for arrays
This is similar to the grandparent commit 'fix calculation of offsets table',
except that now the change is for array elements. Same story as before: we need
to make sure that the offsets increase enough taking alignment into account.
While at it, rename 'p' to 'previous' to match similar code in other places.
(cherry picked from commit
f88214cf9d66c93f4d22c4c8980de9ee3ff45bab)
Resolves: #
1696224
Zbigniew Jędrzejewski-Szmek [Thu, 2 Aug 2018 12:25:31 +0000 (14:25 +0200)]
bus-message: remove duplicate assignment
(cherry picked from commit
4d82a8d5052fce8c1ea51f8bdec3476fb8cc4747)
Resolves: #
1696224
Zbigniew Jędrzejewski-Szmek [Thu, 2 Aug 2018 12:25:11 +0000 (14:25 +0200)]
bus-message: fix calculation of offsets table
The offsets specify the ends of variable length data. We would trust the
incoming data, putting the offsets specified in our message
into the offsets tables after doing some superficial verification.
But when actually reading the data we apply alignment, so we would take
the previous offset, align it, making it bigger then current offset, and
then we'd try to read data of negative length.
In the attached example, the message specifies the following offsets:
[1, 4]
but the alignment of those items is
[1, 8]
so we'd calculate the second item as starting at 8 and ending at 4.
(cherry picked from commit
12603b84d2fb07603e2ea94b240c6b78ad17510e)
Resolves: #
1696224
Zbigniew Jędrzejewski-Szmek [Wed, 1 Aug 2018 22:46:20 +0000 (00:46 +0200)]
bus: do not print (null) if the message has unknown type
(cherry picked from commit
e8fd7e4b5b5269377efc641a7da43850822c1250)
Resolves: #
1696224
Zbigniew Jędrzejewski-Szmek [Tue, 24 Jul 2018 19:24:53 +0000 (21:24 +0200)]
bus-message: use define
(cherry picked from commit
f22c308aff556bf5c6599ffcb61e637e366ab232)
Resolves: #
1696224
Zbigniew Jędrzejewski-Szmek [Tue, 24 Jul 2018 18:14:39 +0000 (20:14 +0200)]
bus-message: rename function for clarity
There's already message_free_last_container(), so rename to match.
(cherry picked from commit
9c65778d614588d21645163dea97a5fe2c1c4ca5)
Resolves: #
1696224
Zbigniew Jędrzejewski-Szmek [Mon, 9 Jul 2018 09:12:33 +0000 (11:12 +0200)]
bus-message: let's always use -EBADMSG when the message is bad
-EINVAL means the arguments were somehow wrong, so translate the code we get
internally into -EBADMSG when returning.
(cherry picked from commit
69bd42ca072dfb2f7603b1f82053063293ab54b5)
Resolves: #
1696224
Zbigniew Jędrzejewski-Szmek [Mon, 9 Jul 2018 08:52:51 +0000 (10:52 +0200)]
bus-message: avoid an infinite loop on empty structures
The alternative would be to treat gvariant and !gvariant messages differently.
But this is a problem because we check signatures is variuos places before we
have an actual message, for example in sd_bus_add_object_vtable(). It seems
better to treat things consistent (i.e. follow the lowest common denominator)
and disallow empty structures everywhere.
(cherry picked from commit
ec6bda56cbca9509b1abde1122645630caca877c)
Resolves: #
1696224
Zbigniew Jędrzejewski-Szmek [Mon, 9 Jul 2018 05:38:10 +0000 (07:38 +0200)]
bus-message: use structured initialization to avoid use of unitialized memory
As far as I can see, we would either reuse some values from a previously exited
container or just random bytes from the heap.
Should fix #10127.
(cherry picked from commit
cf81c68e96aa29d0c28b5d3a26d1de9aa1b53b85)
Resolves: #
1696224
Zbigniew Jędrzejewski-Szmek [Sat, 7 Jul 2018 17:30:25 +0000 (19:30 +0200)]
fuzz-bus-message: add fuzzer for message parsing
As with other fuzzers, SYSTEMD_FUZZ_OUTPUT=1 and SYSTEMD_LOG_LEVEL=debug can be
used for debugging.
(cherry picked from commit
56b560c26339c4b282c06038316a91509eae75fd)
Resolves: #
1696224
Zbigniew Jędrzejewski-Szmek [Fri, 10 Aug 2018 15:15:05 +0000 (17:15 +0200)]
meson: treat all fuzz cases as unit tests
318/365 fuzz-bus-message:crash-
26bba7182dedc8848939931d9fcefcb7922f2e56:address OK 0.03 s
319/365 fuzz-bus-message:crash-
29ed3c202e0ffade3cad42c8bbeb6cc68a21eb8e:address OK 0.03 s
320/365 fuzz-bus-message:crash-
b88ad9ecf4aacf4a0caca5b5543953265367f084:address OK 0.03 s
321/365 fuzz-bus-message:crash-
c1b37b4729b42c0c05b23cba4eed5d8102498a1e:address OK 0.03 s
322/365 fuzz-bus-message:crash-
d8f3941c74219b4c03532c9b244d5ea539c61af5:address OK 0.03 s
323/365 fuzz-bus-message:crash-
e1b811da5ca494e494b77c6bd8e1c2f2989425c5:address OK 0.03 s
324/365 fuzz-bus-message:leak-
c09c0e2256d43bc5e2d02748c8d8760e7bc25d20:address OK 0.04 s
325/365 fuzz-bus-message:message1:address OK 0.03 s
326/365 fuzz-bus-message:timeout-
08ee8f6446a4064db064e8e0b3d220147f7d0b5b:address OK 0.03 s
327/365 fuzz-dhcp-server:discover-existing:address OK 0.04 s
328/365 fuzz-dhcp-server:discover-new:address OK 0.03 s
329/365 fuzz-dhcp-server:release:address OK 0.04 s
330/365 fuzz-dhcp-server:request-existing:address OK 0.03 s
331/365 fuzz-dhcp-server:request-new:address OK 0.03 s
332/365 fuzz-dhcp-server:request-reboot:address OK 0.03 s
333/365 fuzz-dhcp-server:request-renew:address OK 0.03 s
334/365 fuzz-dns-packet:issue-7888:address OK 0.03 s
335/365 fuzz-dns-packet:oss-fuzz-5465:address OK 0.03 s
336/365 fuzz-journal-remote:crash-
5a8f03d4c3a46fcded39527084f437e8e4b54b76:address OK 0.06 s
337/365 fuzz-journal-remote:crash-
96dee870ea66d03e89ac321eee28ea63a9b9aa45:address OK 0.04 s
338/365 fuzz-journal-remote:invalid-ts.txt:address OK 0.04 s
339/365 fuzz-journal-remote:oss-fuzz-8659:address OK 0.06 s
340/365 fuzz-journal-remote:oss-fuzz-8686:address OK 0.04 s
341/365 fuzz-journal-remote:sample.txt:address OK 0.07 s
342/365 fuzz-unit-file:directives.service:address OK 0.03 s
343/365 fuzz-unit-file:empty.scope:address OK 0.04 s
344/365 fuzz-unit-file:machine.slice:address OK 0.03 s
345/365 fuzz-unit-file:oss-fuzz-6884:address OK 0.05 s
346/365 fuzz-unit-file:oss-fuzz-6885:address OK 0.03 s
347/365 fuzz-unit-file:oss-fuzz-6886:address OK 0.04 s
348/365 fuzz-unit-file:oss-fuzz-6892:address OK 0.03 s
349/365 fuzz-unit-file:oss-fuzz-6897:address OK 0.05 s
350/365 fuzz-unit-file:oss-fuzz-6897-evverx:address OK 0.04 s
351/365 fuzz-unit-file:oss-fuzz-6908:address OK 0.05 s
352/365 fuzz-unit-file:oss-fuzz-6917:address OK 0.06 s
353/365 fuzz-unit-file:oss-fuzz-6977:address OK 0.08 s
354/365 fuzz-unit-file:oss-fuzz-6977-unminimized:address OK 0.10 s
355/365 fuzz-unit-file:oss-fuzz-7004:address OK 0.03 s
356/365 fuzz-unit-file:oss-fuzz-8064:address OK 0.03 s
357/365 fuzz-unit-file:oss-fuzz-8827:address OK 0.50 s
358/365 fuzz-unit-file:proc-sys-fs-binfmt_misc.automount:address OK 0.03 s
359/365 fuzz-unit-file:syslog.socket:address OK 0.03 s
360/365 fuzz-unit-file:systemd-ask-password-console.path:address OK 0.03 s
361/365 fuzz-unit-file:systemd-machined.service:address OK 0.03 s
362/365 fuzz-unit-file:systemd-resolved.service:address OK 0.03 s
363/365 fuzz-unit-file:systemd-tmpfiles-clean.timer:address OK 0.03 s
364/365 fuzz-unit-file:timers.target:address OK 0.03 s
365/365 fuzz-unit-file:var-lib-machines.mount:address OK 0.04 s
This gives us slightly nicer coverage in the normal test run.
When in a git repo, git ls-files is used to get a list of files known to git.
This mirrors what update-man-rules does for man files. Only looking at files
known to git makes it easier to not forget to commit the test file to git,
and also makes bisecting easier if some files are left in repo.
When outside of a git repo, we expect to be unpacked from a tarball, so just
using all files reported by ls is OK.
(cherry picked from commit
e6bad6746151c79a5f408e95714ffa5cea290ab0)
Resolves: #
1696224
Zbigniew Jędrzejewski-Szmek [Fri, 10 Aug 2018 14:50:07 +0000 (16:50 +0200)]
meson: use .source_root() in more places
In the main meson.build file, .source_root() and .current_source_dir() are
equivalent, but it seems more appropriate to use .source_root() when we are appending
a path which is by design relative to repo root.
(cherry picked from commit
243e5cecc3a211519544ccba01c44edc827ac517)
Resolves: #
1696224
Zbigniew Jędrzejewski-Szmek [Tue, 7 Aug 2018 16:10:53 +0000 (18:10 +0200)]
meson: drop duplicated condition
The generic check suffices for those four.
(cherry picked from commit
6bd2bc8e16a6d515f8a21c47fd6b833d7fcfdd1c)
Resolves: #
1696224
Yu Watanabe [Wed, 18 Jul 2018 00:25:57 +0000 (09:25 +0900)]
meson: allow building resolved and machined without nss modules
This adds -Dnss-resolve= and -Dnss-mymachines= meson options.
By using this option, e.g., resolved can be built without nss-resolve.
When no nss modules are built, then test-nss is neither built.
Also, This changes the option name -Dmyhostname= to -Dnss-myhostname=
for consistency to other nss related options.
Closes #9596.
(cherry picked from commit
08540a9591efe105439be81fc43d6dc65b715978)
Resolves: #
1696224
Zbigniew Jędrzejewski-Szmek [Tue, 7 Aug 2018 15:34:47 +0000 (17:34 +0200)]
meson: add -Dlog-trace to set LOG_TRACE
The justification is the same as for -Dvalgrind: setting config in
meson in this way is easier, because when the value is changed stuff
that should be rebuilt is rebuilt.
(cherry picked from commit
fd5dec9adf76591d713f163d43d04e3beb76893e)
Resolves: #
1696224
Zbigniew Jędrzejewski-Szmek [Sat, 7 Jul 2018 17:08:52 +0000 (19:08 +0200)]
test-bus-marshal: use cescaping instead of hexmem
It is easier to see the contents this way by eye.
(cherry picked from commit
3ddf3d439463ab2c76391a4d22b54166be2dbe94)
Resolves: #
1696224
Zbigniew Jędrzejewski-Szmek [Sat, 7 Jul 2018 16:09:21 +0000 (18:09 +0200)]
fuzz: unify the "fuzz-regressions" directory with the main corpus
There isn't really much need to keep them separate. Anything which is a good
corpus entry can be used as a smoke test, and anything which which is a
regression test can just as well be inserted into the corpus.
The only functional difference from this patch (apart from different paths in
output) is that the regression tests are now zipped together with the rest of
the corpus.
$ meson configure build -Dslow-tests=true && ninja -C build test
...
307/325 fuzz-dns-packet:issue-7888:address OK 0.06 s
308/325 fuzz-dns-packet:oss-fuzz-5465:address OK 0.04 s
309/325 fuzz-journal-remote:crash-
5a8f03d4c3a46fcded39527084f437e8e4b54b76:address OK 0.07 s
310/325 fuzz-journal-remote:crash-
96dee870ea66d03e89ac321eee28ea63a9b9aa45:address OK 0.05 s
311/325 fuzz-journal-remote:oss-fuzz-8659:address OK 0.05 s
312/325 fuzz-journal-remote:oss-fuzz-8686:address OK 0.07 s
313/325 fuzz-unit-file:oss-fuzz-6884:address OK 0.06 s
314/325 fuzz-unit-file:oss-fuzz-6885:address OK 0.05 s
315/325 fuzz-unit-file:oss-fuzz-6886:address OK 0.05 s
316/325 fuzz-unit-file:oss-fuzz-6892:address OK 0.05 s
317/325 fuzz-unit-file:oss-fuzz-6897:address OK 0.05 s
318/325 fuzz-unit-file:oss-fuzz-6897-evverx:address OK 0.06 s
319/325 fuzz-unit-file:oss-fuzz-6908:address OK 0.07 s
320/325 fuzz-unit-file:oss-fuzz-6917:address OK 0.07 s
321/325 fuzz-unit-file:oss-fuzz-6977:address OK 0.13 s
322/325 fuzz-unit-file:oss-fuzz-6977-unminimized:address OK 0.12 s
323/325 fuzz-unit-file:oss-fuzz-7004:address OK 0.05 s
324/325 fuzz-unit-file:oss-fuzz-8064:address OK 0.05 s
325/325 fuzz-unit-file:oss-fuzz-8827:address OK 0.52 s
(cherry picked from commit
c74a3f973e3e0bac13d66a28728a47f10046b71f)
Resolves: #
1696224
Yu Watanabe [Wed, 22 Aug 2018 03:39:40 +0000 (12:39 +0900)]
test: add testcase for issue 10007 by oss-fuzz
(cherry picked from commit
a1a605f144e5635fdae57125a92032b3e5ebeca9)
Resolves: #
1696224
Zbigniew Jędrzejewski-Szmek [Sat, 7 Jul 2018 15:43:40 +0000 (17:43 +0200)]
fuzz: rename "fuzz-corpus" directory to just "fuzz"
Also, all corpus subdirectories are named exactly the same as the fuzzer they
are for. This makes the paths a bit longer, but easier.
(cherry picked from commit
93b575b26605c347a717b2aa24ddf9cad08b8080)
Resolves: #
1696224
Evgeny Vereshchagin [Wed, 26 Sep 2018 18:09:09 +0000 (18:09 +0000)]
tests: add a reproducer for another infinite loop in ndisc_handle_datagram
(cherry picked from commit
bbb393877b2cfcbe2f205c902ca7d9f7ce91f1a1)
Resolves: #
1696224
Evgeny Vereshchagin [Wed, 26 Sep 2018 15:10:21 +0000 (15:10 +0000)]
tests: add a reproducer for an infinite loop in ndisc_handle_datagram
=0 ndisc_router_parse (rt=0x60d000000110) at ../src/libsystemd-network/ndisc-router.c:126
=1 0x000055555558dc67 in ndisc_handle_datagram (nd=0x608000000020, rt=0x60d000000110) at ../src/libsystemd-network/sd-ndisc.c:170
=2 0x000055555558e65d in ndisc_recv (s=0x611000000040, fd=4, revents=1, userdata=0x608000000020) at ../src/libsystemd-network/sd-ndisc.c:233
=3 0x00007ffff63913a8 in source_dispatch (s=0x611000000040) at ../src/libsystemd/sd-event/sd-event.c:3042
=4 0x00007ffff6395eab in sd_event_dispatch (e=0x617000000080) at ../src/libsystemd/sd-event/sd-event.c:3455
=5 0x00007ffff6396b12 in sd_event_run (e=0x617000000080, timeout=
18446744073709551615) at ../src/libsystemd/sd-event/sd-event.c:3512
=6 0x0000555555583f5c in LLVMFuzzerTestOneInput (data=0x6060000000e0 "\206", size=53) at ../src/fuzz/fuzz-ndisc-rs.c:422
=7 0x0000555555586356 in main (argc=2, argv=0x7fffffffe3d8) at ../src/fuzz/fuzz-main.c:33
(cherry picked from commit
df30e78e02f653c9e6ee6677b7ccaea21d3dcd7d)
Resolves: #
1696224
Evgeny Vereshchagin [Sun, 2 Sep 2018 18:13:31 +0000 (18:13 +0000)]
tests: add reproducers for several issues uncovered with fuzz-journald-syslog
This is a follow-up to
a70f343cacf03ac51cdefb0d2e.
(cherry picked from commit
3311c74d0560e4aa6a223f5e288a5fbf2404d3fa)
Resolves: #
1696224
Yu Watanabe [Fri, 28 Sep 2018 10:28:05 +0000 (19:28 +0900)]
ndisc: fix two infinite loops
(cherry picked from commit
f3241c61f12dbd8f0ed37419ae272e291d09461d)
Resolves: #
1696224
Evgeny Vereshchagin [Wed, 26 Sep 2018 15:04:26 +0000 (15:04 +0000)]
tests: add a fuzzer for sd-ndisc
(cherry picked from commit
0f0a1dad7d69802a7e6c7fc9aba350f0e87c1952)
Resolves: #
1696224
Evgeny Vereshchagin [Mon, 3 Sep 2018 07:05:48 +0000 (07:05 +0000)]
tests: add a fuzzer for server_process_native_message
(cherry picked from commit
9cdea02db57a36442ad9e9afcd67760ca319173a)
Resolves: #
1696224
Evgeny Vereshchagin [Mon, 3 Sep 2018 07:03:10 +0000 (07:03 +0000)]
journald: make server_process_native_message compatible with fuzz_journald_processing_function
(cherry picked from commit
21acb27b71f6284a57e4e9f3ac5f0d38721ef4eb)
Resolves: #
1696224
Evgeny Vereshchagin [Mon, 3 Sep 2018 06:46:24 +0000 (06:46 +0000)]
tests: rework the code fuzzing journald
This should make it easier to add a new fuzzer without a lot of
duplication.
(cherry picked from commit
b1bd453f36b9428b6bf9feba31fa0a2b36143e9c)
Resolves: #
1696224
Evgeny Vereshchagin [Fri, 10 Aug 2018 12:52:07 +0000 (12:52 +0000)]
journald: free the allocated memory before returning from dev_kmsg_record
This fixes a minor memory leak.
(cherry picked from commit
30eddcd51b8a472e05d3b8d1f0b89fbd3e094d71)
Resolves: #
1696224
Evgeny Vereshchagin [Fri, 10 Aug 2018 12:45:42 +0000 (12:45 +0000)]
journald: make it clear that dev_kmsg_record modifies the string passed to it
The function replaces a couple commas, a semicolon and the final newline with
zero bytes in the string passed to it. The 'const' seems to have been added
by accident during a bulk edit (more specifically
3b3154df7e2773332bb814).
(cherry picked from commit
1e0c5fc2a76e4f3d508331f410899c50493e1fc9)
Resolves: #
1696224
Evgeny Vereshchagin [Mon, 3 Sep 2018 03:18:26 +0000 (06:18 +0300)]
tests: add a rudimentary fuzzer for server_process_syslog_message (#9979)
(cherry picked from commit
a70f343cacf03ac51cdefb0d2e7651b04fd2e23a)
Resolves: #
1696224
Lennart Poettering [Thu, 8 Nov 2018 08:32:17 +0000 (09:32 +0100)]
analyze: add new security verb
(cherry picked from commit
ec16f3b6dd8b03e3ce6eff1fa9f21432208ef42b)
Conflicts:
src/analyze/analyze.c
Resolves: #
1689832
Lennart Poettering [Tue, 6 Nov 2018 16:59:58 +0000 (17:59 +0100)]
locale-util: add logic to output smiley emojis at various happiness levels
(cherry picked from commit
5f1b0cc6d064f7847982e7b680cab3d080aef52e)
Conflicts:
doc/ENVIRONMENT.md
src/basic/locale-util.c
src/basic/locale-util.h
src/test/test-locale-util.c
Related: #
1689832
Lennart Poettering [Mon, 3 Dec 2018 20:39:39 +0000 (21:39 +0100)]
format-table: never try to reuse cells that have color/url/uppercase set
The table cell reusing code is supposed to be an internal memory
optimization, and not more. This means behaviour should be the same as
if we wouldn't reuse cells.
(cherry picked from commit
94a80afed42a8b36d69a229bf44ba690f8f59a78)
Related: #
1689832
Lennart Poettering [Mon, 3 Dec 2018 20:36:26 +0000 (21:36 +0100)]
format-table: add option to uppercase cells on display
This adds a per-cell option for uppercasing displayed strings.
Implicitly turn this on for the header row. The fact that we format the
table header in uppercase is a formatting thing after all, hence should
be applied by the formatter, i.e. the table display code.
Moreover, this provides us with the benefit that we can more nicely
reuse the specified table headers as JSON field names, like we already
do: json field names are usually not uppercase.
(cherry picked from commit
359abf6dd05aa6bca3438e9c969ed904bd3d447d)
Related: #
1689832
Lennart Poettering [Mon, 3 Dec 2018 19:28:15 +0000 (20:28 +0100)]
format-table: use right field for display
Since .timespan and .timestamp are unionized on top of each other this
doesn't actually matter, but it is still more correct to address it
under it's correct name.
(cherry picked from commit
c93d372d7ceda0b080487fa35d3638ef3d8507cb)
Related: #
1689832
Lennart Poettering [Wed, 14 Nov 2018 17:39:37 +0000 (18:39 +0100)]
format-table: make sure we never call memcmp() with NULL parameters
(cherry picked from commit
88db94fa57c9a5b1a0b926c49d3624fc84c88090)
Related: #
1689832
Lennart Poettering [Fri, 9 Nov 2018 10:38:12 +0000 (11:38 +0100)]
format-table: add calls to query the data in a specific cell
(cherry picked from commit
62d99b39709f903f8a66a9aae757deb5546a53eb)
Related: #
1689832
Lennart Poettering [Thu, 8 Nov 2018 20:39:28 +0000 (21:39 +0100)]
format-table: always underline header line
(cherry picked from commit
30d98de00c68440ff4d77d851b4b3323c34027da)
Related: #
1689832
Lennart Poettering [Thu, 8 Nov 2018 20:21:09 +0000 (21:21 +0100)]
format-table: add an API for getting the cell at a specific row/column
(cherry picked from commit
9314ead7853a1479fc60eb2ae7e3d0a77b7eba7c)
Related: #
1689832
Lennart Poettering [Thu, 8 Nov 2018 20:17:47 +0000 (21:17 +0100)]
format-table: add table_update() to update existing entries
(cherry picked from commit
27e730e6d0a7709c17ccef170f10846e92dca2a0)
Related: #
1689832
Lennart Poettering [Wed, 7 Nov 2018 16:41:32 +0000 (17:41 +0100)]
format-table: optionally allow reversing the sort order for a column
(cherry picked from commit
a2c73e2d3823e878de7a7ee193631108c5fc5be0)
Related: #
1689832
Lennart Poettering [Wed, 7 Nov 2018 14:25:51 +0000 (15:25 +0100)]
format-table: add option to store/format percent and uint64_t values in cells
(cherry picked from commit
a4661181fa702a8bff4644210ba7ea14bea51a4a)
Related: #
1689832
Lennart Poettering [Tue, 6 Nov 2018 17:37:21 +0000 (18:37 +0100)]
format-table: before outputting a color, check if colors are available
This is in many cases redundant, as a similar check is done by various
callers already, but in other cases (where we read the color from a
static table for example), it's nice to let the color check be done by
the table code itself, and since it doesn't hurt in the other cases just
do it again.
(cherry picked from commit
a22318e55492af721879d8692ed039144696bb08)
Related: #
1689832
Lennart Poettering [Tue, 6 Nov 2018 11:06:14 +0000 (12:06 +0100)]
format-table: optionally make specific cells clickable links
(cherry picked from commit
165ca5663e9859083c70d793a6b4aa4f3b2af24c)
Related: #
1689832
Lennart Poettering [Thu, 8 Nov 2018 20:16:23 +0000 (21:16 +0100)]
format-table: when duplicating a cell, also copy the color
(cherry picked from commit
13b0d4d7bdb674d0e51a6d595abd1e7bf2691bf9)
Related: #
1689832
Zbigniew Jędrzejewski-Szmek [Mon, 24 Sep 2018 14:59:12 +0000 (16:59 +0200)]
seccomp: reduce logging about failure to add syscall to seccomp
Our logs are full of:
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call oldstat() / -10037, ignoring: Numerical argument out of domain
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call get_thread_area() / -10076, ignoring: Numerical argument out of domain
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call set_thread_area() / -10079, ignoring: Numerical argument out of domain
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call oldfstat() / -10034, ignoring: Numerical argument out of domain
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call oldolduname() / -10036, ignoring: Numerical argument out of domain
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call oldlstat() / -10035, ignoring: Numerical argument out of domain
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call waitpid() / -10073, ignoring: Numerical argument out of domain
...
This is pointless and makes debug logs hard to read. Let's keep the logs
in test code, but disable it in nspawn and pid1. This is done through a function
parameter because those functions operate recursively and it's not possible to
make the caller to log meaningfully.
There should be no functional change, except the skipped debug logs.
(cherry-picked from commit
b54f36c604472ffe08830ec4306fa2885b4a5424)
Resolves: #
1658691
Lennart Poettering [Fri, 18 Jan 2019 19:13:55 +0000 (20:13 +0100)]
nss: unportect errno before writing to NSS' *errnop
Fixes: #11321
(cherry picked from commit
cdccd29f39cd20cb2a8b71e50445eb839f076331)
Resolves: #
1691691
Lennart Poettering [Fri, 18 Jan 2019 19:04:13 +0000 (20:04 +0100)]
util.h: add new UNPROTECT_ERRNO macro
THis is inspired by #11395, but much simpler.
(cherry picked from commit
840f606d88fef2f5d240b2d759ce7b951354d5bb)
Resolves: #
1691691
Yu Watanabe [Sun, 15 Jul 2018 14:00:00 +0000 (23:00 +0900)]
nss: do not modify errno when NSS_STATUS_NOTFOUND or NSS_STATUS_SUCCESS
This also adds PROTECT_ERRNO for all nss module functions.
C.f. glibc NSS documents https://www.gnu.org/software/libc/manual/html_node/NSS-Modules-Interface.html
and discussion in https://sourceware.org/bugzilla/show_bug.cgi?id=23410.
Fixes #9585.
(cherry picked from commit
06202b9e659e5cc72aeecc5200155b7c012fccbc)
Resolves: #
1691691
Jan Synacek [Tue, 22 Jan 2019 09:28:42 +0000 (10:28 +0100)]
units: add [Install] section to tmp.mount
rhel-only
Resolves: #
1667065
Lennart Poettering [Wed, 5 Dec 2018 17:42:32 +0000 (18:42 +0100)]
logs-show: use grey color for de-emphasizing journal log output
(cherry picked from commit
67df9b7a06d749fdd84f19f7d75ccf0d743f6d72)
Resolves: #
1695601
Jan Synacek [Thu, 2 May 2019 12:11:54 +0000 (14:11 +0200)]
journal: don't enable systemd-journald-audit.socket by default
Resolves: #
1699287
Jan Synacek [Thu, 2 May 2019 12:08:39 +0000 (14:08 +0200)]
Revert "journal: remove journal audit socket"
This reverts commit
8618ef2fb30b4139c9bec4e45fb499cd8192a87f.
Resolves: #
1699287
Lennart Poettering [Fri, 5 Oct 2018 21:04:51 +0000 (23:04 +0200)]
unit: enqueue cgroup empty check event if the last ref on a unit is dropped
(cherry picked from commit
e5c36295d81971ef75d9c6f98f0890b92a4a353f)
Resolves: #
1697893
Lennart Poettering [Fri, 5 Oct 2018 20:56:40 +0000 (22:56 +0200)]
nspawn: rework how we allocate/kill scopes
Fixes: #6347
(cherry picked from commit
1d78fea2d6230e0aafa2603abc8f1f51966ef134)
Resolves: #
1697893