Re: howto set some kernel pages to readonly?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

On Thu, Apr 07, 2011 at 08:26:36PM +0200, Peter Wächtler wrote:
> Hello Linux ARM developers,
> on Linux x86 there is infrastructure to set rodata to, aeh, readonly. ;)
> I also want to protect some pages to readonly  as a guard.
> So if some kernel code writes to the memory the kernel panics.
> I tried the following without success:
> And I have to admit that I don't understand all the macros for 
> manipulating the page table entries ;(
> Any clue what's wrong?

We don't map kernel space using pages, but section mappings which have a
granularity of 1MB.

That makes it difficult to set read-only status on just small areas of
memory because you'd have to ensure that the .rodata starts at a 1MB
boundary, and the following data also starts at a 1MB boundary - which
would be quite wasteful.

linux-arm-kernel mailing list

[Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [PDAs]     [Linux]     [Linux Book List]     [Linux MIPS]     [Yosemite Campsites]     [Photos]

Add to Google Follow linuxarm on Twitter