Subject: Re: pipe(2) and invalid fildes
To: Perry E. Metzger <perry@wasabisystems.com>
From: Jaromír <jdolecek@netbsd.org>
List: tech-kern
Date: 09/29/2001 23:13:29
Perry E. Metzger wrote:
> SuS states a minimum set of behaviors, not all the behaviors that an
> implementation may have. It is perfectly fine for an implementation to
> catch more errors than SuSv2 specifies, and indeed, removing error
> handling capability seems wrong. In particular, I think that it is
> reasonable for pipe() to detect that it has been passed an invalid
> pointer and do something reasonable instead of crashing.

No functionality would be removed.

Note it's the userland stub which segvs or accesses invalid
memory, the actual syscall is called very specially IIRC.

Currently the EFAULT is NOT returned, even through it's in manpage.
So, the documentation doesn't match implementation.  Either of
those needs to be changed. I think it's more reasonable to remove
the incorrect paragraph from documentation that it's changing the
libc stubs to let kernel check validity of the pointer (the stubs
are written the special way for performance reasons IIRC).

Jaromir
P.S. Hmm, I realized tech-kern@ is actually not quite sufficient. Adding
     tech-userlevel@ too.
-- 
Jaromir Dolecek <jdolecek@NetBSD.org>      http://www.ics.muni.cz/~dolecek/
NetBSD - just plain best OS! -=*=- Got spare MCA cards or docs? Hand me them!