Luca Boccassi
51d64d8869
Merge pull request #28140 from mrc0mmand/more-coverage
...
test: test transactions with cycles
2023-06-23 19:56:28 +01:00
Antonio Alvarez Feijoo
191b891bf1
man: fix references to gethostname/sethostname
2023-06-23 23:38:05 +08:00
Lennart Poettering
54b8a816a3
update TODO
2023-06-23 15:23:21 +02:00
Frantisek Sumsal
dc7e580e64
tree-wide: use https for the 0pointer.de doc links
2023-06-23 13:46:56 +01:00
Lennart Poettering
0438aa5775
resolved: if ipv6 is off patch hostname→address query with unspec family to ipv4
...
If the client never specified the address family, and IPv6 is off in the
kernel, then look only for A, never for AAAA RRs.
Fixes : #23951
2023-06-23 14:45:26 +02:00
Frantisek Sumsal
0651e71749
test: test transactions with cycles
...
Provides coverage for systemd/systemd#26872.
With systemd/systemd#26875 reverted:
[16444.287652] testsuite-03.sh[71]: + for i in {0..19}
[16444.287652] testsuite-03.sh[71]: + systemctl start transaction-cycle0.service
[16444.359503] systemd[1]: =================================================================
[16444.360321] systemd[1]: ==1==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6180002e578e at pc 0x7f73b25ec7a6 bp 0x7ffc5531c6f0 sp 0x7ffc5531be68
[16444.360798] systemd[1]:
[16444.361044] systemd[1]: READ of size 783 at 0x6180002e578e thread T0 (systemd)
[16444.391684] systemd[1]: #0 0x7f73b25ec7a5 (/lib64/libasan.so.5+0x557a5)
[16444.392167] systemd[1]: #1 0x7f73b260a1d5 in __interceptor_vasprintf (/lib64/libasan.so.5+0x731d5)
[16444.392442] systemd[1]: #2 0x7f73afa1d1e1 in log_format_iovec ../src/basic/log.c:996
[16444.392750] systemd[1]: #3 0x7f73afa1e7b6 in log_struct_internal ../src/basic/log.c:1058
[16444.393101] systemd[1]: #4 0x7f73b1979136 in transaction_verify_order_one ../src/core/transaction.c:392
[16444.393540] systemd[1]: #5 0x7f73b197ac82 in transaction_verify_order_one ../src/core/transaction.c:463
[16444.393946] systemd[1]: #6 0x7f73b197ac82 in transaction_verify_order_one ../src/core/transaction.c:463
[16444.394262] systemd[1]: #7 0x7f73b197ac82 in transaction_verify_order_one ../src/core/transaction.c:463
[16444.394532] systemd[1]: #8 0x7f73b197ac82 in transaction_verify_order_one ../src/core/transaction.c:463
[16444.394812] systemd[1]: #9 0x7f73b197ac82 in transaction_verify_order_one ../src/core/transaction.c:463
...
2023-06-23 14:37:07 +02:00
Frantisek Sumsal
88c98cb261
test: make sure we get PID1's stack trace on ASan/UBSan errors
...
As hitting an ASan/UBSan error in PID1 results in a crash (and a kernel
panic when running under qemu), we usually lose the stack trace which
makes debugging quite painful. Let's mitigate this by forwarding the
stack trace to multiple places - namely to a file and the syslog.
2023-06-23 14:37:07 +02:00
Luca Boccassi
fc84ddda2f
Merge pull request #28123 from poettering/threads-no-more
...
get rid of any threads in PID 1
2023-06-23 13:24:41 +01:00
Romain Geissler
3965f173ea
elf-util: check for overflow when computing end of core's PT_LOAD segments
2023-06-23 12:35:34 +01:00
Luca Boccassi
148083a093
Merge pull request #28127 from poettering/coredump-loop-read
...
coredump: fixes with overly large coredumps
2023-06-23 12:28:40 +01:00
Lennart Poettering
1ee20371c7
basic: drop unused include
2023-06-23 10:05:16 +02:00
Lennart Poettering
8c3fe1b5b5
process-util: add simple wrapper around PR_SET_CHILD_SUBREAPER
...
Let's a simple helper that knows how to deal with PID == 1.
2023-06-23 10:05:16 +02:00
Lennart Poettering
2499d32022
docs: document threading situation in coding style
2023-06-23 10:05:16 +02:00
Lennart Poettering
530f6ada2e
async: use FORK_DETACH for asynchronous syncs
...
To get proper "fire-and-forget" feeling we really want to make sure
noone has to reap the forked off process.
2023-06-23 10:05:16 +02:00
Lennart Poettering
e4687bb8a6
async: add explanatory comment
2023-06-23 10:05:16 +02:00
Lennart Poettering
78b680f99b
async: drop the now unused asynchronous_job()
2023-06-23 10:05:16 +02:00
Lennart Poettering
437f3e35b4
async: add generic implementation of asynchronous_rm_rf()
...
This one doesn't use threads anymore. This is the last use of threads in
PID 1. Yay!
Fixes : #27287
2023-06-23 10:05:16 +02:00
Lennart Poettering
7e14a308cf
shared: move async.[ch] from src/basic/ → src/shared/
...
That way we can later add an async wrapper for rm_rf() which is in
src/shared/, too.
2023-06-23 10:02:15 +02:00
Lennart Poettering
2e7b105eb9
process-util: add FORK_DETACH flag for forking of detached child
...
A test for this is later added indirectly, via aynchronous_rm_rf() that
uses this and comes with a suitable test.
2023-06-23 10:02:15 +02:00
Lennart Poettering
f7bccef178
automont: rework expiry to use subprocess rather than thread
...
One more step towards a thread-free PID1: let's do automount expiry in a
subprocess rather than a thread.
2023-06-23 10:02:15 +02:00
Lennart Poettering
01ab446c35
basic: add comments about raw_clone() calls not supporting threads/malloc in child
2023-06-23 10:02:15 +02:00
Lennart Poettering
c26d7837bb
async: stop using threads for asynchronous_close()
...
Let's work towards PID1 being purely single threaded again. Let's rework
asynchronous_close() on top of clone() with CLONE_FILES (so that we
can manipulate PID1's fd table correctly).
One less use of pthread_create() in PID 1.
2023-06-23 10:00:30 +02:00
Lennart Poettering
29c3520f28
process-util: add clone_with_nested_stack() helper
...
This wraps glibc's clone() but deals with the 'stack' parameter in a
sensible way. Only supports invocations without CLONE_VM, i.e. when
child is a CoW copy of parent.
2023-06-23 10:00:30 +02:00
Lennart Poettering
09f9530baf
process-util: add helper that detects if we are a reaper process
2023-06-23 10:00:30 +02:00
Lennart Poettering
da3cd87ab4
Merge pull request #28129 from poettering/userdb-ratelimit
...
userdbd: make sure we don't exit under pressure
2023-06-23 09:53:21 +02:00
Lennart Poettering
e6421b6ccd
man: correct and extend JournalSizeMax=
...
The man page claimed the default was 10M, but that's not true, it's
767M.
Also mention there's no point in increasing it further.
See: #26748
2023-06-23 09:49:41 +02:00
Lennart Poettering
4a78074fc1
coredump: clamp JournalSizeMax= to maximum journald would accept
...
See: #26748
2023-06-23 09:45:50 +02:00
Lennart Poettering
a73c74db66
coredump: use loop_read() for reading coredump into memory
...
Fixes : #26748
2023-06-23 09:38:12 +02:00
Lennart Poettering
6270b2e67e
tpm2-util: look for tpm2-pcr-signature.json directly in /.extra/
...
So far we relied on tmpfiles.d to copy tpm2-pcr-signature.json from
/.extra/ into /run/systemd/. This is racy however if cryptsetup runs too
early, and we cannot unconditionally run it after tmpfiles completed.
hence, let's teach cryptsetup to directly look for the file in /.extra/,
in order to simplify this, and remove the race. But do so only in the
initrd (as only there /.extra/ is a concept).
We generally prefer looking in /run/systemd/, since things are under
user control then. In the regular system we exclusively want that
userspace looks there.
Fixes : #26490
2023-06-23 09:32:33 +02:00
Lennart Poettering
19b761a097
tree-wide: getpid() → getpid_cached()
...
This doesn't really matter, but let's be systematic and prefer
getpid_cached() in our codebase.
2023-06-22 17:07:59 -06:00
Lennart Poettering
2543deada3
userdbd: when we hit a flood of requests to start more workers, don't exit
...
Let's tweak what we do if we detect a flood of requests to start more
workers: if none of the workers ever sticks (i.e. the worker count is
zero) then let's just give up, as before.
Otherwise, let's just not start more workers for a while, and do so
again after a while. Thus spawning ofr workers will "cool off" for a
while.
Fixes : #27028
2023-06-22 18:59:24 +02:00
Lennart Poettering
3ef0103f22
userdbd: prefix parameters with their names more
2023-06-22 18:58:31 +02:00
Lennart Poettering
c659d0f55e
userdbd: drastically raise ratelimit we apply on requests for more worker processes
...
These requests might come in during lookup floods very quickly, since
multiple worker processes might detect that things should be scaled up
at the same time. Hence, let's substantially raise the limit so that it
doesn't get hit in real-life scenarios and acts more like a safety net.
2023-06-22 18:57:30 +02:00
Yu Watanabe
742aebc5a7
meson: merge two similar loops for unit files
...
This also merges two arrays units and in_units, and uses dictionary
for declaring units.
This also fixes the condition handling, that previously only two
conditions were handled and rests were ignored.
2023-06-22 10:19:51 -06:00
Lennart Poettering
7e81ce6bb8
docs: describe $TESTFUNCS briefly
...
Follow-up for f1a83e41ae
2023-06-22 15:14:47 +01:00
Lennart Poettering
f1a83e41ae
tests: teach tests boilerplate to run selected tests only
...
sometimes its useful to only run a specific test (or multiple) instead
of all implemented in a test. Allow the test name(s) to be specified on the
in a $TESTFUNCS env var, separated by colons.
2023-06-22 16:07:57 +02:00
Lennart Poettering
58373cebb8
Merge pull request #28104 from DaanDeMeyer/emergency-kexec-halt
...
core: Add halt and kexec emergency actions
2023-06-22 16:07:35 +02:00
Daan De Meyer
4638e18593
hwdb: Don't generate hwdb if no hwdb files are found
2023-06-22 16:07:22 +02:00
Lennart Poettering
947c4d3952
core: restrict ImportCredential= globbing
...
Let's restrict how we apply credential globbing in ImportCredential=, so
that we have some flexibility in automatically extending the glob
expression with per-instance data eventually without getting into
conflict with the globbing parts.
In our current uses we only allow globbing at the end of the expression,
and this is a new, unreleased feature hence let's be restrictive on this
initially. We can still relax this later if we feel the need to after
all.
Fixes : #28022
2023-06-22 16:07:09 +02:00
Lennart Poettering
54c0ba3409
pid1: use FORK_DEATHSIG where appropriate
2023-06-22 16:05:37 +02:00
Jan Luebbe
173d47f788
man: correct reference to sd_id128_get_boot_app_specific
...
The function sd_id128_get_boot_app_specific is the app specific variant of
sd_id128_get_boot.
Signed-off-by: Jan Luebbe <jlu@pengutronix.de >
2023-06-22 12:34:00 +01:00
Daan De Meyer
c9c9e87b80
Merge pull request #28115 from yuwata/meson-tiny-fixes
...
meson: several tiny fixes
2023-06-22 11:49:36 +02:00
Daan De Meyer
9a0eade760
units: Use built-in halt and kexec features instead of systemctl
2023-06-22 10:33:18 +01:00
Daan De Meyer
3cf848f6cd
core: Add halt and kexec emergency actions
...
Let's complete the picture by adding the missing halt and kexec
emergency actions.
2023-06-22 10:33:13 +01:00
Lennart Poettering
665ca08b6e
sleep-util: mention that offset is in memory pages
2023-06-22 10:30:23 +02:00
Franck Bui
e538927918
rpm: fix lua trigger priority for sysusers
...
Commit cd621954ed probably forgot to fix the lua
implementation.
2023-06-22 16:18:01 +09:00
Yu Watanabe
c20d291416
meson: fix test dependency
...
Follow-up for daf4e78e48 .
2023-06-22 14:37:45 +09:00
Yu Watanabe
1782534bb1
meson: shorten code a bit
2023-06-22 14:37:24 +09:00
Yu Watanabe
e04e42312d
meson: drop wrong and redundant assignment
...
Follow-up for b62ee354dd .
2023-06-22 14:20:32 +09:00
Yu Watanabe
d37dee7450
meson: also build symbol tests for static-libsystemd=no-pic
2023-06-22 14:20:32 +09:00