1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-24 21:34:08 +03:00
Commit Graph

60487 Commits

Author SHA1 Message Date
Lennart Poettering
75b1d269cb tpm2-util: fix parameter name 2022-10-17 08:00:04 +02:00
msizanoen1
5bc787fa53 journal: fix indentation in managed_journal_file_open_reliably 2022-10-16 21:07:33 +07:00
msizanoen1
383d9155a2 journald: harden against forward clock jumps before unclean shutdown
Try harder to inherit the sequence number and ID from the old journal
file before rotating it away.

This helps the libsystemd journal file selection code make better decisions
even in the face of massive incorrect forward clock jumps prior to an
unclean shutdown.
2022-10-16 21:07:33 +07:00
Celeste Liu
09925036cf seccomp: add riscv_flush_icache to allow list
This system call is harmless because it only enforces ordering between stores
and instruction cache fetch.

fixed #24991
Related: https://github.com/felixonmars/archriscv-packages/issues/1840

Signed-off-by: Celeste Liu <CoelacanthusHex@gmail.com>
2022-10-16 12:40:00 +02:00
Yu Watanabe
3e15bed410 udev: drop unused source file
Follow-up for 5bbcfbaa11.
2022-10-15 20:41:23 +09:00
Lennart Poettering
c8428d2d06 seccomp: drop per arch conditionalization in filter groups
We list plenty of arch-specific syscalls in our filter groups, treat the
s390 syscalls the same.

We handle gracefully anyway if some syscall doesn't exist locally on the
kernel or arch, let's rely on it. This has the benefit that
"systemd-analyze" will comprehensively tell you the syscalls filtered on
any arch for any arch.

And less conditionalization is good anyway.
2022-10-15 00:00:16 +02:00
Pyfisch
b45b4f5008 Update list of partition type identifiers
Include verity sig partition identifiers.
List all supported CPU architectures.
2022-10-14 22:29:43 +02:00
Pyfisch
ba4a5eff6e Document two systemd-repart options in man page
Note --private-key and --certificate options for configuring
verity signature partitions in the listing of options.

Adjust one error message referring to the --certificate option.
2022-10-14 22:00:43 +02:00
Lennart Poettering
924a329a00 update TODO 2022-10-14 21:07:29 +02:00
Thomas Blume
d72f4a3897 basic/mountpoint-util: skip dependency on quota services for some filesystems 2022-10-14 20:57:30 +02:00
Luca Boccassi
d2be5f641d
Merge pull request #25002 from poettering/install-type-fix
install: make InstallChangeType enum a proper enum
2022-10-14 20:56:44 +02:00
Anita Zhang
284212893b core: only allow systemd-oomd to use SubscribeManagedOOMCGroups
Attempt to address
https://github.com/systemd/systemd/issues/20330#issuecomment-1210028422.

Summary of the comment: Unprivileged users can potentially cause a denial of
service during systemd-oomd unit subscriptions by spamming requests to
SubscribeManagedOOMCGroups. As systemd-oomd.service is the only unit that
should be accessing this method, add a check on the caller's unit name to deter
them from successfully using this method.
2022-10-14 09:57:59 -07:00
Anita Zhang
008798e90c core: serialize/deserialize varlink sockets for pid1
Fixes #20330
2022-10-14 09:54:05 -07:00
Zbigniew Jędrzejewski-Szmek
293b9aa3eb manager: rename dbus method
Fixes #24989.
2022-10-14 18:31:33 +02:00
Yu Watanabe
f6e88aac2c elf-util: drop assertion for metadata in report_module_metadata()
Fixes a bug introduced by 1a0281a3eb.

Fixes RHBZ#2134741 (https://bugzilla.redhat.com/show_bug.cgi?id=2134741).
2022-10-14 18:08:11 +02:00
msizanoen1
417cbcd6be shared/logs-show: do not overwrite journal time in export format with source timestamps
Using _SOURCE_{MONOTONIC,REALTIME}_TIMESTAMP in place of the results of
sd_journal_get_{monotonic,realtime}_usecs in export formats might cause
internal inconsistency of realtime timestamp values within a journal export,
violating the export file format and causing systemd-journal-remote to
mass-generate journal files.

