Package: lshw
Version: 02.18-0.1
Severity: normal

Dear Maintainer,

lshw crashes with SEGV in privileged containers in Ubuntu, unless you
disable the 'usb' test as follow :

$ lshw -disable usb


Note that the problem isn't reproducible in Debian because the container
image doesn't contains the 2 files from where lshw try to get
informations :

/proc/bus/usb/devices
/sys/kernel/debug/usb/devices

thus stop at the following lshw verification :

if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
  return false


but in Ubuntu, lshw segfault in a privileged container because the
actual lshw code only look if both doesn't exist or one of them is
inaccessible (EACCESS).. then lshw segfault.

For more informations about the Ubuntu bug : 
https://bugs.launchpad.net/bugs/1699161

Despite the fact that debian doesn't exhibit the situation, I think it
would be great to consider this lshw PR since Ubuntu or other
distributions relies on Debian for packages (merge, sync, ...) :

https://ezix.org/src/pkg/lshw/pulls/9

The change is trivial, and only introduce a better mechanism to validate
possible scenarios :

if both files doesn't exist
if 1/2 file exists
if files can't be opene (EACCESS)
....

Reply via email to