[neon/backports-focal/iio-sensor-proxy/Neon/unstable] debian/patches: Restrict D-Bus policy rules only to affect SensorProxy

Ritesh Raj Sarraf null at kde.org
Fri Oct 9 07:46:07 BST 2020


Git commit ea2615f0ac7340c8c32dd8b982d6926e1364ad60 by Ritesh Raj Sarraf.
Committed on 02/02/2017 at 13:36.
Pushed by bshah into tag 'Neon/unstable'.

Restrict D-Bus policy rules only to affect SensorProxy

Thanks: Simon McVittie
Closes: #853951

A  +62   -0    debian/patches/iio-dbus-policy-security.patch
M  +1    -0    debian/patches/series

https://invent.kde.org/neon/backports-focal/iio-sensor-proxy/commit/ea2615f0ac7340c8c32dd8b982d6926e1364ad60

diff --git a/debian/patches/iio-dbus-policy-security.patch b/debian/patches/iio-dbus-policy-security.patch
new file mode 100644
index 0000000..d013131
--- /dev/null
+++ b/debian/patches/iio-dbus-policy-security.patch
@@ -0,0 +1,62 @@
+From 3695e3979daee9b11b99998b8a318716639ef9a5 Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv at debian.org>
+Date: Thu, 2 Feb 2017 12:48:56 +0000
+Subject: [PATCH] Security fix: Make D-Bus policy rules only affect SensorProxy
+ itself
+
+D-Bus policy XML files are generic configuration for the bus daemon:
+they are conventionally named like a bus name, but there is nothing
+that inherently limits their application to that bus name.
+
+In particular this means that a rule like
+
+  <policy context="default">
+    <allow send_interface="org.freedesktop.DBus.Properties"/>
+
+allows any process on the system bus to send an
+org.freedesktop.DBus.Properties.Set() call to any other process on the
+system bus, even if the destination process expected to be only
+accessible by root.
+
+Fixes https://github.com/hadess/iio-sensor-proxy/issues/41
+---
+ data/net.hadess.SensorProxy.conf | 24 ++++++++++++------------
+ 1 file changed, 12 insertions(+), 12 deletions(-)
+
+--- a/data/net.hadess.SensorProxy.conf
++++ b/data/net.hadess.SensorProxy.conf
+@@ -12,22 +12,22 @@
+ 
+   <!-- Only Geoclue can access the compass -->
+   <policy user="geoclue">
+-    <allow send_interface="net.hadess.SensorProxy.Compass" send_path="/net/hadess/SensorProxy/Compass"/>
+-    <allow send_interface="org.freedesktop.DBus.Introspectable" send_path="/net/hadess/SensorProxy/Compass"/>
+-    <allow send_interface="org.freedesktop.DBus.Properties" send_path="/net/hadess/SensorProxy/Compass"/>
+-    <allow send_interface="org.freedesktop.DBus.Peer" send_path="/net/hadess/SensorProxy/Compass"/>
++    <allow send_destination="net.hadess.SensorProxy" send_interface="net.hadess.SensorProxy.Compass" send_path="/net/hadess/SensorProxy/Compass"/>
++    <allow send_destination="net.hadess.SensorProxy" send_interface="org.freedesktop.DBus.Introspectable" send_path="/net/hadess/SensorProxy/Compass"/>
++    <allow send_destination="net.hadess.SensorProxy" send_interface="org.freedesktop.DBus.Properties" send_path="/net/hadess/SensorProxy/Compass"/>
++    <allow send_destination="net.hadess.SensorProxy" send_interface="org.freedesktop.DBus.Peer" send_path="/net/hadess/SensorProxy/Compass"/>
+   </policy>
+ 
+   <!-- Anyone can talk to the main interface -->
+   <policy context="default">
+-    <allow send_interface="net.hadess.SensorProxy"/>
+-    <allow send_interface="org.freedesktop.DBus.Introspectable"/>
+-    <allow send_interface="org.freedesktop.DBus.Properties"/>
+-    <allow send_interface="org.freedesktop.DBus.Peer"/>
+-    <deny send_interface="org.freedesktop.DBus.Introspectable" send_path="/net/hadess/SensorProxy/Compass"/>
+-    <deny send_interface="org.freedesktop.DBus.Properties" send_path="/net/hadess/SensorProxy/Compass"/>
+-    <deny send_interface="org.freedesktop.DBus.Peer" send_path="/net/hadess/SensorProxy/Compass"/>
+-    <!-- <deny send_interface="net.hadess.SensorProxy.Compass"/> -->
++    <allow send_destination="net.hadess.SensorProxy" send_interface="net.hadess.SensorProxy"/>
++    <allow send_destination="net.hadess.SensorProxy" send_interface="org.freedesktop.DBus.Introspectable"/>
++    <allow send_destination="net.hadess.SensorProxy" send_interface="org.freedesktop.DBus.Properties"/>
++    <allow send_destination="net.hadess.SensorProxy" send_interface="org.freedesktop.DBus.Peer"/>
++    <deny send_destination="net.hadess.SensorProxy" send_interface="org.freedesktop.DBus.Introspectable" send_path="/net/hadess/SensorProxy/Compass"/>
++    <deny send_destination="net.hadess.SensorProxy" send_interface="org.freedesktop.DBus.Properties" send_path="/net/hadess/SensorProxy/Compass"/>
++    <deny send_destination="net.hadess.SensorProxy" send_interface="org.freedesktop.DBus.Peer" send_path="/net/hadess/SensorProxy/Compass"/>
++    <!-- <deny send_destination="net.hadess.SensorProxy" send_interface="net.hadess.SensorProxy.Compass"/> -->
+   </policy>
+ 
+ </busconfig>
diff --git a/debian/patches/series b/debian/patches/series
index 07b1774..9073c59 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 data-Fix-compass-property-name.patch
+iio-dbus-policy-security.patch



More information about the Neon-commits mailing list