numactl crashes with segfault

Bug #1441388 reported by Daniel J Blueman
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
numactl (Ubuntu)
Fix Released
High
Unassigned
Trusty
Fix Released
High
Unassigned
Utopic
Fix Released
High
Unassigned

Bug Description

===============================================================
SRU Justification
Impact: program crashes, may be exploitable
Test case: "numactl --hardware" on a large system
Regression potential: this patch only makes sure that a bitmask is in bss to initialize to 0.
===============================================================
numactl sometimes crashes when enumerating hardware:

root@node1:~# numactl --hardware
available: 648 nodes (0-647)
Segmentation fault

Further analysis shows that libnuma is using an uninitialised pointer, which value depends on program layout. When layout is sufficiently different, the pointer is non-NULL and the library parses the data pointed to as a bitmap, crashing.

Therefore, it is possible to leverage this in an exploit.

I have fixed the issue upstream:
https://github.com/numactl/numactl/commit/6a7c2cf3f00e32082a1ada300cc585740e2b4bbd

information type: Private Security → Public
Revision history for this message
Seth Arnold (seth-arnold) wrote :

Do you know if a CVE has been assigned to this issue? I don't directly see how it could be used to cross privilege boundaries. Is there something I've missed?

Thanks

Revision history for this message
Daniel J Blueman (watchmaker) wrote :

A CVE hasn't been assigned.

Presumably an attacker could manipulate the environment before an application's libnuma call to have the uninitialised pointer point to information in memory they'd like to extract, or cause a denial.

If an application that gained privileges (capabilities, setuid etc) uses libnuma, this may allow access to move privileged data.

That said, probably it would only be libvirt:

$ apt-cache rdepends libnuma1
libnuma1
Reverse Depends:
  libvirt0
  libvirt-bin
  libhwloc5
  libvirt0
  libvirt-bin
  libnuma1:i386
  libnuma1:i386
  crafty
  rt-tests
  procenv
  numactl
  libhwloc5
  libvirt0
  libvirt-bin
  libnuma-dev
  libnuma-dbg
  irqbalance

Revision history for this message
Daniel J Blueman (watchmaker) wrote :

I've attached the debdiff with the fix.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "debdiff with upstream fix" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Revision history for this message
Daniel Holbach (dholbach) wrote :

I took the liberty to add a cdbs patch (as that's what the source package is using), find the resulting debdiff here: http://paste.ubuntu.com/10790767/

I uploaded it and it's sitting in the release team's review queue.

Changed in numactl (Ubuntu):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package numactl - 2.0.10-1ubuntu2

---------------
numactl (2.0.10-1ubuntu2) vivid; urgency=medium

  * d/patches/from-git-6a7c2cf3-fix-uninitialised-mask.patch: Fix libnuma SEGV
    due to uninitialised mask. (LP: #1441388)
 -- Daniel J Blueman <email address hidden> Wed, 08 Apr 2015 05:30:55 +0200

Changed in numactl (Ubuntu):
status: Fix Committed → Fix Released
Changed in numactl (Ubuntu):
importance: Undecided → High
Changed in numactl (Ubuntu Trusty):
importance: Undecided → High
Changed in numactl (Ubuntu Utopic):
importance: Undecided → High
description: updated
Revision history for this message
Chris J Arges (arges) wrote : Please test proposed package

Hello Daniel, or anyone else affected,

Accepted numactl into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/numactl/2.0.9~rc5-1ubuntu3.14.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in numactl (Ubuntu Trusty):
status: New → Fix Committed
tags: added: verification-needed
Changed in numactl (Ubuntu Utopic):
status: New → Fix Committed
Revision history for this message
Chris J Arges (arges) wrote :

Hello Daniel, or anyone else affected,

Accepted numactl into utopic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/numactl/2.0.9~rc5-1ubuntu3.14.10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Revision history for this message
Daniel J Blueman (watchmaker) wrote :
Chris J Arges (arges)
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package numactl - 2.0.9~rc5-1ubuntu3.14.10.1

---------------
numactl (2.0.9~rc5-1ubuntu3.14.10.1) utopic-proposed; urgency=medium

  * d/p/libnuma-ppc64el-cpu-number-not-contiguous - patch from Thierry FAUCK
    (LP: #1358835)
  * d/patches/from-git-6a7c2cf3-fix-uninitialised-mask.patch: Fix libnuma SEGV
    due to uninitialised mask. (LP: #1441388)
  * d/rules: include simple-patchsys.mk to get patches applied

 -- Serge Hallyn <email address hidden> Thu, 21 May 2015 15:30:52 -0700

Changed in numactl (Ubuntu Utopic):
status: Fix Committed → Fix Released
Revision history for this message
Chris J Arges (arges) wrote : Update Released

The verification of the Stable Release Update for numactl has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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

This bug was fixed in the package numactl - 2.0.9~rc5-1ubuntu3.14.04.1

---------------
numactl (2.0.9~rc5-1ubuntu3.14.04.1) trusty-proposed; urgency=medium

  * d/p/libnuma-ppc64el-cpu-number-not-contiguous - patch from Thierry FAUCK
    (LP: #1358835)
  * d/patches/from-git-6a7c2cf3-fix-uninitialised-mask.patch: Fix libnuma SEGV
    due to uninitialised mask. (LP: #1441388)
  * d/rules: include simple-patchsys.mk to get patches applied

 -- Serge Hallyn <email address hidden> Thu, 21 May 2015 15:43:11 -0700

Changed in numactl (Ubuntu Trusty):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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