setting RO permissions for kernel text does not work when XN bit is set for the section before _stext

Karthik Srinivasamurthy yesskarthik at gmail.com
Wed Nov 29 18:45:53 PST 2017


Hello,

I am on kernel 3.12.19 on a cortex A7 quad core SOC. I integrated
Laura's patch to set the kernel text RO, but i couldn't get it  to
work and i see something strange.
While experimenting, i cleared the XN bit for the 1MB section before
the _stext, which has the page tables etc, prior to setting RO perms
on the text area. Then i see the kernel panic with permission fault
80d, every time i try corrupting the text space. If i don't clear the
XN bit
on the section preceding the _stext, then it lets me corrupt the text
section happily.
I am confused as to what the co-relation is? any help in clarifying is
much appreciated.


Thanks
Karthik



More information about the linux-arm-kernel mailing list