1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-02-07 01:58:02 +03:00

60519 Commits

Author SHA1 Message Date
Lennart Poettering
5bc58da2bc update TODO 2022-10-19 18:55:34 +02:00
Luca Boccassi
6762c907c4
Merge pull request #25068 from aafeijoo-suse/bash-completion-dissect
dissect: add missing help option and bash-completion support
2022-10-19 17:30:55 +02:00
Frantisek Sumsal
c2c4fc4888
Merge pull request #25059 from keszybz/fopen-re
Use "re" or "r" as appropriate for various calls
2022-10-19 12:49:31 +00:00
Antonio Alvarez Feijoo
808ec9df38
bash-completion: add systemd-dissect support 2022-10-19 14:43:50 +02:00
Antonio Alvarez Feijoo
1b967529d2
dissect: add missing --umount to the help output 2022-10-19 14:42:42 +02:00
Luca Boccassi
875c0bd07e
Merge pull request #25055 from keszybz/coredump-deadlock
Fix coredump deadlock with overly long backtraces
2022-10-19 14:21:33 +02:00
Zbigniew Jędrzejewski-Szmek
6f3cec8a0d TEST-15: add daemon-reload in one place
Quoting https://github.com/systemd/systemd/pull/25050#discussion_r998721845:

This part seems to be quite racy, at least in the C8S job:

[ 1767.520856] H testsuite-15.sh[35]: *** test transient slice drop-ins
[ 1767.520856] H testsuite-15.sh[35]: + mkdir -p /etc/systemd/system/slice.d
[ 1767.522480] H testsuite-15.sh[35]: + mkdir -p /etc/systemd/system/a-.slice.d
[ 1767.524992] H testsuite-15.sh[35]: + mkdir -p /etc/systemd/system/a-b-.slice.d
[ 1767.526799] H testsuite-15.sh[35]: + mkdir -p /etc/systemd/system/a-b-c.slice.d
[ 1767.528302] H testsuite-15.sh[35]: + echo -e '[Unit]\nDocumentation=man:drop1'
[ 1767.528434] H testsuite-15.sh[35]: + echo -e '[Unit]\nDocumentation=man:drop2'
[ 1767.528519] H testsuite-15.sh[35]: + echo -e '[Unit]\nDocumentation=man:drop3'
[ 1767.528595] H testsuite-15.sh[35]: + echo -e '[Unit]\nDocumentation=man:drop4'
[ 1767.528676] H testsuite-15.sh[35]: + systemctl cat a-b-c.slice
[ 1767.541321] H systemctl[1042]: No files found for a-b-c.slice.
[ 1767.542854] H systemd[1]: testsuite-15.service: Main process exited, code=exited, status=1/FAILURE
[ 1767.542995] H systemd[1]: testsuite-15.service: Failed with result 'exit-code'.
[ 1767.543360] H systemd[1]: Failed to start testsuite-15.service.
[ 1767.543542] H systemd[1]: testsuite-15.service: Consumed 1.586s CPU time.
[ 1767.543938] H systemd[1]: Reached target testsuite.target.
[ 1767.545737] H systemd[1]: Starting end.service...
2022-10-19 11:48:59 +00:00
Lennart Poettering
8f598a4635 man: document restrictions on naming interfaces
Let's document that "." is a bad choice of character when naming
interfaces. Let's also document the hard restrictions we make when
naming interfaces.

