[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: irqbalance update in etch?



On Wed, 01 Oct 2008, Philipp Kern wrote:

> am Wed, Oct 01, 2008 at 12:41:00PM +0200 hast du folgendes geschrieben:
> > irqbalance in etch segfaults when /proc/interrupts contains an interrupt
> > with a number higher than or equal to MAX_INTERRUPTS (256) due to a
> > missing array boundary check.  At least it segfaults reliably on all my
> > hosts (say powell.d.o) that have a line starting in the 500s range.
> > 
> > The version from lenny/backports does not have this issue.  Should we
> > try to fix this in the etch package also?
> 
> looks RC to me.  If it's just a missing boundary check, please add it
> and post the debdiff.  (:

source interdiff looks like this:

diff -u irqbalance-0.12/debian/changelog irqbalance-0.12/debian/changelog
--- irqbalance-0.12/debian/changelog
+++ irqbalance-0.12/debian/changelog
@@ -1,3 +1,15 @@
+irqbalance (0.12-7etch1) stable; urgency=low
+
+  * Non maintainer upload.
+  * irqbalance would segfault on startup when /proc/interrupts contains
+    an interrupt with a number of 256 or larger, since internally it
+    stored data in a fixed-length array.  Newer versions (say 0.55) have
+    replaced the data structure with a list so this is fixed there.  For
+    now we just skip interrupts with such high numbers, since it's the
+    least invasive approach during the stable cycle.
+
+ -- Peter Palfrader <weasel@came.sbg.ac.at>  Wed,  1 Oct 2008 15:06:07 +0200
+
 irqbalance (0.12-7) unstable; urgency=low
 
   * debian/po/es.po: Add Spanish translation from César Gómez
only in patch2:
unchanged:
--- irqbalance-0.12.orig/procinterrupts.c
+++ irqbalance-0.12/procinterrupts.c
@@ -103,6 +103,13 @@
 				ret = sscanf(word,"%i",&irqnumber);
 				if (!ret)  /* non numeric end stuff */
 					irqnumber = MAX_INTERRUPTS-1; 
+				/* This version of irqbalance cannot handle interrups larger
+				 * than 255, so skip stuff right here.  Newer versions
+				 * have replaced the length limited array with a list,
+				 * so this limitation is no longer present in say 0.55.
+				 */
+				if (irqnumber < 0 || irqnumber >= MAX_INTERRUPTS)
+					break;
 			/* then N columns of counts, where N is the number of cpu's */
 			} else if (column <= cpucount) {
 				sscanf(word,"%lli",&count);


Of course this isn't ideal, since now "high-number" interrupts are just
ignored, and not handled at all.  But it's better than segfaulting.  I
would still like to hear back from the old maintainer, Eric, or the new
maintainer, Kyle, tho.

-- 
                           |  .''`.  ** Debian GNU/Linux **
      Peter Palfrader      | : :' :      The  universal
 http://www.palfrader.org/ | `. `'      Operating System
                           |   `-    http://www.debian.org/


Reply to: