Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 21 Feb 2014 12:09:03 -0500
From: Rich Felker <>
Subject: Re: Re: Removing sbrk and brk

On Fri, Feb 21, 2014 at 05:47:05PM +0100, Daniel Cegiełka wrote:
> 2014-02-21 17:36 GMT+01:00 Szabolcs Nagy <>:
> > * Daniel Cegie?ka <> [2014-02-21 17:03:36 +0100]:
> >> And what do we do with failures when sbrk is used?
> >>
> >
> > most of these only call sbrk(0) which is supported
> ok, thank you for the information.
> >>
> >>
> >
> > the "old musl" did not support sbrk either (the cited code uses it
> > with malloc), the "new musl" just helps you find the bug more easily
> ex/vi doesn't work with the new musl. Too bad, because it is the
> traditional unix ex/vi. Maybe Gunnar Ritter still fixes bugs.

Then it didn't work before either; it was silently corrupting memory.
The only difference now is that you know that it's not working.

The lazy way around this would be writing a fake sbrk that just mmaps
a huge PROT_NONE region the first time it's called then mprotects more
of it to PROT_READ|PROT_WRITE every time sbrk is called to make more
available. This is a *portable* fake sbrk that should work on any


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.