USB HDD makes lshw seg-fault when run as root
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lshw (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Trusty |
Fix Released
|
Medium
|
Dan Streetman | ||
Vivid |
Won't Fix
|
Medium
|
Unassigned | ||
Wily |
Fix Released
|
Medium
|
Unassigned | ||
Xenial |
Fix Released
|
Medium
|
Dan Streetman | ||
Artful |
Fix Released
|
Medium
|
Unassigned |
Bug Description
[Impact]
Scenario #1:
* When there is an external USB External Drive[1] connected to the system, 'lshw' command segfaults.
Scenario #2:
* In the Landscape context, 'lshw' is use for Landscape clients[2] HW inventory ... if an USB External Drive[1] is connected on a Trusty Landscape client, lshw will segfault, thus Landcape inventory for this computer won't be reported/updated.
[1] - In this case :
Patriot 32GB Supersonic Rage Series USB 3.0 Flash Drive
[2] - landscape-client
landscape/
[Test Case]
Scenario #1:
* Install Ubuntu Trusty/14.04 LTS
* Install lshw
- sudo apt-get install lshw -y
* Connect the USB 3.0 external drive to the system from where 'lshw' will be executed.
* Execute 'lshw' or any other tools that uses 'lshw' behind the scene. (Example : Landscape computer inventory, ...)
Scenario #2:
* Install Ubuntu Trusty/14.04 LTS
* Install landscape-client
* Register the computer to the Landscape (Dedicated server or hosted)
* Client HW inventory won't happen and system will store a 'lshw' crash file under /var/crash.
[Regression Potential]
* Risk is low, the upstream commit has been specifically made upstream to fix this problem, and the fix is part of 'lshw' Ubuntu package since 2015, Wily. I don't know why Trusty never been SRU'd at the same time, but it's never too late to fix it now that we have users facing this problem in Trusty/14.04 (LTS)
* It's been ~3 years now since the patch has been first introduced in lshw upstream, and since then no known regression or else has been reporter against this specific commit.
* Debian has the fix.
* The code changed by this patch handles querying the serial number, so regression in this area may cause incorrect or missing serial number(s) to be reported by lshw.
[Other Info]
* Upstream commits :
https:/
https:/
* Bugs:
http://
http://
[Original Description]
The HDD enclosure causing this is the 'ORICO 2.5 inch USB 3.0'
As seen here http://
When the enclosure is plugged in, the lshw command runs fine as a plain user, but when run as root with either 'sudo su', 'sudo -i' or just 'sudo' (I tried all to be sure), lshw starts the normal process of scanning through the stuff it scans, but instead of outputting any information, it seg-faults with the message "Segmentation Fault".
When I unplug the HDD enclosure, lshw then runs fine as root.
This problem occurs both with USB 3.0 and USB 2.0, and has been tested on an AMD 64-bit machine running Xubuntu 14.04 (upgraded from 12.04).
I also tested on an older Intel 32-bit machine running Xubuntu 14.04 and got the same problem, except this time the message was different;
"
terminate called after throwing an instance of 'std::length_error'
what(): basic_string:
"
I have pasted an extract from dmesg (from the AMD 64-bit machine) here:
http://
of which mentions lshw with some information about the USB device.
(this is my first ever bug report, so apologies in advanced if I made any mistakes)
(Package version lshw 02.16-2ubuntu1.2)
Related branches
- Marc Deslauriers: Needs Fixing
-
Diff: 184 lines (+159/-0)4 files modifieddebian/changelog (+7/-0)
debian/patches/presumably-fix-653.patch (+30/-0)
debian/patches/series (+2/-0)
debian/patches/use-a-different-approach-for-scanning-SCSI-generic-d.patch (+120/-0)
- Sebastien Bacher: Disapprove
-
Diff: 58 lines (+38/-0)3 files modifieddebian/changelog (+7/-0)
debian/patches/presumably-fix-653.patch (+30/-0)
debian/patches/series (+1/-0)
- Michael Terry: Approve
-
Diff: 58 lines (+38/-0)3 files modifieddebian/changelog (+7/-0)
debian/patches/presumably-fix-653.patch (+30/-0)
debian/patches/series (+1/-0)
Changed in lshw (Ubuntu Xenial): | |
status: | New → Fix Released |
Changed in lshw (Ubuntu Vivid): | |
status: | Confirmed → Won't Fix |
Changed in lshw (Ubuntu Trusty): | |
status: | Confirmed → In Progress |
assignee: | nobody → Eric Desrochers (slashd) |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
tags: | added: sts |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
Changed in lshw (Ubuntu Xenial): | |
assignee: | nobody → Dan Streetman (ddstreet) |
status: | Fix Released → In Progress |
description: | updated |
tags: | added: sts-sru-needed |
I also encounter this issue in Ubuntu OEM project.
This bug is fixed in https:/ /github. com/lyonel/ lshw/commit/ d048d300b5daeb4 4887a7fc06ddeb1 20119cac8a
The issue in upstream: [lshw segfaults, with some 16GB USB-3 sticks from Patriot] http:// www.ezix. org/project/ ticket/ 653
I've made a patch to fix it.