Your message dated Mon, 02 Jul 2012 21:02:32 +0000
with message-id <[email protected]>
and subject line Bug#610101: fixed in powertop 1.11-1+squeeze1
has caused the Debian Bug report #610101,
regarding powertop fails with segmentation fault on newer kernels with large 
config files
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
610101: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=610101
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: powertop
Version: 1.11-1
Severity: important
Tags: patch

On newer kernels with large config files, powertop fails with a segmentation
fault. For example, this occurs when kernel 2.6.37 is installed for x86-64
using the debian kernel 2.6.32 config file as a starting point. This issue is
sortof fixed in the upstream version 1.13 of powertop 1.13 by increasing the
maximum size of the config file that can be handled and checking the buffer
lengths. Presumably it is too close to release to upgrade a major version so a
patch is attached that will act as a stopgap.



-- System Information:
Debian Release: 6.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.37 (SMP w/8 CPU cores)
Locale: LANG=en_IE.utf8, LC_CTYPE=en_IE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages powertop depends on:
ii  libc6                     2.11.2-7       Embedded GNU C Library: Shared lib
ii  libncursesw5              5.7+20100313-5 shared libraries for terminal hand

powertop recommends no packages.

Versions of packages powertop suggests:
ii  cpufrequtils                  007-1      utilities to deal with the cpufreq
pn  laptop-mode-tools             <none>     (no description available)

-- no debconf information
>From 29ea8074594645f3d01013b9ce0c3e1cea972480 Mon Sep 17 00:00:00 2001
From: Mel Gorman <[email protected]>
Date: Sat, 15 Jan 2011 11:53:23 +0000
Subject: [PATCH] Avoid segfaults due to buffer overruns while reading the 
kernel config file

On newer kernels, powertop segfaults when reading the config file. The
problem is that the config is longer than expected and it overruns the
buffer (distressing as this runs as root). Upstream in 1.13, this is
fixed by increasing the maximum size of the config file to 10000 and
checks the buffer is not being overrun. This is what this patch does
as a stopgap measure until the package is synchronised with the
upstream version.

Signed-off-by: Mel Gorman <[email protected]>
---

diff --git a/powertop-1.11/debian/patches/00list 
b/powertop-1.11/debian/patches/00list
index dd28abb..e98f73f 100644
--- a/powertop-1.11/debian/patches/00list
+++ b/powertop-1.11/debian/patches/00list
@@ -1 +1,2 @@
 remove-bashism.dpatch
+increase-configlimit.dpatch
diff --git a/powertop-1.11/debian/patches/increase-configlimit.dpatch 
b/powertop-1.11/debian/patches/increase-configlimit.dpatch
new file mode 100755
index 0000000..57fb41d
--- /dev/null
+++ b/powertop-1.11/debian/patches/increase-configlimit.dpatch
@@ -0,0 +1,38 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## increase-configlimit.patch.dpatch by  <[email protected]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' 
'--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' 
powertop-1.11~/config.c powertop-1.11/config.c
+--- powertop-1.11~/config.c    2011-01-15 11:51:23.000000000 +0000
++++ powertop-1.11/config.c     2011-01-15 11:58:55.494107143 +0000
+@@ -33,7 +33,8 @@
+ #include "powertop.h"
+ 
+ /* static arrays are not nice programming.. but they're easy */
+-static char configlines[5000][100];
++#define MAXCONFIGLINES 10000
++static char configlines[MAXCONFIGLINES][100];
+ static int configcount;
+ 
+ static void read_kernel_config(void)
+@@ -49,6 +50,8 @@
+                       char line[100];
+                       if (fgets(line, 100, file) == NULL)
+                               break;
++                      if (configcount >= MAXCONFIGLINES)
++                              break;
+                       strcpy(configlines[configcount++], line);
+               }
+               pclose(file);
+@@ -77,6 +80,8 @@
+               char line[100];
+               if (fgets(line, 100, file) == NULL)
+                       break;
++              if (configcount >= MAXCONFIGLINES)
++                      break;
+               strcpy(configlines[configcount++], line);
+       }
+       fclose(file);

--- End Message ---
--- Begin Message ---
Source: powertop
Source-Version: 1.11-1+squeeze1

We believe that the bug you reported is fixed in the latest version of
powertop, which is due to be installed in the Debian FTP archive:

