Re: A question about PROT_NONE on ARM and ARM26

From: Russell King
Date: Wed Jun 30 2004 - 03:17:46 EST


On Wed, Jun 30, 2004 at 03:44:34AM +0100, Jamie Lokier wrote:
> My question is: if the _kernel_ reads a PROT_NONE page, will it fault?
> It looks likely to me.

There are two different types of privileged accesses on ARM. One is the
standard load/store instruction, which checks the permissions for the
current processor mode. The other is one which simulates a user mode
access to the address.

We use the latter for get_user/put_user/copy_to_user/copy_from_user.

> This means that calling write() with a PROT_NONE region would succeed,
> wouldn't it?

No, because the uaccess.h function will fault, and we'll end up returning
-EFAULT.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/
2.6 Serial core
-
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/