This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: handling overflow in sbrk.
- From: "Carlos O'Donell" <carlos at systemhalted dot org>
- To: "Chris Demetriou" <cgd at google dot com>
- Cc: libc-help at sourceware dot org
- Date: Tue, 20 May 2008 08:45:27 -0400
- Subject: Re: handling overflow in sbrk.
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=dEIfeoBrZPTz6YkciNFqbunv5KMxGXu7EhejzP8ATu4=; b=pPVMIp/uBc1n/zuE3Oez5h/ShyfgWfzAl8NYcBkwclqzraMHxzhuVYaSrMxeWHE/Zr27XcR/F6IRON26gGDtL3P/7blv4CMjOpfKKf1zaNZ31J200RS1eEuPW05u/BqzgDRxxqXR9M43nVW3BIYnhLZ4fFTU6OYDRoMmhomkvPA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=I4JFp+xvsx6uz8FnSKwp3fnwDBUkfXzwm+KFhZu74GUbcBkTjy6gne+hvxbPaSW225S2kwyHDdMPmINn5x+5aWFrQpox0j10QgL8VQ+YPCjHpQBaZN6o9LRDs3WzOxJo87uU07IfWzdceoOiwjJw5MxCPze+sxgf0aV8YBgsXlE=
- References: <2e7be40c0805162353w2cb0c7bco864d82cb6aa9a8fb@mail.gmail.com> <2e7be40c0805162357g61809593j469605765ad6832f@mail.gmail.com>
On Sat, May 17, 2008 at 2:57 AM, Chris Demetriou <cgd@google.com> wrote:
> On the other hand, it's really easy to add a check for overflow in
> sbrk. If __curbrk + incr wraps the pointer, declare an error.
>
>
> See attached test program (sbrktest.c). Build for (32-bit) x86 and
> run on an x86-64 linux system, put text at 0xd0000000 so it's easy to
> wrap the break.
>
> What do y'all think?
>
> 2008-05-16 Chris Demetriou <cgd@google.com>
>
> * misc/sbrk.c (__sbrk): If incrementing __curbrk by the requested
> amount would cause it to overflow, return an error (ENOMEM).
>
1. Please add a test case for this bug. Converting your program into a
test would be a great idea.
2. Please run the glibc testsuite to verify that there were no regressions.
3. Do you have an FSF copyright assignment?
Cheers,
Carlos O'Donell.