Re: A question about PROT_NONE on Sparc and Sparc64

From: wesolows
Date: Wed Jun 30 2004 - 10:23:17 EST


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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/