Control: retitle -1 unblock: libproc-processtable-perl/0.45-5

Hi Adam

On Sat, Jan 12, 2013 at 04:07:55PM +0100, Salvatore Bonaccorso wrote:
> To have this info in the bugreport:
> 
> >From the discussion on IRC and comments from Julien and Adam: It would
> make sense to even inrease this to more than 100.
> 
> @Adam: will try to handle this in the unstable version then first.

Increased as requested, as 100 is not enough for the future. Attached
is the new debdiff against the version in testing.

Regards,
Salvatore
Base version: libproc-processtable-perl_0.45-3 from testing
Target version: libproc-processtable-perl_0.45-5 from unstable

No hints in place.

 changelog                                          |   17 ++++++++++
 patches/696874-fix-Buffer-overflow-in-pctcpu.patch |   34 +++++++++++++++++++++
 patches/series                                     |    1 
 3 files changed, 52 insertions(+)

diff -Nru libproc-processtable-perl-0.45/debian/changelog 
libproc-processtable-perl-0.45/debian/changelog
--- libproc-processtable-perl-0.45/debian/changelog     2011-11-07 
16:23:58.000000000 +0000
+++ libproc-processtable-perl-0.45/debian/changelog     2013-01-16 
06:24:07.000000000 +0000
@@ -1,3 +1,20 @@
+libproc-processtable-perl (0.45-5) unstable; urgency=low
+
+  * Refresh 696874-fix-Buffer-overflow-in-pctcpu.patch.
+    Update buffer to work with up to 9999 logical CPUs. See #696874.
+
+ -- Salvatore Bonaccorso <[email protected]>  Wed, 16 Jan 2013 07:00:41 +0100
+
+libproc-processtable-perl (0.45-4) unstable; urgency=low
+
+  * Add 696874-fix-Buffer-overflow-in-pctcpu.patch.
+    Fix for buffer overflow in pctcpu. On systems with more than 9 logical
+    CPUs, a process can use more than 999% of CPU and overflow pctcpu.
+    Thanks to Matthew L. Dailey and Zhengpeng Hou (Closes: #696874)
+    (LP: #1093289)
+
+ -- Salvatore Bonaccorso <[email protected]>  Fri, 28 Dec 2012 18:49:26 +0100
+
 libproc-processtable-perl (0.45-3) unstable; urgency=low
 
   [ Ansgar Burchardt ]
diff -Nru 
libproc-processtable-perl-0.45/debian/patches/696874-fix-Buffer-overflow-in-pctcpu.patch
 
libproc-processtable-perl-0.45/debian/patches/696874-fix-Buffer-overflow-in-pctcpu.patch
--- 
libproc-processtable-perl-0.45/debian/patches/696874-fix-Buffer-overflow-in-pctcpu.patch
    1970-01-01 00:00:00.000000000 +0000
+++ 
libproc-processtable-perl-0.45/debian/patches/696874-fix-Buffer-overflow-in-pctcpu.patch
    2013-01-16 06:24:07.000000000 +0000
@@ -0,0 +1,34 @@
+Description: Fix for buffer overflow in pctcpu
+ On systems with more than 9 logical CPUs, a process can use more than 999% of
+ CPU and overflow pctcpu. This patch increases the buffer so that it will work
+ for up to 9999 logical CPUs.
+Bug: https://rt.cpan.org/Public/Bug/Display.html?id=82175
+Bug-Debian: http://bugs.debian.org/696874
+Bug-Ubuntu: https://launchpad.net/bugs/1093289
+Forwarded: not-needed
+Author: Matthew L. Dailey <[email protected]>
+Reviewed-by: Salvatore Bonaccorso <[email protected]>
+Last-Update: 2012-12-23
+
+--- libproc-processtable-perl-0.45.orig/os/Linux.h
++++ libproc-processtable-perl-0.45/os/Linux.h
+@@ -42,7 +42,7 @@ struct procstat
+       char                    *cmndline;
+       char                    *exec;
+       /* other values */
+-      char                    pctcpu[sizeof("100.00")];       /* precent cpu, 
without '%' char */
++      char                    pctcpu[sizeof("100000.00")];    /* precent cpu, 
without '%' char */
+       char                    pctmem[sizeof("100.00")];       /* precent 
memory, without '%' char */
+ };
+ 
+--- libproc-processtable-perl-0.45.orig/os/Linux.c
++++ libproc-processtable-perl-0.45/os/Linux.c
+@@ -551,7 +551,7 @@ static void calc_prec(char *format_str,
+     float pctcpu = 100.0f * (prs->utime / 1e6) / (time(NULL) - 
prs->start_time);
+ 
+     /* calculate pctcpu - NOTE: This assumes the cpu time is in microsecond 
units! */
+-    sprintf(prs->pctcpu, "%3.2f", pctcpu);
++    sprintf(prs->pctcpu, "%6.2f", pctcpu);
+     field_enable(format_str, F_PCTCPU);
+ 
+     /* calculate pctmem */
diff -Nru libproc-processtable-perl-0.45/debian/patches/series 
libproc-processtable-perl-0.45/debian/patches/series
--- libproc-processtable-perl-0.45/debian/patches/series        2011-11-07 
16:23:58.000000000 +0000
+++ libproc-processtable-perl-0.45/debian/patches/series        2013-01-16 
06:24:07.000000000 +0000
@@ -1,2 +1,3 @@
 spelling.patch
 646785-add-new-states.patch
+696874-fix-Buffer-overflow-in-pctcpu.patch

Reply via email to