2017-06-20 14:29:54 |
Christian Reis |
bug |
|
|
added bug |
2017-06-20 14:33:01 |
Christian Reis |
attachment added |
|
_usr_bin_lshw.0.crash https://bugs.launchpad.net/ubuntu/+source/lxd/+bug/1699161/+attachment/4899320/+files/_usr_bin_lshw.0.crash |
|
2017-06-20 14:33:18 |
Rafael David Tinoco |
lxd (Ubuntu): assignee |
|
Rafael David Tinoco (inaddy) |
|
2017-06-20 14:33:22 |
Rafael David Tinoco |
lxd (Ubuntu): status |
New |
Confirmed |
|
2017-06-20 14:33:29 |
Rafael David Tinoco |
nominated for series |
|
Ubuntu Xenial |
|
2017-06-20 17:31:51 |
Christian Reis |
summary |
lshw crashes with SEGV |
lshw crashes with SEGV in unprivileged container |
|
2017-06-26 06:36:06 |
Stéphane Graber |
affects |
lxd (Ubuntu) |
lshw (Ubuntu) |
|
2017-06-26 06:36:17 |
Stéphane Graber |
summary |
lshw crashes with SEGV in unprivileged container |
lshw crashes with SEGV in privileged containers |
|
2017-06-26 06:37:14 |
Stéphane Graber |
description |
When running lshw in a Xenial container, I'm getting a segmentation fault. I'll attach the apport crash dump. |
When running lshw in a Xenial container, I'm getting a segmentation fault. I'll attach the apport crash dump.
```
stgraber@castiana:~$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
stgraber@castiana:~$ lxc exec priv bash
root@priv:~# lshw
Segmentation fault
root@priv:~#
[strace of lshw]
open("/usr/share/hwdata/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/lshw-common/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/usb/devices", O_RDONLY) = -1 EACCES (Permission denied)
open("/proc/bus/usb/devices", O_RDONLY) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault |
|
2017-06-26 06:37:24 |
Stéphane Graber |
description |
When running lshw in a Xenial container, I'm getting a segmentation fault. I'll attach the apport crash dump.
```
stgraber@castiana:~$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
stgraber@castiana:~$ lxc exec priv bash
root@priv:~# lshw
Segmentation fault
root@priv:~#
[strace of lshw]
open("/usr/share/hwdata/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/lshw-common/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/usb/devices", O_RDONLY) = -1 EACCES (Permission denied)
open("/proc/bus/usb/devices", O_RDONLY) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault |
When running lshw in a Xenial container, I'm getting a segmentation fault. I'll attach the apport crash dump.
```
stgraber@castiana:~$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
stgraber@castiana:~$ lxc exec priv bash
root@priv:~# lshw
Segmentation fault
root@priv:~#
```
[strace of lshw]
open("/usr/share/hwdata/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/lshw-common/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/usb/devices", O_RDONLY) = -1 EACCES (Permission denied)
open("/proc/bus/usb/devices", O_RDONLY) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault |
|
2017-06-26 10:09:02 |
Rafael David Tinoco |
lshw (Ubuntu): importance |
Undecided |
Medium |
|
2017-08-08 19:12:33 |
Jason Hobbs |
tags |
|
foundations-engine |
|
2017-10-11 14:36:34 |
Eric Desrochers |
bug task added |
|
lshw (Ubuntu Xenial) |
|
2017-10-11 15:12:24 |
Dan Streetman |
bug |
|
|
added subscriber Dan Streetman |
2017-10-11 15:49:25 |
Eric Desrochers |
nominated for series |
|
Ubuntu Artful |
|
2017-10-11 15:49:25 |
Eric Desrochers |
bug task added |
|
lshw (Ubuntu Artful) |
|
2017-10-11 15:49:25 |
Eric Desrochers |
nominated for series |
|
Ubuntu Zesty |
|
2017-10-11 15:49:25 |
Eric Desrochers |
bug task added |
|
lshw (Ubuntu Zesty) |
|
2017-10-11 15:49:37 |
Eric Desrochers |
lshw (Ubuntu Zesty): status |
New |
Confirmed |
|
2017-10-11 15:49:39 |
Eric Desrochers |
lshw (Ubuntu Xenial): status |
New |
Confirmed |
|
2017-10-11 17:23:21 |
Eric Desrochers |
lshw (Ubuntu Artful): assignee |
Rafael David Tinoco (inaddy) |
Eric Desrochers (slashd) |
|
2017-10-11 17:33:05 |
Eric Desrochers |
lshw (Ubuntu Artful): status |
Confirmed |
In Progress |
|
2017-10-11 17:38:31 |
Rafael David Tinoco |
bug |
|
|
added subscriber Rafael David Tinoco |
2017-10-11 20:29:07 |
Dan Streetman |
nominated for series |
|
Ubuntu Trusty |
|
2017-10-11 20:29:13 |
Dan Streetman |
lshw (Ubuntu Xenial): assignee |
|
Dan Streetman (ddstreet) |
|
2017-10-11 20:29:16 |
Dan Streetman |
lshw (Ubuntu Zesty): assignee |
|
Dan Streetman (ddstreet) |
|
2017-10-11 20:29:21 |
Dan Streetman |
lshw (Ubuntu Zesty): importance |
Undecided |
Medium |
|
2017-10-11 20:29:26 |
Dan Streetman |
lshw (Ubuntu Xenial): importance |
Undecided |
Medium |
|
2017-10-11 20:31:12 |
Eric Desrochers |
bug task added |
|
lshw (Ubuntu Trusty) |
|
2017-10-11 20:31:21 |
Eric Desrochers |
lshw (Ubuntu Trusty): importance |
Undecided |
Medium |
|
2017-10-11 20:31:30 |
Eric Desrochers |
lshw (Ubuntu Trusty): assignee |
|
Dan Streetman (ddstreet) |
|
2017-10-11 20:31:36 |
Eric Desrochers |
lshw (Ubuntu Trusty): status |
New |
Confirmed |
|
2017-10-12 13:53:00 |
Eric Desrochers |
nominated for series |
|
Ubuntu Bb-series |
|
2017-10-12 13:53:00 |
Eric Desrochers |
bug task added |
|
lshw (Ubuntu Bb-series) |
|
2017-10-12 14:37:37 |
Eric Desrochers |
description |
When running lshw in a Xenial container, I'm getting a segmentation fault. I'll attach the apport crash dump.
```
stgraber@castiana:~$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
stgraber@castiana:~$ lxc exec priv bash
root@priv:~# lshw
Segmentation fault
root@priv:~#
```
[strace of lshw]
open("/usr/share/hwdata/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/lshw-common/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/usb/devices", O_RDONLY) = -1 EACCES (Permission denied)
open("/proc/bus/usb/devices", O_RDONLY) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault |
[Impact]
* lshw crashes with SEGV in privileged containers, unless you disable the 'usb' test: $ lshw -disable usb
[Test Case]
## Create a privileged container. ##
$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
## Execute lshw inside the privileged container. ##
$ lxc exec priv bash
root@priv:~#
root@priv:~#lshw
Segmentation fault
[Regression Potential]
* Risks of regression are low.
* I have tested lshw inside containers (unprivileges/privileges) and baremetal with success connecting different types of usb device : webcam, usb keys, ... The usb output of lshw cmd is shown as expected, but this time without segfaulting when container in privilege mode.
* Basically, the code look if both files doesn't exists
#define PROCBUSUSBDEVICES "/proc/bus/usb/devices"
#define SYSKERNELDEBUGUSBDEVICES "/sys/kernel/debug/usb/devices"
...
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
__return false;
I kept the above in place.
But what if only 1 of the 2 files exists ?
For that reason I added an extra verification if SYSKERNELDEBUGUSBDEVICES exist -> fopen SYSKERNELDEBUGUSBDEVICES.
and
if fopen SYSKERNELDEBUGUSBDEVICES fails and PROCBUSUSBDEVICES exist then -> fopen "PROCBUSUSBDEVICES"
The code first look for SYSKERNELDEBUGUSBDEVICES and if it fails it jump to PROCBUSUSBDEVICES.
But if PROCBUSUSBDEVICES fails there was no mechanism to skip, thus segfault.
I also added another if statement in case PROCBUSUSBDEVICES fails like in this situation (no such file or directory) in privileged container, same as if SYSKERNELDEBUGUSBDEVICES can't be opened to force to jump on trying PROCBUSUSBDEVICES.
[Other Info]
* Proposal made to lyonel/lshw (Lyonel Vincent being lshw maintainer) :
https://github.com/lyonel/lshw/pull/33
* I also sent Lyonel an email to poke him.
[Original Description]
When running lshw in a Xenial container, I'm getting a segmentation fault. I'll attach the apport crash dump.
```
stgraber@castiana:~$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
stgraber@castiana:~$ lxc exec priv bash
root@priv:~# lshw
Segmentation fault
root@priv:~#
```
[strace of lshw]
open("/usr/share/hwdata/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/lshw-common/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/usb/devices", O_RDONLY) = -1 EACCES (Permission denied)
open("/proc/bus/usb/devices", O_RDONLY) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault |
|
2017-10-13 12:52:40 |
Eric Desrochers |
bug task deleted |
lshw (Ubuntu Trusty) |
|
|
2017-10-13 12:55:13 |
Eric Desrochers |
description |
[Impact]
* lshw crashes with SEGV in privileged containers, unless you disable the 'usb' test: $ lshw -disable usb
[Test Case]
## Create a privileged container. ##
$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
## Execute lshw inside the privileged container. ##
$ lxc exec priv bash
root@priv:~#
root@priv:~#lshw
Segmentation fault
[Regression Potential]
* Risks of regression are low.
* I have tested lshw inside containers (unprivileges/privileges) and baremetal with success connecting different types of usb device : webcam, usb keys, ... The usb output of lshw cmd is shown as expected, but this time without segfaulting when container in privilege mode.
* Basically, the code look if both files doesn't exists
#define PROCBUSUSBDEVICES "/proc/bus/usb/devices"
#define SYSKERNELDEBUGUSBDEVICES "/sys/kernel/debug/usb/devices"
...
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
__return false;
I kept the above in place.
But what if only 1 of the 2 files exists ?
For that reason I added an extra verification if SYSKERNELDEBUGUSBDEVICES exist -> fopen SYSKERNELDEBUGUSBDEVICES.
and
if fopen SYSKERNELDEBUGUSBDEVICES fails and PROCBUSUSBDEVICES exist then -> fopen "PROCBUSUSBDEVICES"
The code first look for SYSKERNELDEBUGUSBDEVICES and if it fails it jump to PROCBUSUSBDEVICES.
But if PROCBUSUSBDEVICES fails there was no mechanism to skip, thus segfault.
I also added another if statement in case PROCBUSUSBDEVICES fails like in this situation (no such file or directory) in privileged container, same as if SYSKERNELDEBUGUSBDEVICES can't be opened to force to jump on trying PROCBUSUSBDEVICES.
[Other Info]
* Proposal made to lyonel/lshw (Lyonel Vincent being lshw maintainer) :
https://github.com/lyonel/lshw/pull/33
* I also sent Lyonel an email to poke him.
[Original Description]
When running lshw in a Xenial container, I'm getting a segmentation fault. I'll attach the apport crash dump.
```
stgraber@castiana:~$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
stgraber@castiana:~$ lxc exec priv bash
root@priv:~# lshw
Segmentation fault
root@priv:~#
```
[strace of lshw]
open("/usr/share/hwdata/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/lshw-common/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/usb/devices", O_RDONLY) = -1 EACCES (Permission denied)
open("/proc/bus/usb/devices", O_RDONLY) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault |
[Impact]
* lshw crashes with SEGV in privileged containers, unless you disable the 'usb' test: $ lshw -disable usb
[Test Case]
## Create a privileged container. ##
$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
## Execute lshw inside the privileged container. ##
$ lxc exec priv bash
root@priv:~#
root@priv:~#lshw
Segmentation fault
[Regression Potential]
* Risks of regression are low.
* I have tested lshw inside containers (unprivileges/privileges) and baremetal with success connecting different types of usb device : webcam, usb keys, ... The usb output of lshw cmd is shown as expected, but this time without segfaulting when container in privilege mode.
* Basically, the code look if both files doesn't exists
#define PROCBUSUSBDEVICES "/proc/bus/usb/devices"
#define SYSKERNELDEBUGUSBDEVICES "/sys/kernel/debug/usb/devices"
...
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
__return false;
I kept the above in place.
But what if only 1 of the 2 files exists ?
For that reason I added an extra verification if SYSKERNELDEBUGUSBDEVICES exist -> fopen SYSKERNELDEBUGUSBDEVICES.
and
if fopen SYSKERNELDEBUGUSBDEVICES fails and PROCBUSUSBDEVICES exist then -> fopen "PROCBUSUSBDEVICES"
The code first look for SYSKERNELDEBUGUSBDEVICES and if it fails it jump to PROCBUSUSBDEVICES.
But if PROCBUSUSBDEVICES fails there was no mechanism to skip, thus segfault.
I also added another if statement in case PROCBUSUSBDEVICES fails like in this situation (no such file or directory) in privileged container, same as if SYSKERNELDEBUGUSBDEVICES can't be opened to force to jump on trying PROCBUSUSBDEVICES.
[Other Info]
* Proposal made to lyonel/lshw (Lyonel Vincent being lshw maintainer) :
https://github.com/lyonel/lshw/pull/33
* I also sent Lyonel an email to poke him.
* This bug doesn't affect Trusty in privileged container.
Only Xenial and late after some upstream code change.
[Original Description]
When running lshw in a Xenial container, I'm getting a segmentation fault. I'll attach the apport crash dump.
```
stgraber@castiana:~$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
stgraber@castiana:~$ lxc exec priv bash
root@priv:~# lshw
Segmentation fault
root@priv:~#
```
[strace of lshw]
open("/usr/share/hwdata/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/lshw-common/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/usb/devices", O_RDONLY) = -1 EACCES (Permission denied)
open("/proc/bus/usb/devices", O_RDONLY) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault |
|
2017-10-13 14:34:01 |
Eric Desrochers |
description |
[Impact]
* lshw crashes with SEGV in privileged containers, unless you disable the 'usb' test: $ lshw -disable usb
[Test Case]
## Create a privileged container. ##
$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
## Execute lshw inside the privileged container. ##
$ lxc exec priv bash
root@priv:~#
root@priv:~#lshw
Segmentation fault
[Regression Potential]
* Risks of regression are low.
* I have tested lshw inside containers (unprivileges/privileges) and baremetal with success connecting different types of usb device : webcam, usb keys, ... The usb output of lshw cmd is shown as expected, but this time without segfaulting when container in privilege mode.
* Basically, the code look if both files doesn't exists
#define PROCBUSUSBDEVICES "/proc/bus/usb/devices"
#define SYSKERNELDEBUGUSBDEVICES "/sys/kernel/debug/usb/devices"
...
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
__return false;
I kept the above in place.
But what if only 1 of the 2 files exists ?
For that reason I added an extra verification if SYSKERNELDEBUGUSBDEVICES exist -> fopen SYSKERNELDEBUGUSBDEVICES.
and
if fopen SYSKERNELDEBUGUSBDEVICES fails and PROCBUSUSBDEVICES exist then -> fopen "PROCBUSUSBDEVICES"
The code first look for SYSKERNELDEBUGUSBDEVICES and if it fails it jump to PROCBUSUSBDEVICES.
But if PROCBUSUSBDEVICES fails there was no mechanism to skip, thus segfault.
I also added another if statement in case PROCBUSUSBDEVICES fails like in this situation (no such file or directory) in privileged container, same as if SYSKERNELDEBUGUSBDEVICES can't be opened to force to jump on trying PROCBUSUSBDEVICES.
[Other Info]
* Proposal made to lyonel/lshw (Lyonel Vincent being lshw maintainer) :
https://github.com/lyonel/lshw/pull/33
* I also sent Lyonel an email to poke him.
* This bug doesn't affect Trusty in privileged container.
Only Xenial and late after some upstream code change.
[Original Description]
When running lshw in a Xenial container, I'm getting a segmentation fault. I'll attach the apport crash dump.
```
stgraber@castiana:~$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
stgraber@castiana:~$ lxc exec priv bash
root@priv:~# lshw
Segmentation fault
root@priv:~#
```
[strace of lshw]
open("/usr/share/hwdata/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/lshw-common/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/usb/devices", O_RDONLY) = -1 EACCES (Permission denied)
open("/proc/bus/usb/devices", O_RDONLY) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault |
[Impact]
* lshw crashes with SEGV in privileged containers, unless you disable the 'usb' test: $ lshw -disable usb
[Test Case]
## Create a privileged container. ##
$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
## Execute lshw inside the privileged container. ##
$ lxc exec priv bash
root@priv:~#
root@priv:~#lshw
Segmentation fault
[Regression Potential]
* Risks of regression are low.
* I have tested lshw inside containers (unprivileges/privileges) and baremetal with success connecting different types of usb device : webcam, usb keys, ... The usb output of lshw cmd is shown as expected, but this time without segfaulting when container in privilege mode.
* Basically, the code look if both files doesn't exists
#define PROCBUSUSBDEVICES "/proc/bus/usb/devices"
#define SYSKERNELDEBUGUSBDEVICES "/sys/kernel/debug/usb/devices"
...
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
__return false;
I kept the above in place.
But what if only 1 of the 2 files exists ?
For that reason I added an extra verification if SYSKERNELDEBUGUSBDEVICES exist -> fopen SYSKERNELDEBUGUSBDEVICES.
and
if fopen SYSKERNELDEBUGUSBDEVICES fails and PROCBUSUSBDEVICES exist then -> fopen "PROCBUSUSBDEVICES"
The code first look for SYSKERNELDEBUGUSBDEVICES and if it fails it jump to PROCBUSUSBDEVICES.
But if PROCBUSUSBDEVICES fails there was no mechanism to skip, thus segfault.
I also added another if statement in case PROCBUSUSBDEVICES fails like in this situation (no such file or directory) in privileged container, same as if SYSKERNELDEBUGUSBDEVICES can't be opened to force to jump on trying PROCBUSUSBDEVICES.
[Other Info]
* Proposal made to lyonel/lshw (Lyonel Vincent being lshw maintainer) :
https://github.com/lyonel/lshw/pull/33
and on lshw primary dev site:
https://ezix.org/src/pkg/lshw/pulls/9
* I also sent Lyonel an email to poke him.
* This bug doesn't affect Trusty in privileged container.
Only Xenial and late after some upstream code change.
[Original Description]
When running lshw in a Xenial container, I'm getting a segmentation fault. I'll attach the apport crash dump.
```
stgraber@castiana:~$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
stgraber@castiana:~$ lxc exec priv bash
root@priv:~# lshw
Segmentation fault
root@priv:~#
```
[strace of lshw]
open("/usr/share/hwdata/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/lshw-common/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/usb/devices", O_RDONLY) = -1 EACCES (Permission denied)
open("/proc/bus/usb/devices", O_RDONLY) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault |
|
2017-10-13 16:03:33 |
Eric Desrochers |
lshw (Ubuntu Bb-series): assignee |
|
Eric Desrochers (slashd) |
|
2017-10-13 16:03:42 |
Eric Desrochers |
lshw (Ubuntu Artful): assignee |
Eric Desrochers (slashd) |
Dan Streetman (ddstreet) |
|
2017-10-13 16:03:46 |
Eric Desrochers |
lshw (Ubuntu Bb-series): status |
New |
Confirmed |
|
2017-10-13 16:03:49 |
Eric Desrochers |
lshw (Ubuntu Artful): status |
In Progress |
Confirmed |
|
2017-10-13 16:03:52 |
Eric Desrochers |
lshw (Ubuntu Bb-series): importance |
Undecided |
Medium |
|
2017-10-13 17:48:37 |
Eric Desrochers |
lshw (Ubuntu Bb-series): status |
Confirmed |
In Progress |
|
2017-10-16 12:56:11 |
Eric Desrochers |
description |
[Impact]
* lshw crashes with SEGV in privileged containers, unless you disable the 'usb' test: $ lshw -disable usb
[Test Case]
## Create a privileged container. ##
$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
## Execute lshw inside the privileged container. ##
$ lxc exec priv bash
root@priv:~#
root@priv:~#lshw
Segmentation fault
[Regression Potential]
* Risks of regression are low.
* I have tested lshw inside containers (unprivileges/privileges) and baremetal with success connecting different types of usb device : webcam, usb keys, ... The usb output of lshw cmd is shown as expected, but this time without segfaulting when container in privilege mode.
* Basically, the code look if both files doesn't exists
#define PROCBUSUSBDEVICES "/proc/bus/usb/devices"
#define SYSKERNELDEBUGUSBDEVICES "/sys/kernel/debug/usb/devices"
...
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
__return false;
I kept the above in place.
But what if only 1 of the 2 files exists ?
For that reason I added an extra verification if SYSKERNELDEBUGUSBDEVICES exist -> fopen SYSKERNELDEBUGUSBDEVICES.
and
if fopen SYSKERNELDEBUGUSBDEVICES fails and PROCBUSUSBDEVICES exist then -> fopen "PROCBUSUSBDEVICES"
The code first look for SYSKERNELDEBUGUSBDEVICES and if it fails it jump to PROCBUSUSBDEVICES.
But if PROCBUSUSBDEVICES fails there was no mechanism to skip, thus segfault.
I also added another if statement in case PROCBUSUSBDEVICES fails like in this situation (no such file or directory) in privileged container, same as if SYSKERNELDEBUGUSBDEVICES can't be opened to force to jump on trying PROCBUSUSBDEVICES.
[Other Info]
* Proposal made to lyonel/lshw (Lyonel Vincent being lshw maintainer) :
https://github.com/lyonel/lshw/pull/33
and on lshw primary dev site:
https://ezix.org/src/pkg/lshw/pulls/9
* I also sent Lyonel an email to poke him.
* This bug doesn't affect Trusty in privileged container.
Only Xenial and late after some upstream code change.
[Original Description]
When running lshw in a Xenial container, I'm getting a segmentation fault. I'll attach the apport crash dump.
```
stgraber@castiana:~$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
stgraber@castiana:~$ lxc exec priv bash
root@priv:~# lshw
Segmentation fault
root@priv:~#
```
[strace of lshw]
open("/usr/share/hwdata/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/lshw-common/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/usb/devices", O_RDONLY) = -1 EACCES (Permission denied)
open("/proc/bus/usb/devices", O_RDONLY) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault |
[Impact]
* lshw crashes with SEGV in privileged containers, unless you disable the 'usb' test: $ lshw -disable usb
[Test Case]
## Create a privileged container. ##
$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
## Execute lshw inside the privileged container. ##
$ lxc exec priv bash
root@priv:~#
root@priv:~#lshw
Segmentation fault
[Regression Potential]
* Risks of regression are low.
* I have tested lshw inside containers (unprivileges/privileges) and baremetal with success connecting different types of usb device : webcam, usb keys, ... The usb output of lshw cmd is shown as expected, but this time without segfaulting when container in privilege mode.
* Basically, the code look if both files doesn't exists
#define PROCBUSUSBDEVICES "/proc/bus/usb/devices"
#define SYSKERNELDEBUGUSBDEVICES "/sys/kernel/debug/usb/devices"
...
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
__return false;
I kept the above in place.
But what if only 1 of the 2 files exists ?
For that reason I added an extra verification if SYSKERNELDEBUGUSBDEVICES exist -> fopen SYSKERNELDEBUGUSBDEVICES.
and
if fopen SYSKERNELDEBUGUSBDEVICES fails and PROCBUSUSBDEVICES exist then -> fopen "PROCBUSUSBDEVICES"
The code first look for SYSKERNELDEBUGUSBDEVICES and if it fails it jump to PROCBUSUSBDEVICES.
But if PROCBUSUSBDEVICES fails there was no mechanism to skip, thus segfault.
I also added another if statement in case PROCBUSUSBDEVICES fails like in this situation (no such file or directory) in privileged container, same as if SYSKERNELDEBUGUSBDEVICES can't be opened to force to jump on trying PROCBUSUSBDEVICES.
[Other Info]
* Proposal made to lyonel/lshw (Lyonel Vincent being lshw maintainer) :
https://github.com/lyonel/lshw/pull/33
and on lshw primary dev site:
https://ezix.org/src/pkg/lshw/pulls/9
* I also sent Lyonel an email to poke him.
* This bug doesn't affect Trusty in privileged container. (The code is a bit different in Trusty/lshw package. It basically doesn't rely on SYSKERNELDEBUGUSBDEVICES, meaning that it is only validating if PROCBUSUSBDEVICES exist or not and react accordingly).
* Only affect Xenial and late.
* The bug has been introduced upstream after this specific commit :
https://ezix.org/src/pkg/lshw/commit/9f05be36f7ce6117731e312053d1ec91348a3051
[Original Description]
When running lshw in a Xenial container, I'm getting a segmentation fault. I'll attach the apport crash dump.
```
stgraber@castiana:~$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
stgraber@castiana:~$ lxc exec priv bash
root@priv:~# lshw
Segmentation fault
root@priv:~#
```
[strace of lshw]
open("/usr/share/hwdata/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/lshw-common/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/usb/devices", O_RDONLY) = -1 EACCES (Permission denied)
open("/proc/bus/usb/devices", O_RDONLY) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault |
|
2017-10-16 16:22:51 |
Eric Desrochers |
description |
[Impact]
* lshw crashes with SEGV in privileged containers, unless you disable the 'usb' test: $ lshw -disable usb
[Test Case]
## Create a privileged container. ##
$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
## Execute lshw inside the privileged container. ##
$ lxc exec priv bash
root@priv:~#
root@priv:~#lshw
Segmentation fault
[Regression Potential]
* Risks of regression are low.
* I have tested lshw inside containers (unprivileges/privileges) and baremetal with success connecting different types of usb device : webcam, usb keys, ... The usb output of lshw cmd is shown as expected, but this time without segfaulting when container in privilege mode.
* Basically, the code look if both files doesn't exists
#define PROCBUSUSBDEVICES "/proc/bus/usb/devices"
#define SYSKERNELDEBUGUSBDEVICES "/sys/kernel/debug/usb/devices"
...
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
__return false;
I kept the above in place.
But what if only 1 of the 2 files exists ?
For that reason I added an extra verification if SYSKERNELDEBUGUSBDEVICES exist -> fopen SYSKERNELDEBUGUSBDEVICES.
and
if fopen SYSKERNELDEBUGUSBDEVICES fails and PROCBUSUSBDEVICES exist then -> fopen "PROCBUSUSBDEVICES"
The code first look for SYSKERNELDEBUGUSBDEVICES and if it fails it jump to PROCBUSUSBDEVICES.
But if PROCBUSUSBDEVICES fails there was no mechanism to skip, thus segfault.
I also added another if statement in case PROCBUSUSBDEVICES fails like in this situation (no such file or directory) in privileged container, same as if SYSKERNELDEBUGUSBDEVICES can't be opened to force to jump on trying PROCBUSUSBDEVICES.
[Other Info]
* Proposal made to lyonel/lshw (Lyonel Vincent being lshw maintainer) :
https://github.com/lyonel/lshw/pull/33
and on lshw primary dev site:
https://ezix.org/src/pkg/lshw/pulls/9
* I also sent Lyonel an email to poke him.
* This bug doesn't affect Trusty in privileged container. (The code is a bit different in Trusty/lshw package. It basically doesn't rely on SYSKERNELDEBUGUSBDEVICES, meaning that it is only validating if PROCBUSUSBDEVICES exist or not and react accordingly).
* Only affect Xenial and late.
* The bug has been introduced upstream after this specific commit :
https://ezix.org/src/pkg/lshw/commit/9f05be36f7ce6117731e312053d1ec91348a3051
[Original Description]
When running lshw in a Xenial container, I'm getting a segmentation fault. I'll attach the apport crash dump.
```
stgraber@castiana:~$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
stgraber@castiana:~$ lxc exec priv bash
root@priv:~# lshw
Segmentation fault
root@priv:~#
```
[strace of lshw]
open("/usr/share/hwdata/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/lshw-common/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/usb/devices", O_RDONLY) = -1 EACCES (Permission denied)
open("/proc/bus/usb/devices", O_RDONLY) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault |
[Impact]
* lshw crashes with SEGV in privileged containers, unless you disable the 'usb' test: $ lshw -disable usb
[Test Case]
## Create a privileged container. ##
$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
## Execute lshw inside the privileged container. ##
$ lxc exec priv bash
root@priv:~#
root@priv:~#lshw
Segmentation fault
[Regression Potential]
* Risks of regression are low.
* I have tested lshw inside containers (unprivileges/privileges) and baremetal with success connecting different types of usb device : webcam, usb keys, ... The usb output of lshw cmd is shown as expected, but this time without segfaulting when container in privilege mode.
* Basically, the code look if both files doesn't exists
#define PROCBUSUSBDEVICES "/proc/bus/usb/devices"
#define SYSKERNELDEBUGUSBDEVICES "/sys/kernel/debug/usb/devices"
...
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
__return false;
I kept the above in place.
But what if only 1 of the 2 files exists ?
For that reason I added an extra verification if SYSKERNELDEBUGUSBDEVICES exist -> fopen SYSKERNELDEBUGUSBDEVICES.
and
if fopen SYSKERNELDEBUGUSBDEVICES fails and PROCBUSUSBDEVICES exist then -> fopen "PROCBUSUSBDEVICES"
The code first look for SYSKERNELDEBUGUSBDEVICES and if it fails it jump to PROCBUSUSBDEVICES.
But if PROCBUSUSBDEVICES fails there was no mechanism to skip, thus segfault.
I also added another if statement in case PROCBUSUSBDEVICES fails like in this situation (no such file or directory) in privileged container, same as if SYSKERNELDEBUGUSBDEVICES can't be opened to force to jump on trying PROCBUSUSBDEVICES.
[Other Info]
* Proposal made to lyonel/lshw (Lyonel Vincent being lshw maintainer) :
https://github.com/lyonel/lshw/pull/33
and on lshw primary dev site:
https://ezix.org/src/pkg/lshw/pulls/9
* I also sent Lyonel an email to poke him.
* This bug doesn't affect Trusty in privileged container. (The code is a bit different in Trusty/lshw package. It basically doesn't rely on SYSKERNELDEBUGUSBDEVICES, meaning that it is only validating if PROCBUSUSBDEVICES exist or not and react accordingly).
* Only affect Xenial and late.
* The bug has been introduced upstream after this specific commit :
https://ezix.org/src/pkg/lshw/commit/9f05be36f7ce6117731e312053d1ec91348a3051
* This particular bug isn't reproducible in Debian (tested with sid in privileged mode) container image because both files doesn't exist in their image, thus making the lshw stop here :
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
return false;
With that being said, I filed a debian bug anyway mentioning that it would be great for them to merge the upstream PR since Ubuntu is merging/syncing from them, and it won't hurt debian, if they change their image behavior one day. Even if not necessary fixing an actual debian/lshw bug.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=878792
[Original Description]
When running lshw in a Xenial container, I'm getting a segmentation fault. I'll attach the apport crash dump.
```
stgraber@castiana:~$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
stgraber@castiana:~$ lxc exec priv bash
root@priv:~# lshw
Segmentation fault
root@priv:~#
```
[strace of lshw]
open("/usr/share/hwdata/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/lshw-common/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/usb/devices", O_RDONLY) = -1 EACCES (Permission denied)
open("/proc/bus/usb/devices", O_RDONLY) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault |
|
2017-10-16 16:24:05 |
Eric Desrochers |
description |
[Impact]
* lshw crashes with SEGV in privileged containers, unless you disable the 'usb' test: $ lshw -disable usb
[Test Case]
## Create a privileged container. ##
$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
## Execute lshw inside the privileged container. ##
$ lxc exec priv bash
root@priv:~#
root@priv:~#lshw
Segmentation fault
[Regression Potential]
* Risks of regression are low.
* I have tested lshw inside containers (unprivileges/privileges) and baremetal with success connecting different types of usb device : webcam, usb keys, ... The usb output of lshw cmd is shown as expected, but this time without segfaulting when container in privilege mode.
* Basically, the code look if both files doesn't exists
#define PROCBUSUSBDEVICES "/proc/bus/usb/devices"
#define SYSKERNELDEBUGUSBDEVICES "/sys/kernel/debug/usb/devices"
...
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
__return false;
I kept the above in place.
But what if only 1 of the 2 files exists ?
For that reason I added an extra verification if SYSKERNELDEBUGUSBDEVICES exist -> fopen SYSKERNELDEBUGUSBDEVICES.
and
if fopen SYSKERNELDEBUGUSBDEVICES fails and PROCBUSUSBDEVICES exist then -> fopen "PROCBUSUSBDEVICES"
The code first look for SYSKERNELDEBUGUSBDEVICES and if it fails it jump to PROCBUSUSBDEVICES.
But if PROCBUSUSBDEVICES fails there was no mechanism to skip, thus segfault.
I also added another if statement in case PROCBUSUSBDEVICES fails like in this situation (no such file or directory) in privileged container, same as if SYSKERNELDEBUGUSBDEVICES can't be opened to force to jump on trying PROCBUSUSBDEVICES.
[Other Info]
* Proposal made to lyonel/lshw (Lyonel Vincent being lshw maintainer) :
https://github.com/lyonel/lshw/pull/33
and on lshw primary dev site:
https://ezix.org/src/pkg/lshw/pulls/9
* I also sent Lyonel an email to poke him.
* This bug doesn't affect Trusty in privileged container. (The code is a bit different in Trusty/lshw package. It basically doesn't rely on SYSKERNELDEBUGUSBDEVICES, meaning that it is only validating if PROCBUSUSBDEVICES exist or not and react accordingly).
* Only affect Xenial and late.
* The bug has been introduced upstream after this specific commit :
https://ezix.org/src/pkg/lshw/commit/9f05be36f7ce6117731e312053d1ec91348a3051
* This particular bug isn't reproducible in Debian (tested with sid in privileged mode) container image because both files doesn't exist in their image, thus making the lshw stop here :
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
return false;
With that being said, I filed a debian bug anyway mentioning that it would be great for them to merge the upstream PR since Ubuntu is merging/syncing from them, and it won't hurt debian, if they change their image behavior one day. Even if not necessary fixing an actual debian/lshw bug.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=878792
[Original Description]
When running lshw in a Xenial container, I'm getting a segmentation fault. I'll attach the apport crash dump.
```
stgraber@castiana:~$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
stgraber@castiana:~$ lxc exec priv bash
root@priv:~# lshw
Segmentation fault
root@priv:~#
```
[strace of lshw]
open("/usr/share/hwdata/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/lshw-common/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/usb/devices", O_RDONLY) = -1 EACCES (Permission denied)
open("/proc/bus/usb/devices", O_RDONLY) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault |
[Impact]
* lshw crashes with SEGV in privileged containers, unless you disable the 'usb' test: $ lshw -disable usb
[Test Case]
## Create a privileged container. ##
$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
## Execute lshw inside the privileged container. ##
$ lxc exec priv bash
root@priv:~#
root@priv:~#lshw
Segmentation fault
[Regression Potential]
* Risks of regression are low.
* I have tested lshw inside containers (unprivileges/privileges) and baremetal with success connecting different types of usb device : webcam, usb keys, ... The usb output of lshw cmd is shown as expected, but this time without segfaulting when container in privilege mode.
* Basically, the code look if both files doesn't exists
#define PROCBUSUSBDEVICES "/proc/bus/usb/devices"
#define SYSKERNELDEBUGUSBDEVICES "/sys/kernel/debug/usb/devices"
...
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
__return false;
I kept the above in place.
But what if only 1 of the 2 files exists ?
For that reason I added an extra verification if SYSKERNELDEBUGUSBDEVICES exist -> fopen SYSKERNELDEBUGUSBDEVICES.
and
if fopen SYSKERNELDEBUGUSBDEVICES fails and PROCBUSUSBDEVICES exist then -> fopen "PROCBUSUSBDEVICES"
The code first look for SYSKERNELDEBUGUSBDEVICES and if it fails it jump to PROCBUSUSBDEVICES.
But if PROCBUSUSBDEVICES fails there was no mechanism to skip, thus segfault.
I also added another if statement in case PROCBUSUSBDEVICES fails like in this situation (no such file or directory) in privileged container, same as if SYSKERNELDEBUGUSBDEVICES can't be opened to force to jump on trying PROCBUSUSBDEVICES.
[Other Info]
* Proposal made to lyonel/lshw (Lyonel Vincent being lshw maintainer) :
https://github.com/lyonel/lshw/pull/33
and on lshw primary dev site:
https://ezix.org/src/pkg/lshw/pulls/9
* I also sent Lyonel an email to poke him.
* This bug doesn't affect Trusty in privileged container. (The code is a bit different in Trusty/lshw package. It basically doesn't rely on SYSKERNELDEBUGUSBDEVICES, meaning that it is only validating if PROCBUSUSBDEVICES exist or not and react accordingly).
* Only affect Xenial and late.
* The bug has been introduced upstream after this specific commit :
https://ezix.org/src/pkg/lshw/commit/9f05be36f7ce6117731e312053d1ec91348a3051
* This particular bug isn't reproducible in Debian (tested with sid in privileged mode) container image because both files doesn't exist in their image, thus making the lshw stop here :
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
return false;
With that being said, I filed a debian bug anyway mentioning that it would be great for them to merge the upstream PR since Ubuntu is merging/syncing from them, and it won't hurt debian lshw package, if they change or not their image behavior one day. Even if not necessary fixing an actual debian/lshw bug.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=878792
[Original Description]
When running lshw in a Xenial container, I'm getting a segmentation fault. I'll attach the apport crash dump.
```
stgraber@castiana:~$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
stgraber@castiana:~$ lxc exec priv bash
root@priv:~# lshw
Segmentation fault
root@priv:~#
```
[strace of lshw]
open("/usr/share/hwdata/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/lshw-common/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/usb/devices", O_RDONLY) = -1 EACCES (Permission denied)
open("/proc/bus/usb/devices", O_RDONLY) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault |
|
2017-10-16 16:27:40 |
Eric Desrochers |
bug watch added |
|
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=878792 |
|
2017-10-16 16:27:40 |
Eric Desrochers |
bug task added |
|
lshw (Debian) |
|
2017-10-17 03:07:55 |
Eric Desrochers |
description |
[Impact]
* lshw crashes with SEGV in privileged containers, unless you disable the 'usb' test: $ lshw -disable usb
[Test Case]
## Create a privileged container. ##
$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
## Execute lshw inside the privileged container. ##
$ lxc exec priv bash
root@priv:~#
root@priv:~#lshw
Segmentation fault
[Regression Potential]
* Risks of regression are low.
* I have tested lshw inside containers (unprivileges/privileges) and baremetal with success connecting different types of usb device : webcam, usb keys, ... The usb output of lshw cmd is shown as expected, but this time without segfaulting when container in privilege mode.
* Basically, the code look if both files doesn't exists
#define PROCBUSUSBDEVICES "/proc/bus/usb/devices"
#define SYSKERNELDEBUGUSBDEVICES "/sys/kernel/debug/usb/devices"
...
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
__return false;
I kept the above in place.
But what if only 1 of the 2 files exists ?
For that reason I added an extra verification if SYSKERNELDEBUGUSBDEVICES exist -> fopen SYSKERNELDEBUGUSBDEVICES.
and
if fopen SYSKERNELDEBUGUSBDEVICES fails and PROCBUSUSBDEVICES exist then -> fopen "PROCBUSUSBDEVICES"
The code first look for SYSKERNELDEBUGUSBDEVICES and if it fails it jump to PROCBUSUSBDEVICES.
But if PROCBUSUSBDEVICES fails there was no mechanism to skip, thus segfault.
I also added another if statement in case PROCBUSUSBDEVICES fails like in this situation (no such file or directory) in privileged container, same as if SYSKERNELDEBUGUSBDEVICES can't be opened to force to jump on trying PROCBUSUSBDEVICES.
[Other Info]
* Proposal made to lyonel/lshw (Lyonel Vincent being lshw maintainer) :
https://github.com/lyonel/lshw/pull/33
and on lshw primary dev site:
https://ezix.org/src/pkg/lshw/pulls/9
* I also sent Lyonel an email to poke him.
* This bug doesn't affect Trusty in privileged container. (The code is a bit different in Trusty/lshw package. It basically doesn't rely on SYSKERNELDEBUGUSBDEVICES, meaning that it is only validating if PROCBUSUSBDEVICES exist or not and react accordingly).
* Only affect Xenial and late.
* The bug has been introduced upstream after this specific commit :
https://ezix.org/src/pkg/lshw/commit/9f05be36f7ce6117731e312053d1ec91348a3051
* This particular bug isn't reproducible in Debian (tested with sid in privileged mode) container image because both files doesn't exist in their image, thus making the lshw stop here :
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
return false;
With that being said, I filed a debian bug anyway mentioning that it would be great for them to merge the upstream PR since Ubuntu is merging/syncing from them, and it won't hurt debian lshw package, if they change or not their image behavior one day. Even if not necessary fixing an actual debian/lshw bug.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=878792
[Original Description]
When running lshw in a Xenial container, I'm getting a segmentation fault. I'll attach the apport crash dump.
```
stgraber@castiana:~$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
stgraber@castiana:~$ lxc exec priv bash
root@priv:~# lshw
Segmentation fault
root@priv:~#
```
[strace of lshw]
open("/usr/share/hwdata/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/lshw-common/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/usb/devices", O_RDONLY) = -1 EACCES (Permission denied)
open("/proc/bus/usb/devices", O_RDONLY) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault |
[Impact]
* lshw crashes with SEGV in privileged containers, unless you disable the 'usb' test: $ lshw -disable usb
[Test Case]
## Create a privileged container. ##
$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
## Execute lshw inside the privileged container. ##
$ lxc exec priv bash
root@priv:~#
root@priv:~#lshw
Segmentation fault
[Regression Potential]
* Risks of regression are low.
* I have tested lshw inside containers (unprivileges/privileges) and baremetal with success connecting different types of usb device : webcam, usb keys, ... The usb output of lshw cmd is shown as expected, but this time without segfaulting when container in privilege mode.
* Basically, the code look if both files doesn't exists
#define PROCBUSUSBDEVICES "/proc/bus/usb/devices"
#define SYSKERNELDEBUGUSBDEVICES "/sys/kernel/debug/usb/devices"
...
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
__return false;
I kept the above in place.
But what if only 1 of the 2 files exists ?
For that reason I added an extra verification if SYSKERNELDEBUGUSBDEVICES exist -> fopen SYSKERNELDEBUGUSBDEVICES.
and
if fopen SYSKERNELDEBUGUSBDEVICES fails and PROCBUSUSBDEVICES exist then -> fopen "PROCBUSUSBDEVICES"
The code first look for SYSKERNELDEBUGUSBDEVICES and if it fails it jump to PROCBUSUSBDEVICES.
But if PROCBUSUSBDEVICES fails there was no mechanism to skip, thus segfault.
I also added another if statement in case PROCBUSUSBDEVICES fails like in this situation (no such file or directory) in privileged container, same as if SYSKERNELDEBUGUSBDEVICES can't be opened to force to jump on trying PROCBUSUSBDEVICES.
[Other Info]
* Upstream Commit:
https://ezix.org/src/pkg/lshw/commit/7b99d35064230f908551ba65c29264d90f49f246
* This bug doesn't affect Trusty in privileged container. (The code is a bit different in Trusty/lshw package. It basically doesn't rely on SYSKERNELDEBUGUSBDEVICES, meaning that it is only validating if PROCBUSUSBDEVICES exist or not and react accordingly).
* Only affect Xenial and late.
* The bug has been introduced upstream after this specific commit :
https://ezix.org/src/pkg/lshw/commit/9f05be36f7ce6117731e312053d1ec91348a3051
* This particular bug isn't reproducible in Debian (tested with sid in privileged mode) container image because both files doesn't exist in their image, thus making the lshw stop here :
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
return false;
With that being said, I filed a debian bug anyway mentioning that it would be great for them to merge the upstream PR since Ubuntu is merging/syncing from them, and it won't hurt debian lshw package, if they change or not their image behavior one day. Even if not necessary fixing an actual debian/lshw bug.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=878792
[Original Description]
When running lshw in a Xenial container, I'm getting a segmentation fault. I'll attach the apport crash dump.
```
stgraber@castiana:~$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
stgraber@castiana:~$ lxc exec priv bash
root@priv:~# lshw
Segmentation fault
root@priv:~#
```
[strace of lshw]
open("/usr/share/hwdata/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/lshw-common/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/usb/devices", O_RDONLY) = -1 EACCES (Permission denied)
open("/proc/bus/usb/devices", O_RDONLY) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault |
|
2017-10-17 03:11:49 |
Eric Desrochers |
tags |
foundations-engine |
foundations-engine sts-sru-needed |
|
2017-10-17 03:23:32 |
Eric Desrochers |
description |
[Impact]
* lshw crashes with SEGV in privileged containers, unless you disable the 'usb' test: $ lshw -disable usb
[Test Case]
## Create a privileged container. ##
$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
## Execute lshw inside the privileged container. ##
$ lxc exec priv bash
root@priv:~#
root@priv:~#lshw
Segmentation fault
[Regression Potential]
* Risks of regression are low.
* I have tested lshw inside containers (unprivileges/privileges) and baremetal with success connecting different types of usb device : webcam, usb keys, ... The usb output of lshw cmd is shown as expected, but this time without segfaulting when container in privilege mode.
* Basically, the code look if both files doesn't exists
#define PROCBUSUSBDEVICES "/proc/bus/usb/devices"
#define SYSKERNELDEBUGUSBDEVICES "/sys/kernel/debug/usb/devices"
...
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
__return false;
I kept the above in place.
But what if only 1 of the 2 files exists ?
For that reason I added an extra verification if SYSKERNELDEBUGUSBDEVICES exist -> fopen SYSKERNELDEBUGUSBDEVICES.
and
if fopen SYSKERNELDEBUGUSBDEVICES fails and PROCBUSUSBDEVICES exist then -> fopen "PROCBUSUSBDEVICES"
The code first look for SYSKERNELDEBUGUSBDEVICES and if it fails it jump to PROCBUSUSBDEVICES.
But if PROCBUSUSBDEVICES fails there was no mechanism to skip, thus segfault.
I also added another if statement in case PROCBUSUSBDEVICES fails like in this situation (no such file or directory) in privileged container, same as if SYSKERNELDEBUGUSBDEVICES can't be opened to force to jump on trying PROCBUSUSBDEVICES.
[Other Info]
* Upstream Commit:
https://ezix.org/src/pkg/lshw/commit/7b99d35064230f908551ba65c29264d90f49f246
* This bug doesn't affect Trusty in privileged container. (The code is a bit different in Trusty/lshw package. It basically doesn't rely on SYSKERNELDEBUGUSBDEVICES, meaning that it is only validating if PROCBUSUSBDEVICES exist or not and react accordingly).
* Only affect Xenial and late.
* The bug has been introduced upstream after this specific commit :
https://ezix.org/src/pkg/lshw/commit/9f05be36f7ce6117731e312053d1ec91348a3051
* This particular bug isn't reproducible in Debian (tested with sid in privileged mode) container image because both files doesn't exist in their image, thus making the lshw stop here :
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
return false;
With that being said, I filed a debian bug anyway mentioning that it would be great for them to merge the upstream PR since Ubuntu is merging/syncing from them, and it won't hurt debian lshw package, if they change or not their image behavior one day. Even if not necessary fixing an actual debian/lshw bug.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=878792
[Original Description]
When running lshw in a Xenial container, I'm getting a segmentation fault. I'll attach the apport crash dump.
```
stgraber@castiana:~$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
stgraber@castiana:~$ lxc exec priv bash
root@priv:~# lshw
Segmentation fault
root@priv:~#
```
[strace of lshw]
open("/usr/share/hwdata/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/lshw-common/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/usb/devices", O_RDONLY) = -1 EACCES (Permission denied)
open("/proc/bus/usb/devices", O_RDONLY) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault |
[Impact]
* lshw crashes with SEGV in privileged containers, unless you disable the 'usb' test: $ lshw -disable usb
[Test Case]
## Create a privileged container. ##
$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
## Execute lshw inside the privileged container. ##
$ lxc exec priv bash
root@priv:~#
root@priv:~#lshw
Segmentation fault
[Regression Potential]
* Risks of regression are low.
* I have tested lshw inside containers (unprivileges/privileges) and baremetal with success connecting different types of usb device : webcam, usb keys, ... The usb output of lshw cmd is shown as expected, but this time without segfaulting when container in privilege mode.
* Basically, the code look if both files doesn't exists
#define PROCBUSUSBDEVICES "/proc/bus/usb/devices"
#define SYSKERNELDEBUGUSBDEVICES "/sys/kernel/debug/usb/devices"
...
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
__return false;
I kept the above in place.
But what if only 1 of the 2 files exists ?
For that reason I added an extra verification if SYSKERNELDEBUGUSBDEVICES exist -> fopen SYSKERNELDEBUGUSBDEVICES.
and
if fopen SYSKERNELDEBUGUSBDEVICES fails and PROCBUSUSBDEVICES exist then -> fopen "PROCBUSUSBDEVICES"
The code first look for SYSKERNELDEBUGUSBDEVICES and if it fails it jump to PROCBUSUSBDEVICES.
But if PROCBUSUSBDEVICES fails there was no mechanism to skip, thus segfault.
I also added another if statement in case PROCBUSUSBDEVICES fails like in this situation (no such file or directory) in privileged container, same as if SYSKERNELDEBUGUSBDEVICES can't be opened to force to jump on trying PROCBUSUSBDEVICES.
[Other Info]
* PR :
https://ezix.org/src/pkg/lshw/pulls/9
* Upstream Commit:
https://ezix.org/src/pkg/lshw/commit/7b99d35064230f908551ba65c29264d90f49f246
* This bug doesn't affect Trusty in privileged container. (The code is a bit different in Trusty/lshw package. It basically doesn't rely on SYSKERNELDEBUGUSBDEVICES, meaning that it is only validating if PROCBUSUSBDEVICES exist or not and react accordingly).
* Only affect Xenial and late.
* The bug has been introduced upstream after this specific commit :
https://ezix.org/src/pkg/lshw/commit/9f05be36f7ce6117731e312053d1ec91348a3051
* This particular bug isn't reproducible in Debian (tested with sid in privileged mode) container image because both files doesn't exist in their image, thus making the lshw stop here :
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
return false;
With that being said, I filed a debian bug anyway mentioning that it would be great for them to merge the upstream PR since Ubuntu is merging/syncing from them, and it won't hurt debian lshw package, if they change or not their image behavior one day. Even if not necessary fixing an actual debian/lshw bug.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=878792
[Original Description]
When running lshw in a Xenial container, I'm getting a segmentation fault. I'll attach the apport crash dump.
```
stgraber@castiana:~$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
stgraber@castiana:~$ lxc exec priv bash
root@priv:~# lshw
Segmentation fault
root@priv:~#
```
[strace of lshw]
open("/usr/share/hwdata/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/lshw-common/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/usb/devices", O_RDONLY) = -1 EACCES (Permission denied)
open("/proc/bus/usb/devices", O_RDONLY) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault |
|
2017-10-17 18:38:17 |
Bug Watch Updater |
lshw (Debian): status |
Unknown |
New |
|
2017-10-23 16:31:19 |
Eric Desrochers |
description |
[Impact]
* lshw crashes with SEGV in privileged containers, unless you disable the 'usb' test: $ lshw -disable usb
[Test Case]
## Create a privileged container. ##
$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
## Execute lshw inside the privileged container. ##
$ lxc exec priv bash
root@priv:~#
root@priv:~#lshw
Segmentation fault
[Regression Potential]
* Risks of regression are low.
* I have tested lshw inside containers (unprivileges/privileges) and baremetal with success connecting different types of usb device : webcam, usb keys, ... The usb output of lshw cmd is shown as expected, but this time without segfaulting when container in privilege mode.
* Basically, the code look if both files doesn't exists
#define PROCBUSUSBDEVICES "/proc/bus/usb/devices"
#define SYSKERNELDEBUGUSBDEVICES "/sys/kernel/debug/usb/devices"
...
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
__return false;
I kept the above in place.
But what if only 1 of the 2 files exists ?
For that reason I added an extra verification if SYSKERNELDEBUGUSBDEVICES exist -> fopen SYSKERNELDEBUGUSBDEVICES.
and
if fopen SYSKERNELDEBUGUSBDEVICES fails and PROCBUSUSBDEVICES exist then -> fopen "PROCBUSUSBDEVICES"
The code first look for SYSKERNELDEBUGUSBDEVICES and if it fails it jump to PROCBUSUSBDEVICES.
But if PROCBUSUSBDEVICES fails there was no mechanism to skip, thus segfault.
I also added another if statement in case PROCBUSUSBDEVICES fails like in this situation (no such file or directory) in privileged container, same as if SYSKERNELDEBUGUSBDEVICES can't be opened to force to jump on trying PROCBUSUSBDEVICES.
[Other Info]
* PR :
https://ezix.org/src/pkg/lshw/pulls/9
* Upstream Commit:
https://ezix.org/src/pkg/lshw/commit/7b99d35064230f908551ba65c29264d90f49f246
* This bug doesn't affect Trusty in privileged container. (The code is a bit different in Trusty/lshw package. It basically doesn't rely on SYSKERNELDEBUGUSBDEVICES, meaning that it is only validating if PROCBUSUSBDEVICES exist or not and react accordingly).
* Only affect Xenial and late.
* The bug has been introduced upstream after this specific commit :
https://ezix.org/src/pkg/lshw/commit/9f05be36f7ce6117731e312053d1ec91348a3051
* This particular bug isn't reproducible in Debian (tested with sid in privileged mode) container image because both files doesn't exist in their image, thus making the lshw stop here :
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
return false;
With that being said, I filed a debian bug anyway mentioning that it would be great for them to merge the upstream PR since Ubuntu is merging/syncing from them, and it won't hurt debian lshw package, if they change or not their image behavior one day. Even if not necessary fixing an actual debian/lshw bug.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=878792
[Original Description]
When running lshw in a Xenial container, I'm getting a segmentation fault. I'll attach the apport crash dump.
```
stgraber@castiana:~$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
stgraber@castiana:~$ lxc exec priv bash
root@priv:~# lshw
Segmentation fault
root@priv:~#
```
[strace of lshw]
open("/usr/share/hwdata/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/lshw-common/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/usb/devices", O_RDONLY) = -1 EACCES (Permission denied)
open("/proc/bus/usb/devices", O_RDONLY) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault |
[Impact]
* lshw crashes with SEGV in privileged containers, unless you disable the 'usb' test: $ lshw -disable usb
[Test Case]
## Create a privileged container. ##
$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
## Execute lshw inside the privileged container. ##
$ lxc exec priv bash
root@priv:~#
root@priv:~#lshw
Segmentation fault
[Regression Potential]
* Risks of regression are low.
* I have tested lshw inside containers (unprivileges/privileges) and baremetal with success connecting different types of usb device : webcam, usb keys, ... The usb output of lshw cmd is shown as expected, but this time without segfaulting when container in privilege mode.
* Basically, the code look if both files doesn't exists
#define PROCBUSUSBDEVICES "/proc/bus/usb/devices"
#define SYSKERNELDEBUGUSBDEVICES "/sys/kernel/debug/usb/devices"
...
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
__return false;
I kept the above in place.
But what if only 1 of the 2 files exists ?
For that reason I added an extra verification if SYSKERNELDEBUGUSBDEVICES exist -> fopen SYSKERNELDEBUGUSBDEVICES.
and
if fopen SYSKERNELDEBUGUSBDEVICES fails and PROCBUSUSBDEVICES exist then -> fopen "PROCBUSUSBDEVICES"
The code first look for SYSKERNELDEBUGUSBDEVICES and if it fails it jump to PROCBUSUSBDEVICES.
But if PROCBUSUSBDEVICES fails there was no mechanism to skip, thus segfault.
I also added another if statement in case PROCBUSUSBDEVICES fails like in this situation (no such file or directory) in privileged container, same as if SYSKERNELDEBUGUSBDEVICES can't be opened to force to jump on trying PROCBUSUSBDEVICES.
[Other Info]
* PR :
https://ezix.org/src/pkg/lshw/pulls/9
* Upstream Commit:
https://ezix.org/src/pkg/lshw/commit/7b99d35064230f908551ba65c29264d90f49f246
* This bug doesn't affect Trusty in privileged container. (The code is a bit different in Trusty/lshw package. It basically doesn't rely on SYSKERNELDEBUGUSBDEVICES, meaning that it is only validating if PROCBUSUSBDEVICES exist or not and react accordingly).
* Only affect Xenial and late.
* The bug has been introduced upstream after this specific commit :
https://ezix.org/src/pkg/lshw/commit/9f05be36f7ce6117731e312053d1ec91348a3051
* This particular bug isn't reproducible in Debian (tested with sid in privileged mode) container image because both files doesn't exist in their image, thus making the lshw stop here :
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
return false;
With that being said, I filed a debian bug anyway mentioning that it would be great for them to merge the upstream PR since Ubuntu is merging/syncing from them, and it won't hurt debian lshw package, if they change or not their image behavior one day. Even if not necessary fixing an actual debian/lshw bug.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=878792
** [10:45:45] 19<apw> slashd, artful is open for SRUs, when BB opens it will start from whatever is in A **
[Original Description]
When running lshw in a Xenial container, I'm getting a segmentation fault. I'll attach the apport crash dump.
```
stgraber@castiana:~$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
stgraber@castiana:~$ lxc exec priv bash
root@priv:~# lshw
Segmentation fault
root@priv:~#
```
[strace of lshw]
open("/usr/share/hwdata/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/lshw-common/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/usb/devices", O_RDONLY) = -1 EACCES (Permission denied)
open("/proc/bus/usb/devices", O_RDONLY) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault |
|
2017-10-23 16:31:28 |
Eric Desrochers |
lshw (Ubuntu Artful): status |
Confirmed |
In Progress |
|
2017-10-23 16:31:32 |
Eric Desrochers |
lshw (Ubuntu Artful): assignee |
Dan Streetman (ddstreet) |
Eric Desrochers (slashd) |
|
2017-10-23 16:36:44 |
Eric Desrochers |
description |
[Impact]
* lshw crashes with SEGV in privileged containers, unless you disable the 'usb' test: $ lshw -disable usb
[Test Case]
## Create a privileged container. ##
$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
## Execute lshw inside the privileged container. ##
$ lxc exec priv bash
root@priv:~#
root@priv:~#lshw
Segmentation fault
[Regression Potential]
* Risks of regression are low.
* I have tested lshw inside containers (unprivileges/privileges) and baremetal with success connecting different types of usb device : webcam, usb keys, ... The usb output of lshw cmd is shown as expected, but this time without segfaulting when container in privilege mode.
* Basically, the code look if both files doesn't exists
#define PROCBUSUSBDEVICES "/proc/bus/usb/devices"
#define SYSKERNELDEBUGUSBDEVICES "/sys/kernel/debug/usb/devices"
...
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
__return false;
I kept the above in place.
But what if only 1 of the 2 files exists ?
For that reason I added an extra verification if SYSKERNELDEBUGUSBDEVICES exist -> fopen SYSKERNELDEBUGUSBDEVICES.
and
if fopen SYSKERNELDEBUGUSBDEVICES fails and PROCBUSUSBDEVICES exist then -> fopen "PROCBUSUSBDEVICES"
The code first look for SYSKERNELDEBUGUSBDEVICES and if it fails it jump to PROCBUSUSBDEVICES.
But if PROCBUSUSBDEVICES fails there was no mechanism to skip, thus segfault.
I also added another if statement in case PROCBUSUSBDEVICES fails like in this situation (no such file or directory) in privileged container, same as if SYSKERNELDEBUGUSBDEVICES can't be opened to force to jump on trying PROCBUSUSBDEVICES.
[Other Info]
* PR :
https://ezix.org/src/pkg/lshw/pulls/9
* Upstream Commit:
https://ezix.org/src/pkg/lshw/commit/7b99d35064230f908551ba65c29264d90f49f246
* This bug doesn't affect Trusty in privileged container. (The code is a bit different in Trusty/lshw package. It basically doesn't rely on SYSKERNELDEBUGUSBDEVICES, meaning that it is only validating if PROCBUSUSBDEVICES exist or not and react accordingly).
* Only affect Xenial and late.
* The bug has been introduced upstream after this specific commit :
https://ezix.org/src/pkg/lshw/commit/9f05be36f7ce6117731e312053d1ec91348a3051
* This particular bug isn't reproducible in Debian (tested with sid in privileged mode) container image because both files doesn't exist in their image, thus making the lshw stop here :
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
return false;
With that being said, I filed a debian bug anyway mentioning that it would be great for them to merge the upstream PR since Ubuntu is merging/syncing from them, and it won't hurt debian lshw package, if they change or not their image behavior one day. Even if not necessary fixing an actual debian/lshw bug.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=878792
** [10:45:45] 19<apw> slashd, artful is open for SRUs, when BB opens it will start from whatever is in A **
[Original Description]
When running lshw in a Xenial container, I'm getting a segmentation fault. I'll attach the apport crash dump.
```
stgraber@castiana:~$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
stgraber@castiana:~$ lxc exec priv bash
root@priv:~# lshw
Segmentation fault
root@priv:~#
```
[strace of lshw]
open("/usr/share/hwdata/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/lshw-common/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/usb/devices", O_RDONLY) = -1 EACCES (Permission denied)
open("/proc/bus/usb/devices", O_RDONLY) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault |
[Impact]
* lshw crashes with SEGV in privileged containers, unless you disable the 'usb' test: $ lshw -disable usb
[Test Case]
## Create a privileged container. ##
$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
## Execute lshw inside the privileged container. ##
$ lxc exec priv bash
root@priv:~#
root@priv:~#lshw
Segmentation fault
[Regression Potential]
* Risks of regression are low.
* I have tested lshw inside containers (unprivileges/privileges) and baremetal with success connecting different types of usb device : webcam, usb keys, ... The usb output of lshw cmd is shown as expected, but this time without segfaulting when container in privilege mode.
* Basically, the code look if both files doesn't exists
#define PROCBUSUSBDEVICES "/proc/bus/usb/devices"
#define SYSKERNELDEBUGUSBDEVICES "/sys/kernel/debug/usb/devices"
...
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
__return false;
I kept the above in place.
But what if only 1 of the 2 files exists ?
For that reason I added an extra verification if SYSKERNELDEBUGUSBDEVICES exist -> fopen SYSKERNELDEBUGUSBDEVICES.
and
if fopen SYSKERNELDEBUGUSBDEVICES fails and PROCBUSUSBDEVICES exist then -> fopen "PROCBUSUSBDEVICES"
The code first look for SYSKERNELDEBUGUSBDEVICES and if it fails it jump to PROCBUSUSBDEVICES.
But if PROCBUSUSBDEVICES fails there was no mechanism to skip, thus segfault.
I also added another if statement in case PROCBUSUSBDEVICES fails like in this situation (no such file or directory) in privileged container, same as if SYSKERNELDEBUGUSBDEVICES can't be opened to force to jump on trying PROCBUSUSBDEVICES.
[Other Info]
* PR :
https://ezix.org/src/pkg/lshw/pulls/9
* Upstream Commit:
https://ezix.org/src/pkg/lshw/commit/7b99d35064230f908551ba65c29264d90f49f246
* This bug doesn't affect Trusty in privileged container. (The code is a bit different in Trusty/lshw package. It basically doesn't rely on SYSKERNELDEBUGUSBDEVICES, meaning that it is only validating if PROCBUSUSBDEVICES exist or not and react accordingly).
* Only affect Xenial and late.
* The bug has been introduced upstream after this specific commit :
https://ezix.org/src/pkg/lshw/commit/9f05be36f7ce6117731e312053d1ec91348a3051
* This particular bug isn't reproducible in Debian (tested with sid in privileged mode) container image because both files doesn't exist in their image, thus making the lshw stop here :
if (!exists(SYSKERNELDEBUGUSBDEVICES) && !exists(PROCBUSUSBDEVICES))
return false;
With that being said, I filed a debian bug anyway mentioning that it would be great for them to merge the upstream PR since Ubuntu is merging/syncing from them, and it won't hurt debian lshw package, if they change or not their image behavior one day. Even if not necessary fixing an actual debian/lshw bug.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=878792
** Discussion with apw on #ubuntu-release **
[10:45:45] <apw> slashd, artful is open for SRUs, when BB opens it will start from whatever is in A
[11:13:49] <apw> -propsoed gets copied to bb-proposed too yes
[Original Description]
When running lshw in a Xenial container, I'm getting a segmentation fault. I'll attach the apport crash dump.
```
stgraber@castiana:~$ lxc launch ubuntu:16.04 priv -c security.privileged=true
Creating priv
Starting priv
stgraber@castiana:~$ lxc exec priv bash
root@priv:~# lshw
Segmentation fault
root@priv:~#
```
[strace of lshw]
open("/usr/share/hwdata/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/local/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/lshw-common/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/usb.ids", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/sys/kernel/debug/usb/devices", O_RDONLY) = -1 EACCES (Permission denied)
open("/proc/bus/usb/devices", O_RDONLY) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0} ---
+++ killed by SIGSEGV +++
Segmentation fault |
|
2017-10-23 16:50:46 |
Eric Desrochers |
attachment added |
|
lp1699161-lshw-artful.debdiff https://bugs.launchpad.net/ubuntu/+source/lshw/+bug/1699161/+attachment/4988582/+files/lp1699161-lshw-artful.debdiff |
|
2017-10-23 17:11:21 |
Eric Desrochers |
attachment added |
|
lp1699161-lshw-zesty.debdiff https://bugs.launchpad.net/ubuntu/+source/lshw/+bug/1699161/+attachment/4988652/+files/lp1699161-lshw-zesty.debdiff |
|
2017-10-23 17:11:32 |
Eric Desrochers |
lshw (Ubuntu Zesty): assignee |
Dan Streetman (ddstreet) |
Eric Desrochers (slashd) |
|
2017-10-23 17:11:42 |
Eric Desrochers |
lshw (Ubuntu Zesty): status |
Confirmed |
In Progress |
|
2017-10-23 20:21:55 |
Ubuntu Foundations Team Bug Bot |
tags |
foundations-engine sts-sru-needed |
foundations-engine patch sts-sru-needed |
|
2017-10-26 18:28:43 |
Brian Murray |
lshw (Ubuntu Artful): status |
In Progress |
Fix Committed |
|
2017-10-26 18:28:49 |
Brian Murray |
bug |
|
|
added subscriber Ubuntu Stable Release Updates Team |
2017-10-26 18:28:53 |
Brian Murray |
bug |
|
|
added subscriber SRU Verification |
2017-10-26 18:29:02 |
Brian Murray |
tags |
foundations-engine patch sts-sru-needed |
foundations-engine patch sts-sru-needed verification-needed verification-needed-artful |
|
2017-10-26 18:30:22 |
Brian Murray |
lshw (Ubuntu Zesty): status |
In Progress |
Fix Committed |
|
2017-10-26 18:30:34 |
Brian Murray |
tags |
foundations-engine patch sts-sru-needed verification-needed verification-needed-artful |
foundations-engine patch sts-sru-needed verification-needed verification-needed-artful verification-needed-zesty |
|
2017-10-26 21:09:56 |
Eric Desrochers |
tags |
foundations-engine patch sts-sru-needed verification-needed verification-needed-artful verification-needed-zesty |
foundations-engine patch sts-sru-needed verification-done-artful verification-needed verification-needed-zesty |
|
2017-10-26 21:13:27 |
Eric Desrochers |
tags |
foundations-engine patch sts-sru-needed verification-done-artful verification-needed verification-needed-zesty |
foundations-engine patch sts-sru-needed verification-done-artful verification-done-zesty verification-needed |
|
2017-10-26 21:17:24 |
Eric Desrochers |
lshw (Ubuntu Bionic): assignee |
Eric Desrochers (slashd) |
|
|
2017-10-27 16:51:40 |
Launchpad Janitor |
lshw (Ubuntu Bionic): status |
In Progress |
Fix Released |
|
2017-10-30 11:53:21 |
Eric Desrochers |
lshw (Ubuntu Xenial): assignee |
Dan Streetman (ddstreet) |
Eric Desrochers (slashd) |
|
2017-10-30 11:58:39 |
Eric Desrochers |
attachment added |
|
lp1699161-lshw-xenial.debdiff https://bugs.launchpad.net/ubuntu/artful/+source/lshw/+bug/1699161/+attachment/5000025/+files/lp1699161-lshw-xenial.debdiff |
|
2017-10-30 13:37:31 |
Eric Desrochers |
lshw (Ubuntu Xenial): status |
Confirmed |
In Progress |
|
2017-11-02 23:24:56 |
Brian Murray |
lshw (Ubuntu Xenial): status |
In Progress |
Fix Committed |
|
2017-11-02 23:25:05 |
Brian Murray |
tags |
foundations-engine patch sts-sru-needed verification-done-artful verification-done-zesty verification-needed |
foundations-engine patch sts-sru-needed verification-done-artful verification-done-zesty verification-needed verification-needed-xenial |
|
2017-11-03 13:01:15 |
Eric Desrochers |
tags |
foundations-engine patch sts-sru-needed verification-done-artful verification-done-zesty verification-needed verification-needed-xenial |
foundations-engine patch sts-sru-needed verification-done-artful verification-done-xenial verification-done-zesty verification-needed |
|
2017-11-03 13:01:27 |
Eric Desrochers |
tags |
foundations-engine patch sts-sru-needed verification-done-artful verification-done-xenial verification-done-zesty verification-needed |
foundations-engine patch sts-sru-needed verification-done verification-done-artful verification-done-xenial verification-done-zesty |
|
2017-11-09 17:44:02 |
Launchpad Janitor |
lshw (Ubuntu Zesty): status |
Fix Committed |
Fix Released |
|
2017-11-09 17:44:07 |
Brian Murray |
removed subscriber Ubuntu Stable Release Updates Team |
|
|
|
2017-11-09 17:44:21 |
Launchpad Janitor |
lshw (Ubuntu Artful): status |
Fix Committed |
Fix Released |
|
2017-11-09 17:45:29 |
Launchpad Janitor |
lshw (Ubuntu Xenial): status |
Fix Committed |
Fix Released |
|
2018-08-20 13:14:36 |
Edward Hope-Morley |
tags |
foundations-engine patch sts-sru-needed verification-done verification-done-artful verification-done-xenial verification-done-zesty |
foundations-engine patch sts-sru-done verification-done verification-done-artful verification-done-xenial verification-done-zesty |
|
2019-05-18 17:19:49 |
Rafael David Tinoco |
removed subscriber Rafael David Tinoco |
|
|
|