lscpu possible crash in min/max frequency

Bug #1771345 reported by Julian Andres Klode on 2018-05-15
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)
High
Unassigned
Xenial
High
Unassigned
Artful
High
Unassigned
Bionic
High
Unassigned

Bug Description

[Impact]
lscpu prior to 2.32 does not correctly check for NULL members in min/max CPU frequency arrays and can call atof() on them, leading to crashes. It seems that's what caused the verification to fail for bug 1732865. The following fixes have been committed upstream:

from 2.30: https://github.com/karelzak/util-linux/commit/0145d84a381fc2fcd7d37e0dbf3d9dff69609ecd

from 2.32: https://github.com/karelzak/util-linux/commit/95f09bc63c564c50ec2c393352801cc056faaea2

I plan to backport them to xenial (both patches); and artful, bionic (second patch, they are > 2.30).

[Regression potential]
The worst possible regression is that lscpu would fail to correctly report min/max frequencies, but it seems unlikely, as we're only adding checks against null pointers / move an atof into a loop.

[Test case]
Extract attached segvtest.tar.gz and run lscpu -s segvtest and check that it does not crash (this removes min mhz file for cpu #0 for testing).

Julian Andres Klode (juliank) wrote :

Merged 2.32, should be building and hitting proposed soon.

Changed in util-linux (Ubuntu):
status: New → Fix Committed
Changed in util-linux (Ubuntu Xenial):
status: New → Triaged
Changed in util-linux (Ubuntu Artful):
status: New → Triaged
Changed in util-linux (Ubuntu Bionic):
status: New → Incomplete
status: Incomplete → Triaged
Changed in util-linux (Ubuntu):
importance: Undecided → Critical
importance: Critical → High
Changed in util-linux (Ubuntu Xenial):
importance: Undecided → High
Changed in util-linux (Ubuntu Artful):
importance: Undecided → High
Changed in util-linux (Ubuntu Bionic):
importance: Undecided → High
description: updated
Julian Andres Klode (juliank) wrote :

Test case

description: updated
description: updated

Hello Julian, or anyone else affected,

Accepted util-linux into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/util-linux/2.27.1-6ubuntu3.6 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in util-linux (Ubuntu Xenial):
status: Triaged → Fix Committed
Changed in util-linux (Ubuntu Artful):
status: Triaged → Fix Committed
Robie Basak (racb) wrote :

Hello Julian, or anyone else affected,

Accepted util-linux into artful-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/util-linux/2.30.1-0ubuntu4.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-artful to verification-done-artful. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-artful. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in util-linux (Ubuntu Bionic):
status: Triaged → Fix Committed
Robie Basak (racb) wrote :

Hello Julian, or anyone else affected,

Accepted util-linux into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/util-linux/2.31.1-0.4ubuntu3.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Julian Andres Klode (juliank) wrote :
Download full text (3.7 KiB)

xenial: 3.4 prints (null), 3.5 crashed, and 3.6 fixed it -> verified
artful: 4.1 in release crashes; 4.2 fixes it -> verified
bionic: 3 in release crashes, 3.1 fixes it -> verified

Sample log from bionic belog:

jak@jak-t480s:~/Downloads$ echo lscpu -s /home/jak/Downloads/segvtest | lxc exec b -- bash -
bash: line 1: 285 Segmentation fault (core dumped) lscpu -s /home/jak/Downloads/segvtest
-
jak@jak-t480s:~/Downloads$ lxc exec b -- sh -c "echo 'deb http://archive.ubuntu.com/ubuntu bionic-proposed main' > /etc/apt/sources.list"
jak@jak-t480s:~/Downloads$ lxc exec b apt update
Get:1 http://archive.ubuntu.com/ubuntu bionic-proposed InRelease [242 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic-proposed/main amd64 Packages [35.9 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-proposed/main Translation-en [14.7 kB]
Fetched 293 kB in 1s (472 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
17 packages can be upgraded. Run 'apt list --upgradable' to see them.
jak@jak-t480s:~/Downloads$ lxc exec b apt install -q util-linux
Error: unknown shorthand flag: 'q' in -q
jak@jak-t480s:~/Downloads$ lxc exec b -- apt install -q util-linux
Reading package lists...
Building dependency tree...
Reading state information...
The following package was automatically installed and is no longer required:
  libfreetype6
Use 'apt autoremove' to remove it.
Suggested packages:
  util-linux-locales
The following packages will be upgraded:
  util-linux
1 upgraded, 0 newly installed, 0 to remove and 16 not upgraded.
Need to get 902 kB of archives.
After this operation, 1024 B of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic-proposed/main amd64 util-linux amd64 2.31.1-0.4ubuntu3.1 [902 kB]
Fetched 902 kB in 1s (990 kB/s)
(Reading database ... 28477 files and directories currently installed.)
Preparing to unpack .../util-linux_2.31.1-0.4ubuntu3.1_amd64.deb ...
Unpacking util-linux (2.31.1-0.4ubuntu3.1) over (2.31.1-0.4ubuntu3) ...
Setting up util-linux (2.31.1-0.4ubuntu3.1) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for ureadahead (0.100.0-20) ...
Processing triggers for systemd (237-3ubuntu10) ...
Processing triggers for man-db (2.8.3-2) ...
jak@jak-t480s:~/Downloads$ echo lscpu -s /home/jak/Downloads/segvtest | lxc exec b -- bash -
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 8
On-line CPU(s) list: 0-7
Thread(s) per core: 2
Core(s) per socket: 4
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 142
Model name: Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
Stepping: 10
CPU max MHz: 3400.0000
CPU min MHz: 400.0000
BogoMIPS: 3600.00
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 6144K
NUMA node0 CPU(s): 0-7
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb...

Read more...

tags: added: verification-done-artful verification-done-bionic verification-done-xenial
Łukasz Zemczak (sil2100) wrote :

There are some autopkgtest regressions associated with the bionic, artful and xenial uploads. Could you check if those are real related regressions or not?

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

Other bug subscribers

Bug attachments