[PATCH 5/5] x86/ftrace: Make sure that ftrace trampolines are not RWX

2017-05-26 Thread Steven Rostedt
From: Thomas Gleixner ftrace use module_alloc() to allocate trampoline pages. The mapping of module_alloc() is RWX, which makes sense as the memory is written to right after allocation. But nothing makes these pages RO after writing to them. Add proper set_memory_rw/ro()

[PATCH 5/5] x86/ftrace: Make sure that ftrace trampolines are not RWX

2017-05-26 Thread Steven Rostedt
From: Thomas Gleixner ftrace use module_alloc() to allocate trampoline pages. The mapping of module_alloc() is RWX, which makes sense as the memory is written to right after allocation. But nothing makes these pages RO after writing to them. Add proper set_memory_rw/ro() calls to protect the