Result of the mess that is #25052.
2022-10-19 13:04:56 +02:00
Luca Boccassi
10a336cd93
Merge pull request #25056 from yuwata/sd-device-monitor-set-description
tree-wide: set description for device monitor
2022-10-19 13:04:17 +02:00
Frantisek Sumsal
dacaddd90a README.md: add a missing line break
Follow-up to b7a279f9ef.
2022-10-19 11:17:33 +02:00
Joyce
b7a279f9ef
ci: Enable Scorecard Github Action and Badge (#25054)
* chore: enable scorecard action

* chore: add badge to the README file

* chore: enable on config file update

* chore: update scorecard to 2.0.4

* chore: run scorecard on PR at main branch

* chore: add condition to publish_result key

* chore: skip upload to code scanning if PR

* chore: only runs scorecard in the main repo

Resolves: #25042
2022-10-19 09:05:39 +00:00
Zbigniew Jędrzejewski-Szmek
f3bd4b3df5 tree-wide: do not use "re" with fmemopen
The man page says nothing about "e". Glibc clearly accepts it without fuss, but
it is meaningless for a memory object (and probably doesn't work). This use is
not portable, so let's avoid it.
2022-10-19 10:10:57 +02:00
Zbigniew Jędrzejewski-Szmek
dc1768131a shared/tpm2-util: wrap comments 2022-10-19 10:10:57 +02:00
Zbigniew Jędrzejewski-Szmek
a3ee0916b1 resolved,test-fileio: use "re" when opening files
This doesn't matter too much, because neither of those programs forks, but
let's dot he generally correct thing anyway.
2022-10-19 10:10:50 +02:00
Zbigniew Jędrzejewski-Szmek
076b807be4 coredump: avoid deadlock when passing processed backtrace data
We would deadlock when passing the data back from the forked-off process that
was doing backtrace generation back to the coredump parent. This is because we
fork the child and wait for it to exit. The child tries to write too much data
to the output pipe, and and after the first 64k blocks on the parent because
the pipe is full. The bug surfaced in Fedora because of a combination of four
factors:
- 87707784c70dc9894ec613df0a6e75e732a362a3 was backported to v251.5, which
  allowed coredump processing to be successful.
- 1a0281a3ebf4f8c16d40aa9e63103f16cd23bb2a was NOT backported, so the output
  was very verbose.
- Fedora has the ELF package metadata available, so a lot of output can be
  generated. Most other distros just don't have the information.
- gnome-calendar crashes and has a bazillion modules and 69596 bytes of output
  are generated for it.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2135778.

The code is changed to try to write data opportunistically. If we get partial
information, that is still logged. In is generally better to log partial
backtrace information than nothing at all.
2022-10-19 09:46:55 +02:00
Zbigniew Jędrzejewski-Szmek
87a16eb8b5 shared/json: use different return code for empty input
It is useful to distinguish if json_parse_file() got no input or invalid input.
Use different return codes for the two cases.
2022-10-19 09:46:55 +02:00
Yu Watanabe
82c5487894 test: skip one test for iszero_safe() on i386 without SSE2
We do not provide any numerical libraries, and iszero_safe() is only
used in parsing or formatting JSON. Hence, it is not necessary for us to
request that the function provides the same result on different systems.

Fixes #25044.
2022-10-19 00:09:44 +02:00
Yu Watanabe
17bf3c550d tree-wide: set description for device manager 2022-10-19 04:46:24 +09:00
Yu Watanabe
9b784d7c16 udev: drop redundant description setting
Follow-up for f714ecd450828e45a6f04e6277011d67a10c323f.
2022-10-19 04:45:31 +09:00
Luca Boccassi
50675bb98f
Merge pull request #25050 from keszybz/transient-drop-ins-2
TEST-15: add one more variant of the test for drop-ins on transient services
2022-10-18 19:32:36 +02:00
Zbigniew Jędrzejewski-Szmek
7922ead507 shared/json: allow json_variant_dump() to return an error 2022-10-18 18:17:19 +02:00
Zbigniew Jędrzejewski-Szmek
9ca1efbc46 NEWS: add entries after 252-rc1, update contrib list v252-rc2 2022-10-18 14:30:54 +02:00
Zbigniew Jędrzejewski-Szmek
70f0e75ef8 TODO: drop entry
This was resolved by 028a981c005e90c36c269e28709bf25032c2e8ca. We don't do
the reload in the normal path.
2022-10-18 12:29:09 +02:00
Zbigniew Jędrzejewski-Szmek
40d4835d69 TEST-15: add test that shows slice dropin issue
This should be fixed by single-unit reloads. We already have a TODO
entry for this.
2022-10-18 12:26:53 +02:00
Lennart Poettering
9ef6330e17 update TODO 2022-10-18 12:10:02 +02:00
Luca Boccassi
af4117037b
Merge pull request #25004 from keszybz/transient-drop-ins
Allow drop-ins for transient units
2022-10-18 11:49:29 +02:00
Zbigniew Jędrzejewski-Szmek
9e11abe817
Merge pull request #25007 from keszybz/rename-dbus-dump
manager: rename dbus method
2022-10-18 11:34:16 +02:00
Ted X. Toth
29dbc62d74 manager: use target process context to set socket context
Use target process context to set socket context when using SELinuxContextFromNet
not systemd's context. Currently when using the SELinuxContextFromNet option for
a socket activated services, systemd calls getcon_raw which returns init_t and
uses the resulting context to compute the context to be passed to the
setsockcreatecon call. A socket of type init_t is created and listened on and
this means that SELinux policy cannot be written to control which processes
(SELinux types) can connect to the socket since the ref policy allows all
'types' to connect to sockets of the type init_t. When security accessors see
that any process can connect to a socket this raises serious concerns. I have
spoken with SELinux contributors in person and on the mailing list and the
consensus is that the best solution is to use the target executables context
when computing the sockets context in all cases.

[zjs review/comment:

This removes the branch that was added in 16115b0a7b7cdf08fb38084d857d572d8a9088dc.
16115b0a7b7cdf08fb38084d857d572d8a9088dc did two things: it had the branch here
in 'socket_determine_selinux_label()' and a code in 'exec_child()' to call
'label_get_child_mls_label(socket_fd, command->path, &label)'.

Before this patch, the flow was:
'''
mac_selinux_get_child_mls_label:
  peercon = getpeercon_raw(socket_fd);
  if (!exec_label)
     exec_label = getfilecon_raw(exe);

socket_open_fds:
  if (params->selinux_context_net)                 #
     label = mac_selinux_get_our_label();          #  this part is removed
  else                                             #
     label = mac_selinux_get_create_label_from_exe(path);
  socket_address_listen_in_cgroup(s, &p->address, label);

exec_child():
   exec_context = mac_selinux_get_child_mls_label(fd, executable, context->selinux_context);
   setexeccon(exec_context);
'''
]
2022-10-18 11:31:22 +02:00
Zbigniew Jędrzejewski-Szmek
b08d86dc4a analyze: use DumpUnitsMatchingPatternsByFileDescriptor
Similarly to DumpByFileDescriptor vs Dump,
DumpUnitsMatchingPatternsByFileDescriptor is used in preference. Dissimilarly,
a fallback to DumpUnitsMatchingPatterns is not done on error, because there is
no need for backwards compatibility.

The code is still more verbose than I'd like, but there are four different code
paths with slightly different rules in each case, so it's hard to make this all
very brief. Since we have a separate file dedicated to making those calls, the
verbose-but-easy-to-follow implementation should be OK.

Closes #24989.

I only did a quick test that all both variants works locally and over ssh.
2022-10-18 08:45:45 +02:00
Zbigniew Jędrzejewski-Szmek
8ff92848a6
Merge pull request #24777 from medhefgo/stub
stub: Use LoadImage/StartImage
2022-10-18 07:36:20 +02:00
Luca Boccassi
6a0907b8a3
Merge pull request #25035 from keszybz/manager-method-names
Manager method names
2022-10-17 23:11:13 +02:00
Frantisek Sumsal
3113ae1f2b test: call sync() before checking the test logs
Otherwise we might hit a race where we read the test log just before
it's fully written to the disk:

```
======================================================================
FAIL: test_interleaved (__main__.ExecutionResumeTest.test_interleaved)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/systemd/test/test-exec-deserialization.py", line 170, in test_interleaved
    self.check_output(expected_output)
  File "/root/systemd/test/test-exec-deserialization.py", line 111, in check_output
    self.assertEqual(output, expected_output)
AssertionError: 'foo\n' != 'foo\nbar\n'
  foo
+ bar
```

With some debug:
```
test_interleaved (__main__.ExecutionResumeTest.test_interleaved) ...
Assertion failed; file contents just after the assertion:
b'foo\n'

File contents 5 seconds later:
b'foo\nbar\n'
FAIL
```

Seen quite often in CentOS CI on the fast baremetal machines.
2022-10-17 20:24:24 +00:00
Luca Boccassi
61938b3c8d
Merge pull request #25039 from mrc0mmand/test-tewaks
A couple of minor tweaks for recent CI fails
2022-10-17 21:52:00 +02:00
Zbigniew Jędrzejewski-Szmek
725a28fe77
Merge pull request #24992 from yuwata/sd-device-monitor-receive-buffer
sd-device-monitor: dynamically allocate receive buffer
2022-10-17 20:49:18 +02:00
Lennart Poettering
15f9a1525f man: add missing reference to systemd-pcrphase-sysinit.service 2022-10-17 17:12:45 +02:00
Luca Boccassi
7a329f2bac
Merge pull request #25036 from keszybz/plurals
Remove usage of "noun(s)" in messages and docs
2022-10-17 17:12:16 +02:00
David Edmundson
9739bcfd85 xdg-autostart-service: Add comments to tilde expansion, use path_join()
Follow-ups for https://github.com/systemd/systemd/pull/24658
2022-10-17 16:42:39 +02:00
Daan De Meyer
f87338fa26 Update TODO 2022-10-17 16:10:42 +02:00
Daan De Meyer
0aa1d40649 mkosi: Switch to Fedora 37
Official release date is close so let's switch mkosi CI to it already.
2022-10-17 16:02:16 +02:00
Zbigniew Jędrzejewski-Szmek
02df2981b5 meson: drop repeated output in error message 2022-10-17 15:10:53 +02:00
Zbigniew Jędrzejewski-Szmek
0923b4253c tree-wide: replace "plural(s)" by "plurals"
(s) is just ugly with a vibe of DOS. In most cases just using the normal plural
form is more natural and gramatically correct.

There are some log_debug() statements left, and texts in foreign licenses or
headers. Those are not touched on purpose.
2022-10-17 15:10:53 +02:00
Zbigniew Jędrzejewski-Szmek
f6cce15bb3 manager: add DumpUnitsMatchingPatternsByFileDescriptor() 2022-10-17 15:00:53 +02:00
Frantisek Sumsal
c0c03d9ce1 test: use SIGKILL to kill the container if necessary
TEST-69 uses a Python wrapper around the systemd-nspawn call, which on
error calls the `spawn.terminate()` method. However, with no arguments
it will only use SIGHUP and SIGINT signals - this might leave a stuck
container around, causing fails if the test is run again. With `force=True`
SIGKILL is used as well (if necessary).
2022-10-17 15:00:12 +02:00
Yu Watanabe
69363f13b5 test: add test for large uevent message 2022-10-17 21:52:35 +09:00
Jan Janssen
09da51f8e9 boot: Rework shim image verification
This moves the shim security arch override to the new
ReinstallProtocolInterface based interface. This also has the benefit to
reduce the time window in which we have this override active and also
actually removes it, which was not previously done.

The shim hooks themselves are also modernized too. The upcalls should
really not be neccessary if shim is happy with the provided binary.
2022-10-17 14:49:11 +02:00
Yu Watanabe
efbd4b3ca8 sd-device-monitor: dynamically allocate receive buffer
If udevd broadcasts a processed device with huge amount of properties,
then clients cannot receive the device.

Fixes #24987.
2022-10-17 21:49:08 +09:00
Jan Janssen
6731a102da stub: Allow loading unsigned kernel images 2022-10-17 14:48:28 +02:00
Jan Janssen
0e3c374e8c boot: Use proper security arch protocol names
This is how the Platform Intregration Specification defines these.
2022-10-17 14:47:42 +02:00
Jan Janssen
dcde6ae165 boot: Remove unused parameters from pe_kernel_info
Only the compat entry address is used now. This also now only returns
the compat entry address. If the image is native we do not need to try
calling into the entry address again as we would already have done so
from StartImage (and failed).
2022-10-17 14:47:42 +02:00
Jan Janssen
a529d8182e stub: Use LoadImage/StartImage to start the kernel
This is the proper way to start any EFI binary. The fact this even ever
worked was because the kernel does not have any PE relocations.

The only downside is that the embedded kernel image has to be signed and
trusted by the firmware under secure boot. A future commit will try to
deal with that.
2022-10-17 14:47:39 +02:00