privsep patch, Please test
Ben Lindstrom
mouring at etoh.eviladmin.org
Thu May 30 13:42:38 EST 2002
On Wed, 29 May 2002, Tim Rice wrote:
> On Wed, 29 May 2002, Ben Lindstrom wrote:
>
> >
> > 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).
>
> strace tells the story
> open("/dev/zero", O_RDWR|O_LARGEFILE) = 8
> mmap(NULL, 65536, PROT_READ|PROT_WRITE, MAP_SHARED, 8, 0) = -1 EINVAL (Invalid a
> rgument)
>
> The man page says
> EINVAL We don't like start or length or offset. (E.g.,
> they are too large, or not aligned on a PAGESIZE
> boundary.)
>
> I don't understand why it's happy with MAP_PRIVATE but doesn't like
> MAP_SHARED.
>
What does getpagesize() say? It should be 4096.
What bothers me is the 1.3.x Linux kernel manpage talks about MAP_ANON
being implemented.
[..]
The above three flags are described in POSIX.1b (formerly
POSIX.4). Linux also knows about MAP_DENYWRITE, MAP_EXE-
CUTABLE and MAP_ANON(YMOUS).
[..]
- Ben
More information about the openssh-unix-dev
mailing list