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

Bug#200885: marked as done ([PATCH] fix init's check_free_memory)

Your message dated Mon, 15 Sep 2003 16:39:55 +1000
with message-id <20030915163955.0c67b715.bug1@optushome.com.au>
and subject line init's check_free_memory
has caused the attached Bug report 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 I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

Received: (at submit) by bugs.debian.org; 11 Jul 2003 14:49:44 +0000
>From guillaume@morinfr.org Fri Jul 11 09:49:41 2003
Return-path: <guillaume@morinfr.org>
Received: from 66-65-113-154.nyc.rr.com (belette) [] 
	by master.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 19azDQ-00016S-00; Fri, 11 Jul 2003 09:49:40 -0500
Received: from guillaum by belette with local (Exim 4.20)
	id 19azDR-0000dy-CS; Fri, 11 Jul 2003 10:49:41 -0400
Date: Fri, 11 Jul 2003 10:49:41 -0400
From: Guillaume Morin <gemorin@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: [PATCH] fix init's check_free_memory
Message-ID: <20030711144934.GA2468@belette>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
X-Reportbug-Version: 2.19
User-Agent: Mutt/1.5.4i
Sender: Guillaume Morin <guillaume@morinfr.org>
Delivered-To: submit@bugs.debian.org
X-Spam-Status: No, hits=-14.9 required=4.0
	autolearn=ham version=2.53-bugs.debian.org_2003_06_27
X-Spam-Checker-Version: SpamAssassin 2.53-bugs.debian.org_2003_06_27 (

Package: busybox-cvs
Version: 0.60.99.cvs20030426-9 (not installed)
Severity: important
Tags: upstream patch


check_free_memory() is init/init.c is broken. While I really think it
should be more careful about overflows, I've tried to follow upstream's
will in the patch.

Important severity because it makes d-i boot fail on s390x (I know it is
not a supported arch but I guess you'll find the problem on other archs)

--- busybox-cvs-0.60.99.cvs20030426.orig/init/init.c
+++ busybox-cvs-0.60.99.cvs20030426/init/init.c
@@ -335,7 +335,8 @@
        result = (info.totalram >> s) + (info.totalswap >> s);
        result = result * u;
-       if (result < 0)
+       /* checking for int/unsigned overflows */
+       if (result > INT_MAX || result < u)
                result = INT_MAX;
        return result;

The current code was really broken, result is declared as unsigned ...
IMHO, result should be an unsigned long long to avoid overflows and
numerous checks. 

But the patched code should work for now assuming the first operation
does not trigger an overflow...



-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux belette 2.4.20 #17 lun jun 16 14:50:16 EDT 2003 i686
Locale: LANG=fr_FR@euro, LC_CTYPE=fr_FR@euro

Guillaume Morin <guillaume@morinfr.org>

                We're a couple when our bodies double (Placebo)

Received: (at 200885-done) by bugs.debian.org; 15 Sep 2003 06:40:00 +0000
>From bug1@optushome.com.au Mon Sep 15 01:39:59 2003
Return-path: <bug1@optushome.com.au>
Received: from mail017.syd.optusnet.com.au [] 
	by master.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 19yn1i-0001Vq-00; Mon, 15 Sep 2003 01:39:58 -0500
Received: from home.prv (c211-28-122-16.sunsh3.vic.optusnet.com.au [])
	by mail017.syd.optusnet.com.au (8.11.6p2/8.11.6) with SMTP id h8F6duS05928
	for <200885-done@bugs.debian.org>; Mon, 15 Sep 2003 16:39:56 +1000
Date: Mon, 15 Sep 2003 16:39:55 +1000
From: Glenn McGrath <bug1@optushome.com.au>
To: 200885-done@bugs.debian.org
Subject: init's check_free_memory
Message-Id: <20030915163955.0c67b715.bug1@optushome.com.au>
X-Mailer: Sylpheed version 0.9.5 (GTK+ 1.2.10; i686-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Delivered-To: 200885-done@bugs.debian.org
X-Spam-Status: No, hits=1.0 required=4.0
X-Spam-Level: *
X-Spam-Checker-Version: SpamAssassin 2.53-bugs.debian.org_2003_9_14 (

This bug was fixed some time ago, the fix is contained in the latest busybox-cvs package


Reply to: