Merge ~paelzer/ubuntu/+source/open-vm-tools:lp-1793219-stats-overflow-cosmic into ubuntu/+source/open-vm-tools:ubuntu/cosmic-devel

Proposed by Christian Ehrhardt 
Status: Merged
Approved by: Robie Basak
Approved revision: 89de0c93796f6f07d2a0dbe938fbdbe7f78823fb
Merged at revision: 89de0c93796f6f07d2a0dbe938fbdbe7f78823fb
Proposed branch: ~paelzer/ubuntu/+source/open-vm-tools:lp-1793219-stats-overflow-cosmic
Merge into: ubuntu/+source/open-vm-tools:ubuntu/cosmic-devel
Diff against target: 76 lines (+54/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/lp-1793219-fix-stats-overflow.patch (+46/-0)
debian/patches/series (+1/-0)
Reviewer Review Type Date Requested Status
Robie Basak Pending
Canonical Server Pending
git-ubuntu developers Pending
Review via email: mp+355530@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

The patch from upstream applies as-is and makes sense in general.
Test build in PPA [1]

Later on we will need more info on how to reproduce for the SRU, but for cosmic this should be fine right now.

[1]: https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/3434/+packages

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Thanks Rbasak for the review.

Pushed the tag:
To ssh://git.launchpad.net/~usd-import-team/ubuntu/+source/open-vm-tools
 * [new tag] upload/2%10.3.0-0ubuntu3 -> upload/2%10.3.0-0ubuntu3

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading open-vm-tools_10.3.0-0ubuntu3.dsc: done.
  Uploading open-vm-tools_10.3.0-0ubuntu3.debian.tar.xz: done.
  Uploading open-vm-tools_10.3.0-0ubuntu3_source.buildinfo: done.
  Uploading open-vm-tools_10.3.0-0ubuntu3_source.changes: done.
Successfully uploaded packages.

Due to the beta freeze this is now in https://launchpad.net/ubuntu/cosmic/+queue?queue_state=1 to be approved.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 1147ffe..c6267c9 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,10 @@
6+open-vm-tools (2:10.3.0-0ubuntu3) cosmic; urgency=medium
7+
8+ * d/p/lp-1793219-fix-stats-overflow.patch: fix potential overflow of 32 bit
9+ /proc values (LP: #1793219)
10+
11+ -- Christian Ehrhardt <christian.ehrhardt@canonical.com> Mon, 24 Sep 2018 11:21:11 +0200
12+
13 open-vm-tools (2:10.3.0-0ubuntu2) cosmic; urgency=medium
14
15 * d/p/ubuntu/lp-1791220-Disable-hgfsServer-not-VMware.patch: avoid crashing
16diff --git a/debian/patches/lp-1793219-fix-stats-overflow.patch b/debian/patches/lp-1793219-fix-stats-overflow.patch
17new file mode 100644
18index 0000000..8c0e94d
19--- /dev/null
20+++ b/debian/patches/lp-1793219-fix-stats-overflow.patch
21@@ -0,0 +1,46 @@
22+From c7a186e204cdff46b5e02bcb5208ef8979eaf261 Mon Sep 17 00:00:00 2001
23+From: Oliver Kurth <okurth@vmware.com>
24+Date: Mon, 17 Sep 2018 16:41:18 -0700
25+Subject: [PATCH] Handle Linux kernel /proc FS uint32 type stat overflow when
26+ calculating tools rate stats.
27+
28+On both 32-bit and 64-bit Linux, tools always parses Linux kernel /proc
29+FS stats as uint64 values. For rate stats, current - previous can handle
30+uint64 type stat overflow, but not uint32 type.
31+
32+Origin: upstream, https://github.com/vmware/open-vm-tools/commit/c7a186e204cdff46b5e02bcb5208ef8979eaf261
33+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1793219
34+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=909146
35+Last-Update: 2018-09-24
36+
37+---
38+ .../services/plugins/guestInfo/perfMonLinux.c | 13 ++++++++++++-
39+ 1 file changed, 12 insertions(+), 1 deletion(-)
40+
41+diff --git a/open-vm-tools/services/plugins/guestInfo/perfMonLinux.c b/open-vm-tools/services/plugins/guestInfo/perfMonLinux.c
42+index fa2344b0f..eb74faa55 100644
43+--- a/open-vm-tools/services/plugins/guestInfo/perfMonLinux.c
44++++ b/open-vm-tools/services/plugins/guestInfo/perfMonLinux.c
45+@@ -1094,7 +1094,18 @@ GuestInfoAppendRate(Bool emitNameSpace, // IN:
46+ if (reportID == GuestStatID_Linux_DiskRequestQueueAvg) {
47+ valueDelta = ((double)(currentStat->value)) / 10;
48+ } else {
49+- valueDelta = currentStat->value - previousStat->value;
50++ /*
51++ * The /proc FS stat can be uint32 type in the kernel on both x86
52++ * and x64 Linux, it is parsed and stored as uint64 in tools, so we
53++ * also need to handle uint32 overflow here.
54++ */
55++ if (currentStat->value < previousStat->value &&
56++ previousStat->value <= MAX_UINT32) {
57++ valueDelta = (uint32)(currentStat->value) -
58++ (uint32)(previousStat->value);
59++ } else {
60++ valueDelta = currentStat->value - previousStat->value;
61++ }
62+ }
63+
64+ valueDouble = valueDelta / timeDelta;
65+--
66+2.17.1
67+
68diff --git a/debian/patches/series b/debian/patches/series
69index 7411f4f..12cba39 100644
70--- a/debian/patches/series
71+++ b/debian/patches/series
72@@ -3,3 +3,4 @@ debian/max_nic_count
73 debian/enable_vmhgfs-fuse_by_default
74 debian/scsi-udev-rule
75 ubuntu/lp-1791220-Disable-hgfsServer-not-VMware.patch
76+lp-1793219-fix-stats-overflow.patch

Subscribers

People subscribed via source and target branches