From 138e24c02057a0fcef3db5b8af0b2b2f33eef3c2 Mon Sep 17 00:00:00 2001 From: David Rheinsberg Date: Thu, 18 Mar 2021 12:18:18 +0100 Subject: [PATCH] dbus-broker: one more fix from upstream Apply another range-assertion fix that will hopefully get this problem sorted. Signed-off-by: David Rheinsberg --- ...670bfec6600d0144bcb9ca635fb07c80118f.patch | 30 +++++++++++++++++++ dbus-broker.spec | 6 +++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 b82b670bfec6600d0144bcb9ca635fb07c80118f.patch diff --git a/b82b670bfec6600d0144bcb9ca635fb07c80118f.patch b/b82b670bfec6600d0144bcb9ca635fb07c80118f.patch new file mode 100644 index 0000000..7f73592 --- /dev/null +++ b/b82b670bfec6600d0144bcb9ca635fb07c80118f.patch @@ -0,0 +1,30 @@ +From b82b670bfec6600d0144bcb9ca635fb07c80118f Mon Sep 17 00:00:00 2001 +From: David Rheinsberg +Date: Thu, 18 Mar 2021 12:13:16 +0100 +Subject: [PATCH] launch/policy: fix at_console range assertion again + +The previous fix did not actually consider that a full range can span up +until (uint32_t)-1. Fix this properly now, and just check manually for +an empty range before checking that the highest entry in the range can +be represented. + +Signed-off-by: David Rheinsberg +--- + src/launch/policy.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/src/launch/policy.c b/src/launch/policy.c +index 75eb0d3..6999ceb 100644 +--- a/src/launch/policy.c ++++ b/src/launch/policy.c +@@ -935,9 +935,7 @@ static int policy_export_console(Policy *policy, sd_bus_message *m, PolicyEntrie + int r; + + /* check for overflow */ +- c_assert(uid_start + n_uid >= uid_start); +- /* check for encoding into dbus `u` type */ +- c_assert(uid_start + n_uid <= (uint32_t)-1); ++ c_assert(n_uid == 0 || uid_start + n_uid - 1 >= uid_start); + + if (n_uid == 0) + return 0; diff --git a/dbus-broker.spec b/dbus-broker.spec index 8f7013c..4842bee 100644 --- a/dbus-broker.spec +++ b/dbus-broker.spec @@ -2,12 +2,13 @@ Name: dbus-broker Version: 28 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Linux D-Bus Message Broker License: ASL 2.0 URL: https://github.com/bus1/dbus-broker Source0: https://github.com/bus1/dbus-broker/releases/download/v%{version}/dbus-broker-%{version}.tar.xz Patch0000: https://github.com/bus1/dbus-broker/commit/1add8a7d60e46806e0ef87994d3024245db0d84a.patch +Patch0001: https://github.com/bus1/dbus-broker/commit/b82b670bfec6600d0144bcb9ca635fb07c80118f.patch %{?systemd_requires} BuildRequires: pkgconfig(audit) BuildRequires: pkgconfig(expat) @@ -94,6 +95,9 @@ fi %{_userunitdir}/dbus-broker.service %changelog +* Thu Mar 18 2021 David Rheinsberg - 28-3 +- Apply another fix for incorrect at_console range assertion. + * Thu Mar 18 2021 David Rheinsberg - 28-2 - Apply fix for incorrect at_console range assertion.