[Regression] crash in scan_dmi_sysfs when running as non-root

Bug #1590994 reported by dann frazier on 2016-06-09
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lshw
Unknown
Unknown
lshw (Ubuntu)
High
dann frazier
Xenial
High
dann frazier

Bug Description

[Impact]
lshw crashes when run as non-root:

Though it does warn before crashing that it should be run as super-user, it should fail gracefully - not abort and dump core. A number of users have been hitting this since the regression has been introduced:

  https://errors.ubuntu.com/problem/3ef7206b4102c14c8741b44fde30b21b4a571bbe

[Test Case]
ubuntu@lshw:~$ lshw
WARNING: you should run this program as super-user.
terminate called after throwing an instance of 'std::bad_alloc'
  what(): std::bad_alloc
Aborted (core dumped)

[Regression Risk]
The fix I've proposed[*] only comes into play when lshw is about to crash, so regression risk should be minimal.

[*] https://github.com/lyonel/lshw/pull/14

dann frazier (dannf) wrote :

This impacts upstream; I've submitted a bug (stuck in moderation) and a pull request. I'll give upstream a day or so to digest to see if we can incorporate an upstream-accepted fix.

Changed in lshw (Ubuntu Xenial):
status: New → Confirmed
assignee: nobody → dann frazier (dannf)
importance: Undecided → High
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lshw - 02.17-1.1ubuntu5

---------------
lshw (02.17-1.1ubuntu5) yakkety; urgency=medium

  * d/p/Avoid-crash-in-scan_dmi_sysfs-when-running-as-non-ro.patch: Fix a
    regression from the last upload that causes lshw to crash when running
    unprivileged (LP: #1590994).

 -- dann frazier <email address hidden> Mon, 13 Jun 2016 16:36:15 -0600

Changed in lshw (Ubuntu):
status: Confirmed → Fix Released

Hello dann, or anyone else affected,

Accepted lshw into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/lshw/02.17-1.1ubuntu3.2 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 lshw (Ubuntu Xenial):
status: Confirmed → Fix Committed
tags: added: verification-needed
dann frazier (dannf) wrote :

I ran the following tests:

= ARM64 (APM Mustang in u-boot mode) =
$ lshw > lshw-02.17-1.1ubuntu3.1
$ sudo lshw > sudo-lshw-02.17-1.1ubuntu3.1
# apt upgrade lshw
$ lshw > lshw-02.17-1.1ubuntu3.2
$ sudo lshw > sudo-lshw-02.17-1.1ubuntu3.2
$ diff -u lshw-02.17-1.1ubuntu3.1 lshw-02.17-1.1ubuntu3.2
$ diff -u sudo-lshw-02.17-1.1ubuntu3.1 sudo-lshw-02.17-1.1ubuntu3.2

= x86 (OpenStack instance) =
$ lshw
WARNING: you should run this program as super-user.
terminate called after throwing an instance of 'std::bad_alloc'
  what(): std::bad_alloc
Aborted (core dumped)
$ sudo lshw > sudo-lshw-02.17-1.1ubuntu3.1
# apt upgrade lshw
$ lshw > lshw-02.17-1.1ubuntu3.2
WARNING: you should run this program as super-user.
WARNING: output may be incomplete or inaccurate, you should run this program as super-user.
# NOTE: didn't segfault
$ sudo lshw > sudo-lshw-02.17-1.1ubuntu3.2
$ diff -u sudo-lshw-02.17-1.1ubuntu3.1 sudo-lshw-02.17-1.1ubuntu3.2
$

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lshw - 02.17-1.1ubuntu3.2

---------------
lshw (02.17-1.1ubuntu3.2) xenial; urgency=medium

  * d/p/Avoid-crash-in-scan_dmi_sysfs-when-running-as-non-ro.patch: Fix a
    regression from the last upload that causes lshw to crash when running
    unprivileged (LP: #1590994).

 -- dann frazier <email address hidden> Tue, 14 Jun 2016 15:38:08 -0600

Changed in lshw (Ubuntu Xenial):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for lshw 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.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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