powertop_1.11-1+squeeze1.diff.gz
  to main/p/powertop/powertop_1.11-1+squeeze1.diff.gz
powertop_1.11-1+squeeze1.dsc
  to main/p/powertop/powertop_1.11-1+squeeze1.dsc
powertop_1.11-1+squeeze1_amd64.deb
  to main/p/powertop/powertop_1.11-1+squeeze1_amd64.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Salvatore Bonaccorso <[email protected]> (supplier of updated powertop package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sun, 01 Jul 2012 13:12:05 +0200
Source: powertop
Binary: powertop
Architecture: source amd64
Version: 1.11-1+squeeze1
Distribution: stable
Urgency: low
Maintainer: Patrick Winnertz <[email protected]>
Changed-By: Salvatore Bonaccorso <[email protected]>
Description: 
 powertop   - Linux tool to find out what is using power on a laptop
Closes: 610101
Changes: 
 powertop (1.11-1+squeeze1) stable; urgency=low
 .
   * Non-maintainer upload.
   * Fix segfault on newer kernels with large config files.
     Thanks to Mel Gorman (Closes: #610101)
     NMU upload prepared with debdiff created by Patrick Winnertz
     <[email protected]> and found on debian-release mailing list.
     http://lists.debian.org/debian-release/2011/03/msg00292.html
Checksums-Sha1: 
 8f41df89cd90adc05bb02c562d39eea9244ecfcf 1757 powertop_1.11-1+squeeze1.dsc
 88915ea793c89466df4e6280edce5f0abe3020ad 5236 powertop_1.11-1+squeeze1.diff.gz
 29e09ac29022a5543b24146d0640f8e88ca5626c 75062 
powertop_1.11-1+squeeze1_amd64.deb
Checksums-Sha256: 
 d954caf5335b3b08413a5f97cc2b76582ddd963b812cdb712b2111cf745766ac 1757 
powertop_1.11-1+squeeze1.dsc
 b2188614662f6548698da732e45b04f3384a2d20f26342f6ee323a517577ab5d 5236 
powertop_1.11-1+squeeze1.diff.gz
 575f781ddc3f9de142c902455e3b51fe20f27d52ce2992ca23a2d583f1f522b6 75062 
powertop_1.11-1+squeeze1_amd64.deb
Files: 
 d6b0c171cf6ebec75598380fe05ff1ac 1757 utils optional 
powertop_1.11-1+squeeze1.dsc
 411b0d3499f0b392603099fc576bf77c 5236 utils optional 
powertop_1.11-1+squeeze1.diff.gz
 3ec702a70803df4edc9f06a983f19499 75062 utils optional 
powertop_1.11-1+squeeze1_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBCAAGBQJP8ETGAAoJEHidbwV/2GP++BgP/1SsGus82b7MOSMMS/ajIswr
L+t8K3PGxU2AzTa1fi8u56s2g/XFObLaMILF02pENx/gp87smxk0uxpSXXpHdgIQ
8HduohEQRFBdNCxZKsIA0UBt8KVbTydgaGNC6V0CQhdJToD3odfwJQcGyamgLHB4
Wpamu2TKVineMshTNeDMGL7NDqUOlpu/SLnHtDwIP+1NkK20vGagEF+UG3pY5wvD
PWPpo1mWeOYPlkf/eAEzI7I96sCr0pqYmyixHMCIzbHJdYuGU1FINo7z7i41j6/H
imFBnCIWpeNynowwhuh+uvaS/Qn2RW+juDGXtz2vJqlDsTpvxrWYBhDeCzLe9ZOi
WWRmhPh7JW2eDtwkCNU91O2+G6u9uwxUh13aANsRvXiEZe5mYJ3mdVTQhgpqxvGO
OcdJ5kEzwr9FJXOteP/2mg4v2vlVis+2phH2KSLvF1HdYFRwu12Whrk4URACXRkp
3Yo5R7xYJrwkmcL0JC/lRyrpKH8662mNFXlrknozzveYGKrCbr1FzcJh4SbO9Oao
fPlI6cewo5P47B7XWXwqNgVoX6A1BgAb6OUvNQhVA+5/p61Ua20mf337HgW09SIJ
rbBIK20650uBVYVGOgdBf47E1j9g+A9uwgTQnwSKfK/ekF5n+owc7/QIEYNbar0/
gasUz8bEcBrp9Xq5fqeP
=51X4
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to