debian/0000755000000000000000000000000012216533110007160 5ustar debian/compat0000644000000000000000000000000212216531423010363 0ustar 7 debian/patches/0000755000000000000000000000000012216532411010612 5ustar debian/patches/ubuntu.series0000644000000000000000000000015312216532271013353 0ustar 01-no_ptrace_cap.patch 02-fix-undropped-supp-groups.patch 0001-SECURITY-Pass-uid-of-caller-to-polkit.patch debian/patches/02-fix-undropped-supp-groups.patch0000644000000000000000000000162312216531423017144 0ustar Description: Drop supplemental groups. From: http://git.0pointer.de/?p=rtkit.git;a=commitdiff;h=f9512c9c7d41 --- rtkit-daemon.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- rtkit.orig/rtkit-daemon.c +++ rtkit/rtkit-daemon.c @@ -49,6 +49,7 @@ #include #include #include +#include #include "rtkit.h" #include "sd-daemon.h" @@ -1777,7 +1778,8 @@ static int drop_privileges(void) { } /* Fourth, drop privs */ - if (setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) < 0 || + if (setgroups(0, NULL) < 0 || + setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) < 0 || setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) < 0) { r = -errno; syslog(LOG_ERR, "Failed to become %s: %s\n", username, strerror(errno)); debian/patches/series0000644000000000000000000000012412216532207012027 0ustar 02-fix-undropped-supp-groups.patch 0001-SECURITY-Pass-uid-of-caller-to-polkit.patch debian/patches/0001-SECURITY-Pass-uid-of-caller-to-polkit.patch0000644000000000000000000000374712216532701020742 0ustar Author: Colin Walters From: https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2013-4326 Description: Pass uid of caller to polkit Otherwise, we force polkit to look up the uid itself in /proc, which is racy if they execve() a setuid binary. --- rtkit-daemon.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) --- rtkit.orig/rtkit-daemon.c +++ rtkit/rtkit-daemon.c @@ -1170,12 +1170,14 @@ static int verify_polkit(DBusConnection DBusMessage *m = NULL, *r = NULL; const char *unix_process = "unix-process"; const char *pid = "pid"; + const char *uid = "uid"; const char *start_time = "start-time"; const char *cancel_id = ""; uint32_t flags = 0; uint32_t pid_u32 = p->pid; - uint64_t start_time_u64 = p->starttime; + uint32_t uid_u32 = (uint32_t)u->uid; DBusMessageIter iter_msg, iter_struct, iter_array, iter_dict, iter_variant; + uint64_t start_time_u64 = p->starttime; int ret; dbus_bool_t authorized = FALSE; @@ -1206,6 +1208,13 @@ static int verify_polkit(DBusConnection assert_se(dbus_message_iter_close_container(&iter_dict, &iter_variant)); assert_se(dbus_message_iter_close_container(&iter_array, &iter_dict)); + assert_se(dbus_message_iter_open_container(&iter_array, DBUS_TYPE_DICT_ENTRY, NULL, &iter_dict)); + assert_se(dbus_message_iter_append_basic(&iter_dict, DBUS_TYPE_STRING, &uid)); + assert_se(dbus_message_iter_open_container(&iter_dict, DBUS_TYPE_VARIANT, "u", &iter_variant)); + assert_se(dbus_message_iter_append_basic(&iter_variant, DBUS_TYPE_UINT32, &uid_u32)); + assert_se(dbus_message_iter_close_container(&iter_dict, &iter_variant)); + assert_se(dbus_message_iter_close_container(&iter_array, &iter_dict)); + assert_se(dbus_message_iter_close_container(&iter_struct, &iter_array)); assert_se(dbus_message_iter_close_container(&iter_msg, &iter_struct)); debian/patches/01-no_ptrace_cap.patch0000644000000000000000000000136412216531423014654 0ustar --- rtkit-daemon.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- rtkit.orig/rtkit-daemon.c +++ rtkit/rtkit-daemon.c @@ -1766,8 +1766,7 @@ static int drop_privileges(void) { cap_t caps; const cap_value_t cap_values[] = { CAP_SYS_NICE, /* Needed for obvious reasons */ - CAP_DAC_READ_SEARCH, /* Needed so that we can verify resource limits */ - CAP_SYS_PTRACE /* Needed so that we can read /proc/$$/exe. Linux is weird. */ + CAP_DAC_READ_SEARCH /* Needed so that we can verify resource limits */ }; /* Third, say that we want to keep caps */ debian/rules0000755000000000000000000000064312216531423010250 0ustar #!/usr/bin/make -f include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/autotools.mk DEB_CONFIGURE_EXTRA_FLAGS += --with-systemdsystemunitdir=/lib/systemd/system common-install-arch:: $(CURDIR)/rtkit-daemon --introspect > org.freedesktop.RealtimeKit1.xml install -m 644 -D org.freedesktop.RealtimeKit1.xml $(CURDIR)/debian/rtkit/usr/share/dbus-1/interfaces/org.freedesktop.RealtimeKit1.xml debian/control0000644000000000000000000000172012216531423010570 0ustar Source: rtkit Section: admin Priority: optional Maintainer: Debian Multimedia Maintainers Uploaders: Alessio Treglia , Luke Yelavich Build-Depends: autotools-dev, cdbs, debhelper (>= 7.0.50~), libcap-dev, libdbus-1-dev, libpolkit-backend-1-dev Standards-Version: 3.9.2 Vcs-Git: git://git.debian.org/git/pkg-multimedia/rtkit.git Vcs-Browser: http://git.debian.org/?p=pkg-multimedia/rtkit.git Homepage: http://0pointer.de/public/ Package: rtkit Architecture: any Depends: adduser, ${misc:Depends}, ${shlibs:Depends} Recommends: dbus, policykit-1 Description: Realtime Policy and Watchdog Daemon RealtimeKit is a D-Bus system service that changes the scheduling policy of user processes/threads to SCHED_RR (i.e. realtime scheduling mode) on request. It is intended to be used as a secure mechanism to allow real-time scheduling to be used by normal user processes. debian/rtkit.postinst0000644000000000000000000000101012216531423012117 0ustar #! /bin/sh # postinst script for rtkit set -e case "$1" in configure) if ! getent passwd rtkit >/dev/null; then adduser --disabled-password --quiet --system \ --home /proc --no-create-home \ --gecos "RealtimeKit" --group rtkit fi if [ -x "/etc/init.d/dbus" ]; then invoke-rc.d dbus force-reload || true fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac #DEBHELPER# exit 0 debian/changelog0000644000000000000000000000235312216533110011035 0ustar rtkit (0.10-3) unstable; urgency=high * Update debian/copyright. * Add dbus, policykit-1 on Recommends. (Closes: #657351) * Fix CVE-2013-4326 (Closes: #723714) -- Alessio Treglia Thu, 19 Sep 2013 09:30:47 +0100 rtkit (0.10-2) unstable; urgency=low * debian/patches/02-fix-undropped-supp-groups.patch: - Fix a security bug of not dropping supplemental groups. * Bump Standards. -- Alessio Treglia Thu, 28 Jul 2011 16:58:35 +0200 rtkit (0.10-1) unstable; urgency=low * New upstream release. -- Alessio Treglia Wed, 09 Mar 2011 22:05:48 +0100 rtkit (0.9-3) unstable; urgency=low * Pass systemd unit dir to the configure script, thanks to Daniel Schaal for the patch (Closes: #612084). -- Alessio Treglia Wed, 09 Feb 2011 10:02:26 +0100 rtkit (0.9-2) unstable; urgency=low * Reduce the delta between Debian and Ubuntu: - Re-introduce Ubuntu-specific patch, which gets applied to Ubuntu only. -- Alessio Treglia Mon, 15 Nov 2010 01:24:38 +0100 rtkit (0.9-1) unstable; urgency=low * Initial Debian package. (Closes: #535426) -- Luke Yelavich Tue, 02 Nov 2010 14:22:37 -0400 debian/rtkit.postrm0000644000000000000000000000020312216531423011563 0ustar #!/bin/sh set -e #DEBHELPER# if [ "$1" = "purge" ] ; then deluser --quiet --system rtkit > /dev/null || true fi exit 0 debian/gbp.conf0000644000000000000000000000027012216531423010603 0ustar [DEFAULT] upstream-branch = upstream debian-branch = master upstream-tag = upstream/%(version)s debian-tag = debian/%(version)s pristine-tar = True compression = gzip sign-tags = True debian/copyright0000644000000000000000000000456512216531423011132 0ustar Format: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=200 Upstream-Name: RealtimeKit Upstream-Contact: Lennart Poettering Source: http://0pointer.de/public Files: * Copyright: 2009 Lennart Poettering 2010 David Henningsson License: * Files: rtkitctl.c rtkit-test.c rtkit-daemon.c Copyright: 2009 Lennart Poettering 2010 Maarten Lankhorst License: GPL-3+ Files: debian/* Copyright: 2010-2012 Alessio Treglia 2010 Luke Yelavich License: GPL-3+ License: other Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. License: GPL-3+ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Comment: You should have received a copy of the GNU General Public License along with this program. If not, see . . On Debian systems the full text of the GNU General Public License can be found in the `/usr/share/common-licenses/GPL-3' file. debian/source/0000755000000000000000000000000012216531423010465 5ustar debian/source/format0000644000000000000000000000001412216531423011673 0ustar 3.0 (quilt) debian/watch0000644000000000000000000000007112216531423010214 0ustar version=3 http://0pointer.de/public/rtkit-(.*)\.tar\.gz