Fix this by using the real journal timestamps for
__{REALTIME,MONOTONIC}_TIMESTAMP.
2022-10-14 18:05:04 +02:00
Zbigniew Jędrzejewski-Szmek
1485925d2d man: reword some awkward sentences 2022-10-14 15:56:58 +02:00
Zbigniew Jędrzejewski-Szmek
8d3b7d2fd3 NEWS: rework the description of systemd-measure a bit again
Try to separate the description so that changes are described first, and the
discussion follows separately. Remove some repeated verbose descriptions of the
subject: if one sentence describes that UKI contains an signature and describes
it in detail, the next sentence can just say "the signature" without
elaborating. Also, we don't do version-keying yet, so don't say "future"
kernels — older kernels will work too.
2022-10-14 15:56:55 +02:00
Yu Watanabe
2ce39d78b8 udev-builtin-kmod: support to run without arguments
If no module name is provided, then try to load modules based on the
device modealias.

Previously, MODALIAS property is passed as an argument, but it may
contain quotation. Hence, unfortunately the modalias may be modified
and cannot load expected modules.

Fixes #24715.
2022-10-14 21:32:24 +09:00
Lennart Poettering
b364c4de62 install: include full type name in special UnitFilePresetMode values
Typically the _MAX and _INVALID special enum values use the full type as
prefix, even if the actual values of the enum might not. Let's follow
this rule here too.
2022-10-14 11:41:32 +02:00
Lennart Poettering
f8662fee2f install: make InstallChange enum type a proper type
We can just make this an enum, as long as we ensure it has enough range,
which we can do by adding -ERRNO_MAX as one possible value (at least on
GNU C). We already do that at multiple other places, so let's do this
here too.
2022-10-14 11:40:40 +02:00
Lennart Poettering
4554c178bf update TODO 2022-10-14 11:33:17 +02:00
Anita Zhang
658138f3af core: refactor manager varlink init
Split out per-socket code into a separate function to use as part of
serialize/deserialize in the next commit.
2022-10-14 01:59:12 -07:00
Anita Zhang
536827e05a varlink: refactor adding socket event source to the event loop 2022-10-14 01:59:09 -07:00
Lubomir Rintel
73bf6859cb udev/rules: add by-path and by-ibdev links to infiniband verbs
The uverbs devices are sequentially numbered and are not guarranteed to
stay stable across reboot.

At least one good person was disappointed by this, because they couldn't
find their device: https://bugzilla.redhat.com/show_bug.cgi?id=2036515

Let's add a few helpful links.
2022-10-14 12:18:08 +09:00
Zbigniew Jędrzejewski-Szmek
aaf4325954
Merge pull request #24461 from keszybz/better-unmask-message
Better unmask message when unit is masked via kernel commandline
2022-10-13 23:17:49 +02:00
Zbigniew Jędrzejewski-Szmek
bf3b0d5f29 shared/install: print warning when unmasking unit with cmdline mask
'systemctl unmask foo' will try to remove the symlink to /dev/null under /etc/.
But the unit may also be masked by a symlink under /run/generator, in particular
the one created by systemd-debug-generator based on systemd.mask=foo on the
kernel commandline. The unmask call cannot anything about this: even if it removed
the symlink from /run/generator, it'll be recreated on the next daemon-reload.
Thus, we can only warn about it.

Initially, I wanted to check if 'systemctl.mask' is defined on the kernel
command-line, but that's not effective, because such mask symlinks can be
created by other generators based on other conditions. Checking for runtime
mask is "dumber", but is more robust because it doesn't assume who created the
mask and why.

The handling of InstallInfo is the copied from install_info_symlink_wants().
It's pretty ugly, this whole code should be rewritten from scratch.

The message is printed, but the whole operation is still "successful". This
keep backwards compatibility: people might call unmask to remove filesystem
masks even if there's still a cmdline param in place. We allow 'systemctl
mask' to create such a mask, so 'unmask' should be able to remove it.

Fixes #22689.
2022-10-13 19:44:47 +02:00
Zbigniew Jędrzejewski-Szmek
acb5b83438 shared/install: use cleanup func for InstallInfo*
In the next commit cleanup will be used in one more place. This change
avoids proliferation of the open-coded cleanup calls.
2022-10-13 19:44:47 +02:00
Zbigniew Jędrzejewski-Szmek
0047d54d42 shared/install: rename 'UnitFileInstallInfo' to 'InstallInfo'
- shorter is better
- name now matches the defining-file name

