From 5146e9a5905d5b88b2a35725f4514cf46cdd1eda7ffddb574c465ea17bec5f85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= Date: Wed, 18 Sep 2013 23:39:18 +0000 Subject: [PATCH 1/3] Accepting request 199623 from home:fcrozat:branches:Base:System - Don't use a trigger to create symlink for sysctl.conf, always run the test on %post (bnc#840864). - Update sysctl-handle-boot-sysctl.conf-kernel_release.patch to ensure /boot is mounted before reading /boot/sysctl.conf-* (bnc#809420). OBS-URL: https://build.opensuse.org/request/show/199623 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=438 --- ...handle-boot-sysctl.conf-kernel_release.patch | 17 +++++++++++------ systemd-mini.changes | 9 +++++++++ systemd-mini.spec | 12 ++++++------ systemd.changes | 9 +++++++++ systemd.spec | 12 ++++++------ 5 files changed, 41 insertions(+), 18 deletions(-) diff --git a/sysctl-handle-boot-sysctl.conf-kernel_release.patch b/sysctl-handle-boot-sysctl.conf-kernel_release.patch index 45f1ad52..3381072a 100644 --- a/sysctl-handle-boot-sysctl.conf-kernel_release.patch +++ b/sysctl-handle-boot-sysctl.conf-kernel_release.patch @@ -10,8 +10,10 @@ configuration), needed by openSUSE (bnc#809420). units/systemd-sysctl.service.in | 1 + 2 files changed, 9 insertions(+) ---- systemd-206.orig/src/sysctl/sysctl.c -+++ systemd-206/src/sysctl/sysctl.c +Index: systemd-207/src/sysctl/sysctl.c +=================================================================== +--- systemd-207.orig/src/sysctl/sysctl.c ++++ systemd-207/src/sysctl/sysctl.c @@ -26,6 +26,7 @@ #include #include @@ -20,7 +22,7 @@ configuration), needed by openSUSE (bnc#809420). #include "log.h" #include "strv.h" -@@ -297,6 +298,13 @@ int main(int argc, char *argv[]) { +@@ -299,6 +300,13 @@ int main(int argc, char *argv[]) { } else { _cleanup_strv_free_ char **files = NULL; char **f; @@ -34,13 +36,16 @@ configuration), needed by openSUSE (bnc#809420). r = conf_files_list_nulstr(&files, ".conf", NULL, conf_file_dirs); if (r < 0) { ---- systemd-206.orig/units/systemd-sysctl.service.in -+++ systemd-206/units/systemd-sysctl.service.in -@@ -20,6 +20,7 @@ ConditionDirectoryNotEmpty=|/usr/lib/sys +Index: systemd-207/units/systemd-sysctl.service.in +=================================================================== +--- systemd-207.orig/units/systemd-sysctl.service.in ++++ systemd-207/units/systemd-sysctl.service.in +@@ -19,6 +19,8 @@ ConditionDirectoryNotEmpty=|/usr/lib/sys ConditionDirectoryNotEmpty=|/usr/local/lib/sysctl.d ConditionDirectoryNotEmpty=|/etc/sysctl.d ConditionDirectoryNotEmpty=|/run/sysctl.d +ConditionPathExistsGlob=|/boot/sysctl.conf-* ++RequiresMountsFor=/boot [Service] Type=oneshot diff --git a/systemd-mini.changes b/systemd-mini.changes index fdbda224..8fa23f49 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed Sep 18 12:05:47 UTC 2013 - fcrozat@suse.com + +- Don't use a trigger to create symlink for sysctl.conf, always run + the test on %post (bnc#840864). +- Update sysctl-handle-boot-sysctl.conf-kernel_release.patch to + ensure /boot is mounted before reading /boot/sysctl.conf-* + (bnc#809420). + ------------------------------------------------------------------- Mon Sep 16 17:41:24 UTC 2013 - crrodriguez@opensuse.org diff --git a/systemd-mini.spec b/systemd-mini.spec index 791d8bb4..2b2318a8 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -651,6 +651,12 @@ if [ "$1" -eq 1 ]; then remote-fs.target >/dev/null 2>&1 || : fi +# since v207 /etc/sysctl.conf is no longer parsed, however +# backward compatibility is provided by /etc/sysctl.d/99-sysctl.conf +if [ ! -L /etc/sysctl.d/99-sysctl.conf -a -e /etc/sysctl.conf ]; then + /bin/ln -sf /etc/sysctl.conf /etc/sysctl.d/99-sysctl.conf || : +fi + %triggerpostun -- systemd < 194 # migrate any symlink which may refer to the old path for f in $(find /etc/systemd/system -type l -xtype l); do @@ -658,12 +664,6 @@ for f in $(find /etc/systemd/system -type l -xtype l); do [ -f "$new_target" ] && ln -s -f $new_target $f || : done -# since v207 /etc/sysctl.conf is no longer parsed, however -# backward compatibility is provided by /etc/sysctl.d/99-sysctl.conf -if [ ! -L /etc/sysctl.d/99-sysctl.conf -a -e /etc/sysctl.conf ]; then - /bin/ln -sf /etc/sysctl.conf /etc/sysctl.d/99-sysctl.conf || : -fi - %postun /sbin/ldconfig if [ $1 -ge 1 ]; then diff --git a/systemd.changes b/systemd.changes index fdbda224..8fa23f49 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed Sep 18 12:05:47 UTC 2013 - fcrozat@suse.com + +- Don't use a trigger to create symlink for sysctl.conf, always run + the test on %post (bnc#840864). +- Update sysctl-handle-boot-sysctl.conf-kernel_release.patch to + ensure /boot is mounted before reading /boot/sysctl.conf-* + (bnc#809420). + ------------------------------------------------------------------- Mon Sep 16 17:41:24 UTC 2013 - crrodriguez@opensuse.org diff --git a/systemd.spec b/systemd.spec index 59482e6c..72ca9682 100644 --- a/systemd.spec +++ b/systemd.spec @@ -646,6 +646,12 @@ if [ "$1" -eq 1 ]; then remote-fs.target >/dev/null 2>&1 || : fi +# since v207 /etc/sysctl.conf is no longer parsed, however +# backward compatibility is provided by /etc/sysctl.d/99-sysctl.conf +if [ ! -L /etc/sysctl.d/99-sysctl.conf -a -e /etc/sysctl.conf ]; then + /bin/ln -sf /etc/sysctl.conf /etc/sysctl.d/99-sysctl.conf || : +fi + %triggerpostun -- systemd < 194 # migrate any symlink which may refer to the old path for f in $(find /etc/systemd/system -type l -xtype l); do @@ -653,12 +659,6 @@ for f in $(find /etc/systemd/system -type l -xtype l); do [ -f "$new_target" ] && ln -s -f $new_target $f || : done -# since v207 /etc/sysctl.conf is no longer parsed, however -# backward compatibility is provided by /etc/sysctl.d/99-sysctl.conf -if [ ! -L /etc/sysctl.d/99-sysctl.conf -a -e /etc/sysctl.conf ]; then - /bin/ln -sf /etc/sysctl.conf /etc/sysctl.d/99-sysctl.conf || : -fi - %postun /sbin/ldconfig if [ $1 -ge 1 ]; then From 506924ede0252908ee6c2bce1932c98b091e79f80b0a5186a09fe9c058f8214f Mon Sep 17 00:00:00 2001 From: Frederic Crozat Date: Thu, 19 Sep 2013 07:46:03 +0000 Subject: [PATCH 2/3] Accepting request 199672 from home:elvigia:branches:Base:System - 0009-polkit-Avoid-race-condition-in-scraping-proc.patch VUL-0: polkit: process subject race condition [bnc#835827] - Build with --disable-ima as the openSUSE kernel does not support IMA (CONFIG_IMA is not set) - Build with --disable-smack as the openSUSE kernel does not support smack (CONFIG_SECURITY_SMACK is not set) - 0009-polkit-Avoid-race-condition-in-scraping-proc.patch VUL-0: polkit: process subject race condition [bnc#835827] - Build with --disable-ima as the openSUSE kernel does not support IMA (CONFIG_IMA is not set) - Build with --disable-smack as the openSUSE kernel does not support smack (CONFIG_SECURITY_SMACK is not set) OBS-URL: https://build.opensuse.org/request/show/199672 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=439 --- ...void-race-condition-in-scraping-proc.patch | 75 +++++++++++++++++++ systemd-mini.changes | 18 +++++ systemd-mini.spec | 5 ++ systemd.changes | 18 +++++ systemd.spec | 5 ++ 5 files changed, 121 insertions(+) create mode 100644 0009-polkit-Avoid-race-condition-in-scraping-proc.patch diff --git a/0009-polkit-Avoid-race-condition-in-scraping-proc.patch b/0009-polkit-Avoid-race-condition-in-scraping-proc.patch new file mode 100644 index 00000000..283c2e7a --- /dev/null +++ b/0009-polkit-Avoid-race-condition-in-scraping-proc.patch @@ -0,0 +1,75 @@ +From 851d079d0172539bf904abb58edd80d7cfe487ca Mon Sep 17 00:00:00 2001 +From: Colin Walters +Date: Thu, 22 Aug 2013 13:55:21 -0400 +Subject: [PATCH 9/9] polkit: Avoid race condition in scraping /proc + +If a calling process execve()s a setuid program, it can appear to be +uid 0. Since we're receiving requests over DBus, avoid this by simply +passing system-bus-name as a subject. +--- + src/shared/polkit.c | 31 +++++-------------------------- + 1 file changed, 5 insertions(+), 26 deletions(-) + +diff --git a/src/shared/polkit.c b/src/shared/polkit.c +index cea7074..1c5e9e3 100644 +--- a/src/shared/polkit.c ++++ b/src/shared/polkit.c +@@ -38,12 +38,8 @@ int verify_polkit( + + #ifdef ENABLE_POLKIT + DBusMessage *m = NULL, *reply = NULL; +- const char *unix_process = "unix-process", *pid = "pid", *starttime = "start-time", *cancel_id = ""; ++ const char *system_bus_name = "system-bus-name", *name = "name", *cancel_id = ""; + uint32_t flags = interactive ? 1 : 0; +- pid_t pid_raw; +- uint32_t pid_u32; +- unsigned long long starttime_raw; +- uint64_t starttime_u64; + DBusMessageIter iter_msg, iter_struct, iter_array, iter_dict, iter_variant; + int r; + dbus_bool_t authorized = FALSE, challenge = FALSE; +@@ -68,14 +64,6 @@ int verify_polkit( + + #ifdef ENABLE_POLKIT + +- pid_raw = bus_get_unix_process_id(c, sender, error); +- if (pid_raw == 0) +- return -EINVAL; +- +- r = get_starttime_of_pid(pid_raw, &starttime_raw); +- if (r < 0) +- return r; +- + m = dbus_message_new_method_call( + "org.freedesktop.PolicyKit1", + "/org/freedesktop/PolicyKit1/Authority", +@@ -86,22 +74,13 @@ int verify_polkit( + + dbus_message_iter_init_append(m, &iter_msg); + +- pid_u32 = (uint32_t) pid_raw; +- starttime_u64 = (uint64_t) starttime_raw; +- + if (!dbus_message_iter_open_container(&iter_msg, DBUS_TYPE_STRUCT, NULL, &iter_struct) || +- !dbus_message_iter_append_basic(&iter_struct, DBUS_TYPE_STRING, &unix_process) || ++ !dbus_message_iter_append_basic(&iter_struct, DBUS_TYPE_STRING, &system_bus_name) || + !dbus_message_iter_open_container(&iter_struct, DBUS_TYPE_ARRAY, "{sv}", &iter_array) || + !dbus_message_iter_open_container(&iter_array, DBUS_TYPE_DICT_ENTRY, NULL, &iter_dict) || +- !dbus_message_iter_append_basic(&iter_dict, DBUS_TYPE_STRING, &pid) || +- !dbus_message_iter_open_container(&iter_dict, DBUS_TYPE_VARIANT, "u", &iter_variant) || +- !dbus_message_iter_append_basic(&iter_variant, DBUS_TYPE_UINT32, &pid_u32) || +- !dbus_message_iter_close_container(&iter_dict, &iter_variant) || +- !dbus_message_iter_close_container(&iter_array, &iter_dict) || +- !dbus_message_iter_open_container(&iter_array, DBUS_TYPE_DICT_ENTRY, NULL, &iter_dict) || +- !dbus_message_iter_append_basic(&iter_dict, DBUS_TYPE_STRING, &starttime) || +- !dbus_message_iter_open_container(&iter_dict, DBUS_TYPE_VARIANT, "t", &iter_variant) || +- !dbus_message_iter_append_basic(&iter_variant, DBUS_TYPE_UINT64, &starttime_u64) || ++ !dbus_message_iter_append_basic(&iter_dict, DBUS_TYPE_STRING, &name) || ++ !dbus_message_iter_open_container(&iter_dict, DBUS_TYPE_VARIANT, "s", &iter_variant) || ++ !dbus_message_iter_append_basic(&iter_variant, DBUS_TYPE_STRING, &sender) || + !dbus_message_iter_close_container(&iter_dict, &iter_variant) || + !dbus_message_iter_close_container(&iter_array, &iter_dict) || + !dbus_message_iter_close_container(&iter_struct, &iter_array) || +-- +1.8.1.4 + diff --git a/systemd-mini.changes b/systemd-mini.changes index 8fa23f49..e5d13e36 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,21 @@ +------------------------------------------------------------------- +Wed Sep 18 23:55:09 UTC 2013 - crrodriguez@opensuse.org + +- 0009-polkit-Avoid-race-condition-in-scraping-proc.patch + VUL-0: polkit: process subject race condition [bnc#835827] + +------------------------------------------------------------------- +Wed Sep 18 23:45:54 UTC 2013 - crrodriguez@opensuse.org + +- Build with --disable-ima as the openSUSE kernel + does not support IMA (CONFIG_IMA is not set) + +------------------------------------------------------------------- +Wed Sep 18 23:40:27 UTC 2013 - crrodriguez@opensuse.org + +- Build with --disable-smack as the openSUSE kernel + does not support smack (CONFIG_SECURITY_SMACK is not set) + ------------------------------------------------------------------- Wed Sep 18 12:05:47 UTC 2013 - fcrozat@suse.com diff --git a/systemd-mini.spec b/systemd-mini.spec index 2b2318a8..1e94acbe 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -187,6 +187,8 @@ Patch52: 0005-core-cgroup-first-print-then-free.patch Patch53: 0006-swap-fix-reverse-dependencies.patch # PATCH-FIX-UPSTREAM 0008-swap-create-.wants-symlink-to-auto-swap-devices.patch really fix swap units Patch54: 0008-swap-create-.wants-symlink-to-auto-swap-devices.patch +# PATCH-FIX-UPSTREAM 0009-polkit-Avoid-race-condition-in-scraping-proc.patch VUL-0: polkit: process subject race condition [bnc#835827] +Patch55: 0009-polkit-Avoid-race-condition-in-scraping-proc.patch # udev patches # PATCH-FIX-OPENSUSE 1001-re-enable-by_path-links-for-ata-devices.patch @@ -441,6 +443,7 @@ cp %{SOURCE7} m4/ %patch52 -p1 %patch53 -p1 %patch54 -p1 +%patch55 -p1 # udev patches %patch1001 -p1 @@ -479,6 +482,8 @@ export V=1 --with-rc-local-script-path-start=/etc/init.d/boot.local \ --with-rc-local-script-path-stop=/etc/init.d/halt.local \ --with-debug-shell=/bin/bash \ + --disable-smack \ + --disable-ima \ CFLAGS="%{optflags}" make %{?_smp_mflags} diff --git a/systemd.changes b/systemd.changes index 8fa23f49..e5d13e36 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,21 @@ +------------------------------------------------------------------- +Wed Sep 18 23:55:09 UTC 2013 - crrodriguez@opensuse.org + +- 0009-polkit-Avoid-race-condition-in-scraping-proc.patch + VUL-0: polkit: process subject race condition [bnc#835827] + +------------------------------------------------------------------- +Wed Sep 18 23:45:54 UTC 2013 - crrodriguez@opensuse.org + +- Build with --disable-ima as the openSUSE kernel + does not support IMA (CONFIG_IMA is not set) + +------------------------------------------------------------------- +Wed Sep 18 23:40:27 UTC 2013 - crrodriguez@opensuse.org + +- Build with --disable-smack as the openSUSE kernel + does not support smack (CONFIG_SECURITY_SMACK is not set) + ------------------------------------------------------------------- Wed Sep 18 12:05:47 UTC 2013 - fcrozat@suse.com diff --git a/systemd.spec b/systemd.spec index 72ca9682..35833e9e 100644 --- a/systemd.spec +++ b/systemd.spec @@ -182,6 +182,8 @@ Patch52: 0005-core-cgroup-first-print-then-free.patch Patch53: 0006-swap-fix-reverse-dependencies.patch # PATCH-FIX-UPSTREAM 0008-swap-create-.wants-symlink-to-auto-swap-devices.patch really fix swap units Patch54: 0008-swap-create-.wants-symlink-to-auto-swap-devices.patch +# PATCH-FIX-UPSTREAM 0009-polkit-Avoid-race-condition-in-scraping-proc.patch VUL-0: polkit: process subject race condition [bnc#835827] +Patch55: 0009-polkit-Avoid-race-condition-in-scraping-proc.patch # udev patches # PATCH-FIX-OPENSUSE 1001-re-enable-by_path-links-for-ata-devices.patch @@ -436,6 +438,7 @@ cp %{SOURCE7} m4/ %patch52 -p1 %patch53 -p1 %patch54 -p1 +%patch55 -p1 # udev patches %patch1001 -p1 @@ -474,6 +477,8 @@ export V=1 --with-rc-local-script-path-start=/etc/init.d/boot.local \ --with-rc-local-script-path-stop=/etc/init.d/halt.local \ --with-debug-shell=/bin/bash \ + --disable-smack \ + --disable-ima \ CFLAGS="%{optflags}" make %{?_smp_mflags} From d515402e92f16d13d24ccf43c37591aab4036f095be46c83140daf360cfffe3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= Date: Thu, 19 Sep 2013 18:32:09 +0000 Subject: [PATCH 3/3] Accepting request 199741 from home:fcrozat:branches:Base:System - Move symlink migration trigger to post (bnc#821800). -add CVE-2013-4288 to changes OBS-URL: https://build.opensuse.org/request/show/199741 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=440 --- systemd-mini.changes | 6 ++++++ systemd-mini.spec | 1 - systemd.changes | 6 ++++++ systemd.spec | 1 - 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/systemd-mini.changes b/systemd-mini.changes index e5d13e36..3b0115a2 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,8 +1,14 @@ +------------------------------------------------------------------- +Thu Sep 19 16:37:03 CEST 2013 - fcrozat@suse.com + +- Move symlink migration trigger to post (bnc#821800). + ------------------------------------------------------------------- Wed Sep 18 23:55:09 UTC 2013 - crrodriguez@opensuse.org - 0009-polkit-Avoid-race-condition-in-scraping-proc.patch VUL-0: polkit: process subject race condition [bnc#835827] + CVE-2013-4288 ------------------------------------------------------------------- Wed Sep 18 23:45:54 UTC 2013 - crrodriguez@opensuse.org diff --git a/systemd-mini.spec b/systemd-mini.spec index 1e94acbe..4cc75fb8 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -662,7 +662,6 @@ if [ ! -L /etc/sysctl.d/99-sysctl.conf -a -e /etc/sysctl.conf ]; then /bin/ln -sf /etc/sysctl.conf /etc/sysctl.d/99-sysctl.conf || : fi -%triggerpostun -- systemd < 194 # migrate any symlink which may refer to the old path for f in $(find /etc/systemd/system -type l -xtype l); do new_target="/usr$(readlink $f)" diff --git a/systemd.changes b/systemd.changes index e5d13e36..3b0115a2 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,8 +1,14 @@ +------------------------------------------------------------------- +Thu Sep 19 16:37:03 CEST 2013 - fcrozat@suse.com + +- Move symlink migration trigger to post (bnc#821800). + ------------------------------------------------------------------- Wed Sep 18 23:55:09 UTC 2013 - crrodriguez@opensuse.org - 0009-polkit-Avoid-race-condition-in-scraping-proc.patch VUL-0: polkit: process subject race condition [bnc#835827] + CVE-2013-4288 ------------------------------------------------------------------- Wed Sep 18 23:45:54 UTC 2013 - crrodriguez@opensuse.org diff --git a/systemd.spec b/systemd.spec index 35833e9e..4243575b 100644 --- a/systemd.spec +++ b/systemd.spec @@ -657,7 +657,6 @@ if [ ! -L /etc/sysctl.d/99-sysctl.conf -a -e /etc/sysctl.conf ]; then /bin/ln -sf /etc/sysctl.conf /etc/sysctl.d/99-sysctl.conf || : fi -%triggerpostun -- systemd < 194 # migrate any symlink which may refer to the old path for f in $(find /etc/systemd/system -type l -xtype l); do new_target="/usr$(readlink $f)"