attempt to read dmi data can cause warning and stacktrace in logs in a container.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
High
|
Scott Moser | ||
cloud-init (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Xenial |
Fix Released
|
Medium
|
Unassigned | ||
Zesty |
Fix Released
|
Medium
|
Unassigned |
Bug Description
=== Begin SRU Template ===
[Impact]
lxc containers would show warnings in /var/log/
This was because attempts were made to read dmi information from
inside the (unpriviledged) container. Such attempts to read
dmi data like /sys/class/
in an attempt to run dmidecode which would also fail.
[Test Case]
To test this, simply
a.) create an lxd instance from a image with -proposed version of cloud-init
$ release=xenial
$ ref=$release-
$ lxc-proposed-
$ lxc launch $ref $name
b.) lxc exec $name -- grep WARN /var/log/
[Regression Potential]
A regression caused by this change is possible on some system where
systemd identified the system as a container but the container platform provided
simulated/
The check for for container is done with:
systemd-
[Other Info]
Upstream commit at
https:/
This was actually a regression of the upstream fix for bug 1691772.
That never entered a stable Ubuntu release. The testing here is
actually a test against regression.
The upstream commit for that change is at
https:/
lxc-proposed-
https:/
It publishes an image to lxd with proposed enabled and cloud-init upgraded.
=== End SRU Template ===
I launched an instance of artful.
Looked in /var/log/
2017-06-29 16:00:15,222 - util.py[DEBUG]: Reading from /sys/class/
2017-06-29 16:00:15,222 - util.py[WARNING]: failed read of /sys/class/
2017-06-29 16:00:15,223 - util.py[DEBUG]: failed read of /sys/class/
Traceback (most recent call last):
File "/usr/lib/
key_data = load_file(
File "/usr/lib/
with open(fname, 'rb') as ifh:
PermissionError: [Errno 13] Permission denied: '/sys/class/
2017-06-29 16:00:15,225 - util.py[DEBUG]: Running command ['/usr/
2017-06-29 16:00:15,228 - util.py[DEBUG]: failed dmidecode cmd: ['/usr/
Unexpected error while running command.
Command: ['/usr/
Exit code: 1
Reason: -
Stdout: -
Stderr: /sys/firmware/
/dev/mem: No such file or directory
ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: cloud-init 0.7.9-197-
ProcVersionSign
Uname: Linux 4.10.0-22-generic x86_64
ApportVersion: 2.20.5-0ubuntu5
Architecture: amd64
Date: Thu Jun 29 16:47:51 2017
PackageArchitec
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
LANG=C.UTF-8
SourcePackage: cloud-init
UpgradeStatus: No upgrade log present (probably fresh install)
Related branches
- Server Team CI bot: Approve (continuous-integration)
- Joshua Powers (community): Approve
- Ryan Harper: Approve
-
Diff: 65 lines (+30/-0)2 files modifiedcloudinit/util.py (+7/-0)
tests/unittests/test_util.py (+23/-0)
Changed in cloud-init: | |
assignee: | nobody → Scott Moser (smoser) |
importance: | Undecided → High |
status: | New → Confirmed |
Changed in cloud-init: | |
status: | Confirmed → Fix Committed |
Changed in cloud-init (Ubuntu): | |
importance: | Undecided → Medium |
Changed in cloud-init (Ubuntu Xenial): | |
status: | New → Confirmed |
Changed in cloud-init (Ubuntu Zesty): | |
status: | New → Confirmed |
Changed in cloud-init (Ubuntu Xenial): | |
importance: | Undecided → Medium |
Changed in cloud-init (Ubuntu Zesty): | |
importance: | Undecided → Medium |
description: | updated |
Status changed to 'Confirmed' because the bug affects multiple users.