fix enable-dbus-broker-to-reexecute.patch and backport-launch-config-use-AT_RANDOM-for-XML-hash-salt.patch

(cherry picked from commit e14ca780e3b7fe9abb3b747db6f5ed30a075d75b)
This commit is contained in:
h30032433 2024-05-24 16:47:48 +08:00 committed by openeuler-sync-bot
parent 0d3d4af282
commit 007153d3fd
3 changed files with 15 additions and 4 deletions

View File

@ -1,3 +1,11 @@
From dd2a42a4b882fff63c4c68b8b6a724394270ed3f Mon Sep 17 00:00:00 2001
From: David Rheinsberg <david@readahead.eu>
Date: Wed, 5 Jul 2023 09:54:12 +0200
Subject: [PATCH] launch/config: use AT_RANDOM for XML hash salt
Forward the entropy from AT_RANDOM to the hash-salt used by expat. Use
XML_SetHashSalt() for this (available and fixed since expat-2.1).
This fixes an issue where libexpat might read from `/dev/urandom` and This fixes an issue where libexpat might read from `/dev/urandom` and
thus block until the entropy pool is initialized. This hidden thus block until the entropy pool is initialized. This hidden
dependency is very hard to debug. Instead, we require the service dependency is very hard to debug. Instead, we require the service
@ -43,7 +51,7 @@ index 85521bd..4a6a11e 100644
+ * service manager to order processes accordingly. + * service manager to order processes accordingly.
+ */ + */
+ random = (void *)getauxval(AT_RANDOM); + random = (void *)getauxval(AT_RANDOM);
+ assert(random); + c_assert(random);
+ memcpy(&parser->salt, random, sizeof(parser->salt)); + memcpy(&parser->salt, random, sizeof(parser->salt));
} }

View File

@ -1,6 +1,6 @@
Name: dbus-broker Name: dbus-broker
Version: 29 Version: 29
Release: 9 Release: 10
Summary: Linux D-Bus Message Broker Summary: Linux D-Bus Message Broker
License: Apache License 2.0 License: Apache License 2.0
URL: https://github.com/bus1/dbus-broker URL: https://github.com/bus1/dbus-broker
@ -95,6 +95,9 @@ fi
%{_userunitdir}/dbus-broker.service %{_userunitdir}/dbus-broker.service
%changelog %changelog
* Fri May 24 2024 huyubiao<huyubiao@huawei.com> - 29-10
- fix enable-dbus-broker-to-reexecute.patch and backport-launch-config-use-AT_RANDOM-for-XML-hash-salt.patch
* Sat Oct 7 2023 hongjinghao<hongjinghao@huawei.com> - 29-9 * Sat Oct 7 2023 hongjinghao<hongjinghao@huawei.com> - 29-9
- Fix buffer leakage - Fix buffer leakage

View File

@ -1922,7 +1922,7 @@ index 0000000..c027999
+ r = log_commitf(&broker->log, "NameOwner string %s is invalid, skipping.\n", + r = log_commitf(&broker->log, "NameOwner string %s is invalid, skipping.\n",
+ nameowner_ship_str); + nameowner_ship_str);
+ if (r < 0) + if (r < 0)
+ return error_fold(r); + return error_fold(r);
+ close(peeri->connection.socket.fd); + close(peeri->connection.socket.fd);
+ continue; + continue;
+ } + }
@ -1937,7 +1937,6 @@ index 0000000..c027999
+ if (arg0 && !strncmp(arg0 + strlen("arg0"), "=':1", strlen("=':1"))) { + if (arg0 && !strncmp(arg0 + strlen("arg0"), "=':1", strlen("=':1"))) {
+ continue; + continue;
+ } + }
+ rule_str_list_cur = stpcpy(rule_str_list_cur, rule_str);
+ left_length -= strlen(rule_str); + left_length -= strlen(rule_str);
+ /* Besides the next rule_str, we should also keep MATCH_RULE_LENGTH_MAX + /* Besides the next rule_str, we should also keep MATCH_RULE_LENGTH_MAX
+ * bytes for sasl_str. sasl_str usually doesn't need that much space, + * bytes for sasl_str. sasl_str usually doesn't need that much space,
@ -1946,6 +1945,7 @@ index 0000000..c027999
+ skip_this_peer = true; + skip_this_peer = true;
+ break; + break;
+ } + }
+ rule_str_list_cur = stpcpy(rule_str_list_cur, rule_str);
+ } + }
+ +
+ if (skip_this_peer) { + if (skip_this_peer) {