Re: A question about PROT_NONE on Sparc and Sparc64
[email protected] Wed, 30 Jun 2004 15:21:07 +0000
| Newsgroups | org.kernel.vger.ultralinux,org.kernel.vger.linux-kernel,org.kernel.vger.sparclinux |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Jun 29, 2004 at 10:17:11PM -0700, David S. Miller wrote: > > In include/asm-sparc/pgtsrmmu.h, there's: > > > > #define SRMMU_PAGE_NONE __pgprot(SRMMU_VALID | SRMMU_CACHE | \ > > SRMMU_PRIV | SRMMU_REF) > > #define SRMMU_PAGE_RDONLY __pgprot(SRMMU_VALID | SRMMU_CACHE | \ > > SRMMU_EXEC | SRMMU_REF) > > > > This one bothers me. The difference is that PROT_NONE pages are not > > accessible to userspace, and not executable. > > > > So userspace will get a fault if it tries to read a PROT_NONE page. > > > > But what happens when the kernel reads one? Don't those bits mean > > that the read will succeed? I.e. write() on a PROT_NONE page will > > succeed, instead of returning EFAULT? > > > > If so, this is a bug. A minor bug, perhaps, but nonetheless I wish to > > document it. > > Yes this one is a bug and not intentional. > > Keith W., we need to fix this. Probably the simplest fix is just to > drop the SRMMU_VALID bit. Ok, I'll try this approach and see what happens. -- Keith M Wesolowski