I was also considering UnitInstallInfo. Can change if people prefer that.
2022-10-13 19:44:47 +02:00
Zbigniew Jędrzejewski-Szmek
1308f72e83 shared/install: rename 'unit_file_change_type' to 'install_change' + followups
We had an anonymous enum with values called UNIT_FILE_…, which could easily be
confused with UNIT_FILE_… from UnitFileFlags enum. This commit renames the enum
values and also the variables which refer to them.
2022-10-13 19:44:47 +02:00
Zbigniew Jędrzejewski-Szmek
91810c8ffc shared/install: rename UnitFileInstallInfo.type to .install_mode 2022-10-13 19:44:47 +02:00
Zbigniew Jędrzejewski-Szmek
318031fdb2 shared/install: rename 'unit file type' to 'install mode'
git grep -l -nwi 'UnitFileType|UNIT_FILE_TYPE' | \
xargs sed -r -i 's/UnitFileType/InstallMode/g; s/UNIT_FILE_TYPE/INSTALL_MODE/g; s/unit_file_type/install_mode/g'
2022-10-13 19:44:47 +02:00
Zbigniew Jędrzejewski-Szmek
cd44ec5a92 shared/install: rename UnitFileChange to InstallChange
It's shorter and more generic. The struct can contain info about changes to
unit files, but also symlinks and errors.
2022-10-13 19:44:47 +02:00
Zbigniew Jędrzejewski-Szmek
0f87041f94 shared/install: rename 'files' param to 'names'
… or 'name_or_path' or 'names_or_paths' as appropriate. Those functions are
generally called with unit names as arguments.
2022-10-13 19:44:47 +02:00
Yu Watanabe
52bcf45a6c sd-journal: use new() instead of newa() if too many items will be added
For safety, as the size may not be under our control.
2022-10-14 01:30:30 +09:00
Yu Watanabe
80c5cb825a
Merge pull request #24985 from yuwata/codeql
test: several cleanups suggested by CodeQL
2022-10-13 21:36:16 +09:00
Yu Watanabe
74522aa87f test: introduce __eq__() and __ne__()
Suggested by CodeQL#160 (https://github.com/systemd/systemd/security/code-scanning/160).
2022-10-13 17:41:48 +09:00
Yu Watanabe
f9d1709c03 test: drop unused modules
Suggested by CodeQL#167 (https://github.com/systemd/systemd/security/code-scanning/167)
and CodeQL#168 (https://github.com/systemd/systemd/security/code-scanning/168).
2022-10-13 17:34:11 +09:00
Yu Watanabe
5c27347693 test: improve assertion message on failure
Suggested by CodeQL#169 (https://github.com/systemd/systemd/security/code-scanning/169).
2022-10-13 17:33:09 +09:00
Yu Watanabe
7ff7eadf42 TODO: fix typo 2022-10-13 17:15:50 +09:00
Lennart Poettering
fd5dead7d6 update TODO 2022-10-13 09:48:01 +02:00
Lennart Poettering
29818c4e99 update NEWS 2022-10-13 09:48:01 +02:00
Franck Bui
d1d8786c5b analyze: extend the dump command to accept patterns
The new function DumpPatterns() can be used to limit (drastically) the size of
the data returned by PID1. Hence the optimization of serializing data into a
file descriptor should be less relevant than having the possibility to limit
the data when communicating with the service manager remotely.

NB: when passing patterns, the dump command omits the version of the manager as
well as the features and the timestamps.
2022-10-13 07:47:42 +09:00
Yu Watanabe
17f6406bf2
Merge pull request #24625 from yuwata/dissect-image-open-and-lock-decrypted
dissect-image: open dissected and decrypted partitions
2022-10-13 07:47:08 +09:00
David Seifert
d0523bb0d1 gpt-auto: allow using without cryptsetup
Fixes #24978
2022-10-13 06:39:38 +09:00
Yu Watanabe
d2c6e79d89 dissect-image: introduce probe_filesystem_full() which can take file descriptor of device node
In dissect_loop_device(), we have opened the device node. Let's reuse
the file descriptor.
2022-10-13 05:09:27 +09:00
Yu Watanabe
f7725647bb dissect-image: open dissected or decrypted partitions and mount through the file descriptor
If multiple services with the same encrypted image are simultaneously
starting, one may deactivate the dm device while others using it.
Or, similary, after (regular) partitions are dissected, another process
may try to remove them before we mount them.

To prevent such situations, let's keep the dissected and decrypted
partitions opened. Then, use the file descriptors when we mount the
partitions.

Fixes #24617.
2022-10-13 05:09:26 +09:00
Yu Watanabe
f80015ff40 dissect-image: try to open device node before activating
Hopefully decrease the chance that the device is removed soon after
it is detected.
2022-10-13 05:08:33 +09:00
Yu Watanabe
12f5fbdf30 dissect-image: fix error handling of @cancel_deferred_remove DM command
See target_message() in drivers/md/dm-ioctl.c and
dm_cancel_deferred_remove() in drivers/md/dm.c.
2022-10-13 05:08:33 +09:00
Yu Watanabe
1d369d78b3 dissect-image: reduce indentation
No functional change, just refactoring.
2022-10-13 05:08:33 +09:00