Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Wed, 20 Jul 2011 09:27:06 -0400
From: Rich Felker <>
Subject: Re: cluts memcpy() test

On Wed, Jul 20, 2011 at 12:30:35PM +0200, Luka M. wrote:
> On Wed, Jul 20, 2011 at 2:28 AM, Solar Designer <> wrote:
> > Luka, Rich -
> >
> > It'd be nice for cluts to detect issues like this:
> >
> >
> >
> > Maybe it already does?
> >
> Hey Alexander. Cluts doesn't test negative values for memcpy. Such a thing
> hasn't occured to me: The prototype for the function specifies a size_t
> argument, and size_t is supposed to be unsigned. This means, _afaik_, that a
> negative value should be implicitly cast to a positive "equivalent". So, I

The problem is (or rather was; I assume it's fixed now) broken asm in
glibc that treated the unsigned value as if it were signed...

Note that musl will not allow you to allocate memory so large that the
unsigned size would be negative if interpreted as a signed value,
since that would create dangerous situations where ptrdiff_t
overflows. It may still be possible to make a region that large
explicitly using mmap, however.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.