Segfault when using docker and overlay2

Bug #1720627 reported by Rowan Wookey
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
sysstat (Debian)
Fix Released
Unknown
sysstat (Ubuntu)
Fix Released
Medium
Dariusz Gadomski
Xenial
Fix Released
Medium
Dariusz Gadomski
Zesty
Fix Released
Medium
Dariusz Gadomski
Artful
Fix Released
Medium
Dariusz Gadomski

Bug Description

[Impact]

 * With long entries in mtab tools utilizing the get_filesystem_nr and read_filesystem functions cause a segfault due to a fact that they don't
check strchr result for being null.

[Test Case]

 * Have a long entry in /etc/mtab, e.g.
overlay /var/lib/docker/overlay2/f23d2377a67b9ab1b49555ecd09b2ccdc03
7e0ee5d9e54f87e59f07f4398e71f/merged overlay rw,relatime,lowerdir=/v
ar/lib/docker/overlay2/l/L6VKIYXWBQSJ5R7V35SS43R6Y6:/var/lib/docker/
overlay2/l/UCCHKGXUJPWCMLHR36IZJNNIQP:/var/lib/docker/overlay2/l/RKV
YEXD2FH65FTMK76RDWPLESX:/var/lib/docker/overlay2/l/DX4JZRKTFP2GOO4V6
OWQ6CPJFY:/var/lib/docker/overlay2/l/6CYNWDKADUPPDZJ5IHOH2R7Y5S:/var
/lib/docker/overlay2/l/JTPINUZIATXADL6XWFHG2OYGSF:/var/lib/docker/ov
erlay2/l/OTSTIV5TTRHF4IUD7BODQ2FUON:/var/lib/docker/overlay2/l/QFNH3
EFS5EZGRTC4DPHU3PJ4TU:/var/lib/docker/overlay2/l/ZOOUKT2E5U4CSLP57Z7
MXYX5CD:/var/lib/docker/overlay2/l/3LUU6IDR2HWPTVBARC5K6XSMRC:/var/l
ib/docker/overlay2/l/XOHYBP4RWXQKQZ43I7JKG24KE4:/var/lib/docker/over
lay2/l/MN5M5B7AY5LPXQQC6V2MBJWWBF:/var/lib/docker/overlay2/l/3DRMKQ3
4AIZD2AROU3TVK3OCUT:/var/lib/docker/overlay2/l/73ZXDHBV6C53Q3SPXA57E
OLGHU:/var/lib/docker/overlay2/l/C2IZBQ55EUTGEAAORSLE73ZPNM:/var/lib
/docker/overlay2/l/ITHARNV7RPWN5S3BCZ2QDMZIMJ:/var/lib/docker/overla
y2/l/TQKUV4LEG4AFUUCMFHHRLDBHAH:/var/lib/docker/overlay2/l/N75JZWPPD
EKJ4DTN4GMEGTDIZL:/var/lib/docker/overlay2/l/QGUUYAETPMK643DG3AKWJAI
IZA,upperdir=/var/lib/docker/overlay2/f23d2377a67b9ab1b49555ecd09b2c
cdc037e0ee5d9e54f87e59f07f4398e71f/diff,workdir=/var/lib/docker/over
lay2/f23d2377a67b9ab1b49555ecd09b2ccdc037e0ee5d9e54f87e59f07f4398e71
f/work 0 0
(the above is from the upstream bug description).

 * Run
sadc -F -L -S DISK 1 1 /var/log/sysstat

 * Note a segfault in the log/console.

[Regression Potential]

 * The fix is present upstream, so the behaviour will be consistent with the upstream version.

 * I don't see any potential regression manifestation, as this is a simple bugfix fixing ignoring function return values.

[Other Info]
Original bug description:

This is the same bug as https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=872926 which is fixed upstream by https://github.com/sysstat/sysstat/commit/d40c8ecc530303d7e802617f21a9ac85dbcd68bd

