16 Star 11 Fork 109

src-openEuler/systemd

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
20-grubby.install
Don-t-set-AlternativeNamesPolicy-by-default.patch
Make-systemd-udevd.service-start-after-systemd-remou.patch
Retry-to-handle-the-uevent-when-worker-is-terminated.patch
Revert-core-one-step-back-again-for-nspawn-we-actual.patch
Systemd-Add-sw64-architecture.patch
activation-service-must-be-restarted-when-reactivated.patch
add-a-new-switch-to-control-whether-udev-complies-wi.patch
add-sw_64-support-for-virt.patch
backport-0001-coredump-also-stop-forwarding-non-dumpable-...
backport-0001-coredump-restore-compatibility-with-older-p...
backport-0002-coredump-get-rid-of-_META_MANDATORY_MAX.patch
backport-0002-coredump-get-rid-of-a-bogus-assertion.patch
backport-Avoid-tmp-being-mounted-as-tmpfs-without-the-use...
backport-CVE-2023-50387.patch
backport-CVE-2023-50868.patch
backport-CVE-2023-7008.patch
backport-CVE-2025-4598-coredump-use-d-in-kernel-core-patt...
backport-Revert-sysctl.d-switch-net.ipv4.conf.all.rp_filt...
backport-allow-override-default-log-level-by-environment-...
backport-bash-completion-add-systemctl-service-log-level-...
backport-basic-add-missing-BCACHEFS-magic.patch
backport-basic-add-missing-PIDFS-magic.patch
backport-basic-log-do-not-treat-all-negative-errnos-as-sy...
backport-core-Bump-log-level-of-reexecute-request-to-noti...
backport-core-Fix-file-descriptor-leak.patch
backport-core-Log-in-more-scenarios-about-which-process-i...
backport-core-escape-spaces-in-paths-during-serialization...
backport-core-escape-spaces-when-serializing-as-well.patch
backport-core-exec-credential-add-missing-assertions.patch
backport-core-exec-credential-use-FOREACH_ARRAY-at-one-mo...
backport-core-exec-do-not-crash-with-UtmpMode-user-withou...
backport-core-fix-assert-when-AddDependencyUnitFiles-is-c...
backport-core-introduce-exec_params_need_credentials.patch
backport-core-reliably-check-if-varlink-socket-has-been-d...
backport-core-reuse-credential-dir-across-start-and-start...
backport-core-service-allow-ExecStartPost-cmds-to-access-...
backport-core-service-don-t-setup-credentials-for-ExecCon...
backport-core-service-fix-accept-socket-deserialization.p...
backport-core-service-introduce-service_exec_flags.patch
backport-core-service-use-log_unit_-where-appropriate.patch
backport-coredump-correctly-take-tmpfs-size-into-account-...
backport-exec-invoke-correct-dont_close-size.patch
backport-execute-free-syscall_log-hashmap-when-done.patch
backport-fix-analyze-q-option-invalid-issue.patch
backport-fix-cgtop-sscanf-return-code-checks.patch
backport-fix-conf-parser-oom-check-issue.patch
backport-fix-homed-log-message-typo-error.patch
backport-fix-log-message-not-match-glob-patterns-passed-t...
backport-fix-memory-leak-in-cryptsetup-generator.patch
backport-fs-util-readlinkat-supports-an-empty-string.patch
backport-install-allow-removing-symlinks-even-for-units-t...
backport-journalctl-erase-verify-key-before-free.patch
backport-login-user-runtime-dir-properly-check-for-mount-...
backport-logind-let-system-wide-idle-begin-at-the-time-lo...
backport-main-pass-the-right-error-variable.patch
backport-mount-optimize-mountinfo-traversal-by-decoupling...
backport-network-networkd-address-don-t-set-up-firewall-r...
backport-pid1-add-env-var-to-override-default-mount-rate-...
backport-repart-fix-memory-leak.patch
backport-resolved-log-error-messages-for-openssl-gnutls-c...
backport-run-do-not-pass-the-pty-slave-fd-to-transient-se...
backport-run-pass-the-pty-slave-fd-to-transient-service.p...
backport-sd-event-change-error-code-EINVAL-EIO.patch
backport-sd-event-do-not-assert-on-invalid-signal.patch
backport-sd-event-fix-fd-leak-when-fd-is-owned-by-IO-even...
backport-sd-ipv4acd-fix-assertion-triggered-when-an-ARP-r...
backport-shared-log-error-when-execve-fail.patch
backport-shutdown-clean-up-sync_with_progress-a-bit.patch
backport-shutdown-close-DM-block-device-before-issuing-DM...
backport-shutdown-replace-unbounded-fsync-with-bounded-sy...
backport-shutdown-teach-sync_with_progress-to-optionally-...
backport-systemctl-fix-printing-of-RootImageOptions.patch
backport-sysusers-handle-NSS-errors-gracefully.patch
backport-temporarily-disable-test-seccomp.patch
backport-unit-check-for-correct-function-in-vtable.patch
backport-user-util-validate-the-right-field.patch
bugfix-also-stop-machine-when-a-machine-un.patch
bugfix-for-cgroup-Swap-cgroup-v1-deletion-and-migration.p...
change-NTP-server-to-x.pool.ntp.org.patch
check-whether-command_prev-is-null-before-assigning-.patch
core-add-OptionalLog-to-allow-users-change-log-level.patch
core-add-invalidate-cgroup-config.patch
core-cgroup-support-cpuset.patch
core-cgroup-support-default-slice-for-all-uni.patch
core-cgroup-support-freezer.patch
core-cgroup-support-memorysw.patch
core-update-arg_default_rlimit-in-bump_rlimit.patch
delay-to-restart-when-a-service-can-not-be-auto-restarted...
delete-Assertion-o-object.type-OBJECT_ENTRY_ARRAY.patch
delete-journal-files-except-system.journal-when-jour.patch
detect_virt
disable-initialize_clock.patch
fix-capsh-drop-but-ping-success.patch
fix-journal-file-descriptors-leak-problems.patch
fix-two-VF-virtual-machines-have-same-mac-address.patch
fuser-print-umount-message-to-reboot-umount-msg.patch
inittab
journal-don-t-enable-systemd-journald-audit.socket.patch
keep-weight-consistent-with-the-set-value.patch
let-the-child-of-one-unit-don-t-affect-each-other.patch
logind-set-RemoveIPC-to-false-by-default.patch
macros.sysusers
net-set-sriov-names
pid1-bump-DefaultTasksMax-to-80-of-the-kernel-pid.ma.patch
print-the-process-status-to-console-when-shutdown.patch
process-util-log-more-information-when-runnin.patch
purge-nobody-user
rc.local
resolved-create-etc-resolv.conf-symlink-at-runtime.patch
revert-rpm-restart-services-in-posttrans.patch
rule_generator.functions
rules-add-elevator-kernel-command-line-parameter.patch
rules-add-rule-for-naming-Dell-iDRAC-USB-Virtual-NIC.patch
rules-add-the-rule-that-adds-elevator-kernel-command.patch
sd-bus-properly-initialize-containers.patch
sense_data.py
set-forwardtowall-no-to-avoid-emerg-log-shown-on-she.patch
set-the-cpuset.cpus-mems-of-machine.slice-to-all-by-.patch
shutdown-reboot-when-recieve-crash-signal.patch
support-disable-cgroup-controllers-we-don-t-want.patch
sysctl.conf.README
systemd-255.tar.gz
systemd-change-time-log-level.patch
systemd-core-Add-new-rules-for-lower-priority-events.patch
systemd-core-fix-problem-of-dbus-service-can-not-be-start...
systemd-fstab-generator-print-logs-only-to-kmsg.patch
systemd-journal-gatewayd.xml
systemd-journal-remote.xml
systemd-logind-add-log-to-display-devices.patch
systemd-solve-that-rsyslog-reads-journal-s-object-of.patch
systemd-udev-trigger-no-reload.conf
systemd-user
systemd.spec
systemd.yaml
sysusers.generate-pre.sh
treat-underscore-as-valid-hostname-char.patch
udev-40-generic.rules
udev-55-persistent-net-generator.rules
udev-56-net-sriov-names.rules
udev-add-actions-while-rename-netif-failed.patch
udev-virsh-shutdown-vm.patch
unit-don-t-add-Requires-for-tmp.mount.patch
units-add-Install-section-to-tmp.mount.patch
update-rtc-with-system-clock-when-shutdown.patch
write_net_rules
yum-protect-systemd.conf
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-0001-coredump-restore-compatibility-with-older-patterns.patch 5.91 KB
一键复制 编辑 原始数据 按行查看 历史
hanjinpeng 提交于 2个月前 . fix CVE-2025-4598
From c6f79626b6d175c6a5b62b8c5d957a83eb882301 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Tue, 29 Apr 2025 14:47:59 +0200
Subject: [PATCH] coredump: restore compatibility with older patterns
This was broken in f45b8015513d38ee5f7cc361db9c5b88c9aae704. Unfortunately
the review does not talk about backward compatibility at all. There are
two places where it matters:
- During upgrades, the replacement of kernel.core_pattern is asynchronous.
For example, during rpm upgrades, it would be updated a post-transaction
file trigger. In other scenarios, the update might only happen after
reboot. We have a potentially long window where the old pattern is in
place. We need to capture coredumps during upgrades too.
- With --backtrace. The interface of --backtrace, in hindsight, is not
great. But there are users of --backtrace which were written to use
a specific set of arguments, and we can't just break compatiblity.
One example is systemd-coredump-python, but there are also reports of
users using --backtrace to generate coredump logs.
Thus, we require the original set of args, and will use the additional args if
found.
A test is added to verify that --backtrace works with and without the optional
args.
(cherry picked from commit ded0aac389e647d35bce7ec4a48e718d77c0435b)
(cherry picked from commit f9b8b75c11bba9b63096904be98cc529c304eb97)
(cherry picked from commit 385a33b043406ad79a7207f3906c3b15192a3333)
---
src/coredump/coredump.c | 21 ++++++++++++++-------
test/units/testsuite-74.coredump.sh | 18 +++++++++++-------
2 files changed, 25 insertions(+), 14 deletions(-)
diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c
index b6ca6f03b0..026e0111ce 100644
--- a/src/coredump/coredump.c
+++ b/src/coredump/coredump.c
@@ -95,8 +95,12 @@ enum {
META_ARGV_SIGNAL, /* %s: number of signal causing dump */
META_ARGV_TIMESTAMP, /* %t: time of dump, expressed as seconds since the Epoch (we expand this to μs granularity) */
META_ARGV_RLIMIT, /* %c: core file size soft resource limit */
- META_ARGV_HOSTNAME, /* %h: hostname */
+ _META_ARGV_REQUIRED,
+ /* The fields below were added to kernel/core_pattern at later points, so they might be missing. */
+ META_ARGV_HOSTNAME = _META_ARGV_REQUIRED, /* %h: hostname */
_META_ARGV_MAX,
+ /* If new fields are added, they should be added here, to maintain compatibility
+ * with callers which don't know about the new fields. */
/* The following indexes are cached for a couple of special fields we use (and
* thereby need to be retrieved quickly) for naming coredump files, and attaching
@@ -107,7 +111,7 @@ enum {
_META_MANDATORY_MAX,
/* The rest are similar to the previous ones except that we won't fail if one of
- * them is missing. */
+ * them is missing in a message sent over the socket. */
META_EXE = _META_MANDATORY_MAX,
META_UNIT,
@@ -1169,14 +1173,17 @@ static int gather_pid_metadata_from_argv(
assert(context);
/* We gather all metadata that were passed via argv[] into an array of iovecs that
- * we'll forward to the socket unit */
+ * we'll forward to the socket unit.
+ *
+ * We require at least _META_ARGV_REQUIRED args, but will accept more.
+ * We know how to parse _META_ARGV_MAX args. The rest will be ignored. */
- if (argc < _META_ARGV_MAX)
+ if (argc < _META_ARGV_REQUIRED)
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
- "Not enough arguments passed by the kernel (%i, expected %i).",
- argc, _META_ARGV_MAX);
+ "Not enough arguments passed by the kernel (%i, expected between %i and %i).",
+ argc, _META_ARGV_REQUIRED, _META_ARGV_MAX);
- for (int i = 0; i < _META_ARGV_MAX; i++) {
+ for (int i = 0; i < MIN(argc, _META_ARGV_MAX); i++) {
t = argv[i];
diff --git a/test/units/testsuite-74.coredump.sh b/test/units/testsuite-74.coredump.sh
index 6552643ee9..d9945b61d4 100755
--- a/test/units/testsuite-74.coredump.sh
+++ b/test/units/testsuite-74.coredump.sh
@@ -186,14 +186,18 @@ rm -f /tmp/core.{output,redirected}
(! "${UNPRIV_CMD[@]}" coredumpctl dump "$CORE_TEST_BIN" >/dev/null)
# --backtrace mode
-# Pass one of the existing journal coredump records to systemd-coredump and
-# use our PID as the source to make matching the coredump later easier
-# systemd-coredump args: PID UID GID SIGNUM TIMESTAMP CORE_SOFT_RLIMIT HOSTNAME
+# Pass one of the existing journal coredump records to systemd-coredump.
+# Use our PID as the source to be able to create a PIDFD and to make matching easier.
+# systemd-coredump args: PID UID GID SIGNUM TIMESTAMP CORE_SOFT_RLIMIT [HOSTNAME]
journalctl -b -n 1 --output=export --output-fields=MESSAGE,COREDUMP COREDUMP_EXE="/usr/bin/test-dump" |
- /usr/lib/systemd/systemd-coredump --backtrace $$ 0 0 6 1679509994 12345 mymachine
-# Wait a bit for the coredump to get processed
-timeout 30 bash -c "while [[ \$(coredumpctl list -q --no-legend $$ | wc -l) -eq 0 ]]; do sleep 1; done"
-coredumpctl info "$$"
+ /usr/lib/systemd/systemd-coredump --backtrace $$ 0 0 6 1679509900 12345
+journalctl -b -n 1 --output=export --output-fields=MESSAGE,COREDUMP COREDUMP_EXE="/usr/bin/test-dump" |
+ /usr/lib/systemd/systemd-coredump --backtrace $$ 0 0 6 1679509901 12345 mymachine
+# Wait a bit for the coredumps to get processed
+timeout 30 bash -c "while [[ \$(coredumpctl list -q --no-legend $$ | wc -l) -lt 2 ]]; do sleep 1; done"
+coredumpctl info $$
+coredumpctl info COREDUMP_TIMESTAMP=1679509900000000
+coredumpctl info COREDUMP_TIMESTAMP=1679509901000000
coredumpctl info COREDUMP_HOSTNAME="mymachine"
# This used to cause a stack overflow
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/systemd.git
git@gitee.com:src-openeuler/systemd.git
src-openeuler
systemd
systemd
master

搜索帮助