lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <164208573722.1590449.5826836279460018409.stgit@devnote2>
Date:   Thu, 13 Jan 2022 23:55:37 +0900
From:   Masami Hiramatsu <mhiramat@...nel.org>
To:     Steven Rostedt <rostedt@...dmis.org>
Cc:     Jianhua Liu <jianhua.ljh@...il.com>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        linux-kernel@...r.kernel.org, Wang Nan <wangnan0@...wei.com>
Subject: [PATCH 1/3] ARM: kprobes: Count MAX_OPTINSN_SIZE in kprobe_opcode_t

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@...il.com>
Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
Cc: Wang Nan <wangnan0@...wei.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 {

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