CVE-2010-4170 and CVE-2010-4171: staprun module loading/unloading security fixes

Bug #677226 reported by Lorenzo De Liso
258
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemtap (Debian)
Fix Released
Unknown
systemtap (Ubuntu)
Fix Released
High
Unassigned
Maverick
Fix Released
High
Unassigned

Bug Description

Binary package hint: systemtap

Two security problems have been found in the setuid-root /usr/bin/staprun program [1]. The issue have been fixed upstream [2]. See CVE-2010-4170 and CVE-2010-4171.

[1] http://sources.redhat.com/ml/systemtap/2010-q4/msg00230.html
[2] http://sources.redhat.com/git/gitweb.cgi?p=systemtap.git;a=commit;h=b7565b41228bea196cefa3a7d43ab67f8f9152e2

Lorenzo De Liso (blackz)
visibility: private → public
Changed in systemtap (Ubuntu):
importance: Undecided → High
Changed in systemtap (Ubuntu Maverick):
importance: Undecided → High
Changed in systemtap (Ubuntu):
assignee: nobody → Lorenzo De Liso (blackz)
status: New → In Progress
Changed in systemtap (Ubuntu Maverick):
assignee: nobody → Lorenzo De Liso (blackz)
status: New → In Progress
Changed in systemtap (Debian):
status: Unknown → New
Revision history for this message
Lorenzo De Liso (blackz) wrote :

Debdiff for natty.

Revision history for this message
Lorenzo De Liso (blackz) wrote :

Debdiff for maverick.

Changed in systemtap (Ubuntu):
assignee: Lorenzo De Liso (blackz) → nobody
status: In Progress → New
Changed in systemtap (Ubuntu Maverick):
assignee: Lorenzo De Liso (blackz) → nobody
status: In Progress → New
Revision history for this message
Steve Beattie (sbeattie) wrote :

Looking at http://sources.redhat.com/git/gitweb.cgi?p=systemtap.git;a=commit;h=b7565b41228bea196cefa3a7d43ab67f8f9152e2 , one thing that's done that's missing from your debdiff is to install staprun without world execute privileges and instead limit execution to users in the stapusr group, to minimize the risk from future vulnerabilities. Do you think you could add that?

Revision history for this message
Lorenzo De Liso (blackz) wrote :

Corrected debdiff for natty.

Revision history for this message
Lorenzo De Liso (blackz) wrote :

Corrected debdiff for maverick.

Changed in systemtap (Debian):
status: New → Fix Committed
Revision history for this message
Steve Beattie (sbeattie) wrote :

Unfortunately, relying on build time permission setting is insufficient; dh_fixperms removes the setuid bit and converts everything to root ownership. In order to fix it to be owned, we need to do dpkg-statoverride in the postinst (as well as tweak the dh_fixperms_override step in the debian rules file), like so:

diff -Nru systemtap-1.3/debian/rules systemtap-1.3/debian/rules
--- systemtap-1.3/debian/rules 2010-08-06 11:34:25.000000000 -0700
+++ systemtap-1.3/debian/rules 2010-11-19 15:26:42.000000000 -0800
@@ -87,7 +87,7 @@

 override_dh_fixperms:
  dh_fixperms
- chmod 4755 debian/systemtap-runtime/usr/bin/staprun
+ chmod 4750 debian/systemtap-runtime/usr/bin/staprun

 override_dh_installchangelogs:
          dh_installchangelogs debian/changelog
diff -Nru systemtap-1.3/debian/systemtap-runtime.postinst systemtap-1.3/debian/systemtap-runtime.postinst
--- systemtap-1.3/debian/systemtap-runtime.postinst 2010-08-06 11:34:25.000000000 -0700
+++ systemtap-1.3/debian/systemtap-runtime.postinst 2010-11-19 15:30:31.000000000 -0800
@@ -12,6 +12,11 @@
   echo "Adding stapusr group..."
   addgroup --quiet --system stapusr || true
  fi
+ # Fixup staprun binary for new group 'stapusr'.
+ if [ -x /usr/sbin/dpkg-statoverride ] &&
+ ! dpkg-statoverride --list /usr/bin/staprun > /dev/null ; then
+ dpkg-statoverride --update --add root stapusr 4750 /usr/bin/staprun
+ fi
  ;;
 abort-upgrade|abort-remove|abort-deconfigure)
  ;;

I've incorporate this into packages that I've uploaded to the ubuntu-security-proposed ppa at https://launchpad.net/~ubuntu-security-proposed/+archive/ppa/+packages and verified that the permissions and ownership are such that only users in the stapusr group (as well as root) can run staprun, and that the upstream patch addresses Tavis' example cases:

   $ staprun [module_to_remove]

and

  $ MODPROBE_OPTIONS="--dirname /tmp" staprun -u whatever

Thanks.

Revision history for this message
Lorenzo De Liso (blackz) wrote :

Re-updated debdiff for natty.

Revision history for this message
Lorenzo De Liso (blackz) wrote :

Re-updated debdiff for maverick.

Revision history for this message
Lorenzo De Liso (blackz) wrote :
Changed in systemtap (Debian):
status: Fix Committed → Fix Released
Revision history for this message
Lorenzo De Liso (blackz) wrote :

Oh sorry, I seen now you uploaded the packages with the same fixes to https://launchpad.net/~ubuntu-security-proposed/+archive/ppa/+packages . They look fine to me.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemtap - 1.3-1ubuntu0.1

---------------
systemtap (1.3-1ubuntu0.1) maverick-security; urgency=low

  [ Lorenzo De Liso ]
  * SECURITY UPDATE: staprun module loading/unloading security fixes
    (LP: #677226)
    - debian/patches/CVE-2010-4170+CVE-2010-4171.patch
    - CVE 2010-4170
    - CVE 2010-4171

  [ Steve Beattie ]
  * debian/rules, debian/systemtap-runtime.postinst: restrict
    executable access to group stapusr to match upstream intent
 -- Steve Beattie <email address hidden> Fri, 19 Nov 2010 23:08:25 -0800

Changed in systemtap (Ubuntu Maverick):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemtap - 1.3-1ubuntu1

---------------
systemtap (1.3-1ubuntu1) natty; urgency=low

  [ Lorenzo De Liso ]
  * SECURITY UPDATE: staprun module loading/unloading security fixes
    (LP: #677226)
    - debian/patches/CVE-2010-4170+CVE-2010-4171.patch
    - CVE 2010-4170
    - CVE 2010-4171

  [ Steve Beattie ]
  * debian/rules, debian/systemtap-runtime.postinst: restrict
    executable access to group stapusr to match upstream intent
 -- Steve Beattie <email address hidden> Fri, 19 Nov 2010 15:32:49 -0800

Changed in systemtap (Ubuntu):
status: New → Fix Released
Changed in systemtap (Debian):
status: Fix Released → New
Changed in systemtap (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.