Would it be possible to get this patch added?

Changed in sysstat (Debian):
status: Unknown → Fix Released
Joshua Powers (powersj)
Changed in sysstat (Ubuntu):
status: New → Confirmed
importance: Undecided → High
Eric Desrochers (slashd)
Changed in sysstat (Ubuntu):
status: Confirmed → Fix Released
Changed in sysstat (Ubuntu Xenial):
importance: Undecided → Medium
Changed in sysstat (Ubuntu Zesty):
importance: Undecided → Medium
Changed in sysstat (Ubuntu Artful):
importance: Undecided → Medium
Changed in sysstat (Ubuntu Xenial):
assignee: nobody → Dariusz Gadomski (dgadomski)
Changed in sysstat (Ubuntu Zesty):
assignee: nobody → Dariusz Gadomski (dgadomski)
Changed in sysstat (Ubuntu Artful):
assignee: nobody → Dariusz Gadomski (dgadomski)
tags: added: sts
Revision history for this message
Dariusz Gadomski (dgadomski) wrote :

SRU proposal for Artful.

Revision history for this message
Dariusz Gadomski (dgadomski) wrote :

SRU proposal for Zesty.

Revision history for this message
Dariusz Gadomski (dgadomski) wrote :

SRU proposal for Xenial.

Eric Desrochers (slashd)
tags: added: sts-sponsor-slashd
description: updated
Revision history for this message
Eric Desrochers (slashd) wrote :

Based on my irc conversation with Dariusz... it seems like Debian and Ubuntu devel release (bionic) only has half of the upstream commit. Only fixing "count.c" and not "rd_stats.c".

Seems like there is a potential of 2 separate segfault scenario depending on sadc usage:
https://github.com/sysstat/sysstat/issues/162

I think it would be safe to address both situations right now in the same SRU.

