Subject: Re: [PATCH v6] RO/NX protection for loadable kernel modules

From: Siarhei Liakh <[email-masked]>
Date: Mon, 5 Oct 2009 07:57:59 -0400

On Tue, Sep 22, 2009 at 11:49 AM, Siarhei Liakh <[email-masked]> wrote:
>> Hi Siarhei,
>>  I tried out this patch on 2.6.31, and got the following trace during bootup..
>>
>> ------------[ cut here ]------------
>> WARNING: at kernel/trace/ftrace.c:1003 ftrace_bug+0x198/0x27e() (Not tainted)
>> Hardware name: VGN-Z540N
> ...
>> ---[ end trace 95b33ebf87286ae6 ]---
>> ftrace faulted on writing [<ffffffffa0000193>] video_output_register+0x11/0x10a [output]
>>
>>
>> I guess ftrace is trying to NOP out something in the modules which
>> are marked read-only ?
>
> Entirely possible. I will review ftrace and make sure the patch
> accounts for this.

I've posted new version of the patch that also sets each module's text
as RW when ftrace preps the kernel for modifications: [PATCH v7] RO/NX
protection for loadable kernel modules

Let me know how that works for you.
Thank you.