lkml.org 
[lkml]   [2020]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v5 4/6] arch/x86: kprobes: Use text_alloc() and text_free()
    Date
    Use text_alloc() and text_free() to implement alloc_insn_page() and
    free_insn_page().

    Cc: linux-mm@kvack.org
    Cc: Andi Kleen <ak@linux.intel.com>
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>Im
    ---
    arch/x86/kernel/kprobes/core.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
    index ada39ddbc922..9e57452b3a51 100644
    --- a/arch/x86/kernel/kprobes/core.c
    +++ b/arch/x86/kernel/kprobes/core.c
    @@ -423,7 +423,7 @@ void *alloc_insn_page(void)
    {
    void *page;

    - page = module_alloc(PAGE_SIZE);
    + page = text_alloc(PAGE_SIZE);
    if (!page)
    return NULL;

    @@ -446,7 +446,7 @@ void *alloc_insn_page(void)
    /* Recover page to RW mode before releasing it */
    void free_insn_page(void *page)
    {
    - module_memfree(page);
    + text_free(page);
    }

    static int arch_copy_kprobe(struct kprobe *p)
    --
    2.25.1
    \
     
     \ /
      Last update: 2020-07-24 07:07    [W:4.131 / U:0.072 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site