lkml.org 
[lkml]   [2022]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/3] ARM: kprobes: Count MAX_OPTINSN_SIZE in kprobe_opcode_t
Date
Count the MAX_OPTINSN_SIZE in 'kprobe_opcode_t' instead
of in byte. On arm, the sizeof(kprobe_opcode_t) is u32,
thus the current code consumes 4 times larger memory for
trampoline buffer.

Fixes: 0dc016dbd820 ("ARM: kprobes: enable OPTPROBES for ARM 32")
Reported-by: Jianhua Liu <jianhua.ljh@gmail.com>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
---
arch/arm/include/asm/kprobes.h | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/kprobes.h b/arch/arm/include/asm/kprobes.h
index e26a278d301a..092263a89102 100644
--- a/arch/arm/include/asm/kprobes.h
+++ b/arch/arm/include/asm/kprobes.h
@@ -56,8 +56,7 @@ extern __visible kprobe_opcode_t optprobe_template_restore_end[];

#define MAX_OPTIMIZED_LENGTH 4
#define MAX_OPTINSN_SIZE \
- ((unsigned long)optprobe_template_end - \
- (unsigned long)optprobe_template_entry)
+ (unsigned long)(optprobe_template_end - optprobe_template_entry)
#define RELATIVEJUMP_SIZE 4

struct arch_optimized_insn {
\
 
 \ /
  Last update: 2022-01-13 15:57    [W:0.037 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site