This will involve forwarding it to Debian and prepare a debdiff for bionic (which are requirements before considering to SRU'd).

Once the above requirements are done, I'll gladly sponsor it.

Regards,
Eric

Changed in sysstat (Ubuntu Artful):
status: New → In Progress
Changed in sysstat (Ubuntu Zesty):
status: New → In Progress
Changed in sysstat (Ubuntu Xenial):
status: New → In Progress
Revision history for this message
Dariusz Gadomski (dgadomski) wrote :

debdiff proposal for Bionic.

Eric Desrochers (slashd)
Changed in sysstat (Ubuntu):
assignee: nobody → Dariusz Gadomski (dgadomski)
importance: High → Medium
status: Fix Released → In Progress
Revision history for this message
Dariusz Gadomski (dgadomski) wrote :

SRU proposal for Artful.

description: updated
Revision history for this message
Dariusz Gadomski (dgadomski) wrote :

SRU proposal for Zesty.

Revision history for this message
Dariusz Gadomski (dgadomski) wrote :

SRU proposal for Xenial.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "bionic_sysstat_11.6.0-1ubuntu2.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Eric Desrochers (slashd)
tags: removed: sts-sponsor-slashd
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

checked and sponsored for bionic.
Dariusz committed to report to Debian about the 2nd fix for mtab so that they know.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sysstat - 11.6.0-1ubuntu2

---------------
sysstat (11.6.0-1ubuntu2) bionic; urgency=medium

  * Add 15-yet-another-mtab-reading-fix.patch to handle another case of
    unsafe mtab reading. (LP: #1720627)

sysstat (11.6.0-1ubuntu1) bionic; urgency=medium

  * Merge with Debian unstable. Remaining changes:
    - Fix unwanted 00 bytes in output when --human is not set (LP 1716113)

sysstat (11.6.0-1) unstable; urgency=medium

  * New upstream version.
  * Add 14-fix-mtab-reading.patch to fix a crash occurring in sadc while
    reading really long lines in /etc/mtab (closes: #872926).
  * Standards-Version: 4.1.0 (no changes).

 -- Dariusz Gadomski <email address hidden> Wed, 06 Dec 2017 16:29:31 +0100

Changed in sysstat (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Dariusz Gadomski (dgadomski) wrote :

Looks like I can't link another debian bug in a regular manner, so adding the link here:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=883863

I also shared the Ubuntu bionic patch with Debian.

Revision history for this message
Eric Desrochers (slashd) wrote :

Following bionic sponsorship from Christian + commitment to report to Debian.
I have now sponsored the affected Stable releases: Artful, Zesty and Xenial (which including the rd_stats.c change, mentioned above).

Unapproved: sysstat (artful-proposed/main) [11.5.7-1ubuntu1 => 11.5.7-1ubuntu2] (kubuntu, ubuntu-server)
Unapproved: sysstat (zesty-proposed/main) [11.4.3-1 => 11.4.3-1ubuntu1] (kubuntu, ubuntu-server)
Unapproved: sysstat (xenial-proposed/main) [11.2.0-1ubuntu0.1 => 11.2.0-1ubuntu0.2] (kubuntu, ubuntu-server)

The uploads are now waiting for SRU approval to start building in $RELEASE-proposed.

Eric

Eric Desrochers (slashd)
tags: added: sts-sponsor-slashd-done
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Rowan, or anyone else affected,

Accepted sysstat into artful-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/sysstat/11.5.7-1ubuntu2 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, without details of your testing we will not be able to proceed.

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

Changed in sysstat (Ubuntu Artful):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-artful
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Rowan, or anyone else affected,

Accepted sysstat into zesty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/sysstat/11.4.3-1ubuntu1 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-zesty to verification-done-zesty. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-zesty. In either case, without details of your testing we will not be able to proceed.

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

Changed in sysstat (Ubuntu Zesty):
status: In Progress → Fix Committed
tags: added: verification-needed-zesty
Changed in sysstat (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed-xenial
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Rowan, or anyone else affected,

Accepted sysstat into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/sysstat/11.2.0-1ubuntu0.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-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, without details of your testing we will not be able to proceed.

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

Revision history for this message
Dariusz Gadomski (dgadomski) wrote :

I've just verified that the segfault is fixed in the following releases:
bionic: 11.6.0-1ubuntu2
artful: 11.5.7-1ubuntu2
zesty: 11.4.3-1ubuntu1
xenial: 11.2.0-1ubuntu0.2

tags: added: verification-done verification-done-artful verification-done-xenial verification-done-zesty
removed: verification-needed verification-needed-artful verification-needed-xenial verification-needed-zesty
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for sysstat has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sysstat - 11.4.3-1ubuntu1

---------------
sysstat (11.4.3-1ubuntu1) zesty; urgency=medium

  * Add 16-fix-mtab-reading.patch to fix a crash occurring in sadc while
    reading really long lines in /etc/mtab (LP: #1720627).

 -- Dariusz Gadomski <email address hidden> Wed, 06 Dec 2017 16:49:30 +0100

Changed in sysstat (Ubuntu Zesty):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sysstat - 11.2.0-1ubuntu0.2

---------------
sysstat (11.2.0-1ubuntu0.2) xenial; urgency=medium

  * Add 14-fix-mtab-reading.patch to fix a crash occurring in sadc while
    reading really long lines in /etc/mtab (LP: #1720627).

 -- Dariusz Gadomski <email address hidden> Wed, 06 Dec 2017 16:57:50 +0100

Changed in sysstat (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sysstat - 11.5.7-1ubuntu2

---------------
sysstat (11.5.7-1ubuntu2) artful; urgency=medium

  * Add 14-fix-mtab-reading.patch to fix a crash occurring in sadc while
    reading really long lines in /etc/mtab (LP: #1720627).

 -- Dariusz Gadomski <email address hidden> Wed, 06 Dec 2017 16:39:35 +0100

Changed in sysstat (Ubuntu Artful):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.