privsep patch, Please test

Ben Lindstrom mouring at etoh.eviladmin.org
Thu May 30 13:13:06 EST 2002


Can you make the following change to just before the mmap()..  Thanks.

        if (address == MAP_FAILED)
-                fatal("mmap(%lu)", (u_long)size);
+                fatal("mmap(%lu) %s", (u_long)size, strerror(errno));

I need to know what mmap is setting errno to.  Otherwise I'm making a
guess in the dark (which is 2.2 Linux mmap is fucked, or you have a
version of glibc that has a bad mmap).

- Ben

On Thu, 30 May 2002, Mathias Koerber wrote:

>
>
> > -----Original Message-----
> > From: Tim Rice [mailto:tim at multitalents.net]
> > Sent: Thursday, May 30, 2002 10:49 AM
> > To: Mathias Koerber
> > Cc: OpenSSH Development
> > Subject: RE: privsep patch, Please test
> >
> >
> > On Thu, 30 May 2002, Mathias Koerber wrote:
> >
> > > > This was talked about a few posts ago.  Go to where the
> > mmap() call is for
> > > > the alternation version and change MAP_PRIVATE to MAP_SHARED
> > >
> > > If I do that (after applying Tim's privsep.patch),thusly:
> > >
> > >  #ifdef HAVE_MMAP
> > >  #ifdef HAVE_WORKING_MAP_ANONYMOUS
> > >          address = mmap(NULL, size, PROT_WRITE|PROT_READ,
> > > MAP_ANON|MAP_SHARED,
> > >              -1, 0);
> > >  #else
> > > +        address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_PRIVATE,
> > > -        address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_SHARED,
> >
> > This looks backwards. My patch had,
> >        address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_PRIVATE,
> > should have had,
> >         address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_SHARED,
>
> That's the change I made based on Ben's suggestion..
>
> >
> > What platform are you on?
>
> Linux 2.2.13
>
> >
> >
> _______________________________________________
> openssh-unix-dev at mindrot.org mailing list
> http://www.mindrot.org/mailman/listinfo/openssh-unix-dev
>




More information about the openssh-unix-dev mailing list