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]
Date:	Wed,  9 Jan 2013 18:09:18 -0500
From:	Sasha Levin <sasha.levin@...cle.com>
To:	tglx@...utronix.de, mingo@...hat.com, hpa@...or.com,
	rostedt@...dmis.org, fweisbec@...il.com, rusty@...tcorp.com.au,
	ananth@...ibm.com, anil.s.keshavamurthy@...el.com,
	masami.hiramatsu.pt@...achi.com, jbaron@...hat.com
Cc:	x86@...nel.org, linux-kernel@...r.kernel.org,
	Sasha Levin <sasha.levin@...cle.com>
Subject: [PATCH 3/5] kprobes: constify check_kprobe_address_safe and friends

Constify the parameters of lookup functions.

Signed-off-by: Sasha Levin <sasha.levin@...cle.com>
---
 arch/x86/kernel/kprobes-opt.c | 8 ++++----
 kernel/kprobes.c              | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/kprobes-opt.c b/arch/x86/kernel/kprobes-opt.c
index c5e410e..5876966 100644
--- a/arch/x86/kernel/kprobes-opt.c
+++ b/arch/x86/kernel/kprobes-opt.c
@@ -192,7 +192,7 @@ static int __kprobes copy_optimized_instructions(u8 *dest, u8 *src)
 }
 
 /* Check whether insn is indirect jump */
-static int __kprobes insn_is_indirect_jump(struct insn *insn)
+static int __kprobes insn_is_indirect_jump(const struct insn *insn)
 {
 	return ((insn->opcode.bytes[0] == 0xff &&
 		(X86_MODRM_REG(insn->modrm.value) & 6) == 4) || /* Jump */
@@ -200,7 +200,7 @@ static int __kprobes insn_is_indirect_jump(struct insn *insn)
 }
 
 /* Check whether insn jumps into specified address range */
-static int insn_jump_into_range(struct insn *insn, unsigned long start, int len)
+static int insn_jump_into_range(const struct insn *insn, unsigned long start, int len)
 {
 	unsigned long target = 0;
 
@@ -278,7 +278,7 @@ static int __kprobes can_optimize(unsigned long paddr)
 }
 
 /* Check optimized_kprobe can actually be optimized. */
-int __kprobes arch_check_optimized_kprobe(struct optimized_kprobe *op)
+int __kprobes arch_check_optimized_kprobe(const struct optimized_kprobe *op)
 {
 	int i;
 	struct kprobe *p;
@@ -294,7 +294,7 @@ int __kprobes arch_check_optimized_kprobe(struct optimized_kprobe *op)
 
 /* Check the addr is within the optimized instructions. */
 int __kprobes
-arch_within_optimized_kprobe(struct optimized_kprobe *op, unsigned long addr)
+arch_within_optimized_kprobe(const struct optimized_kprobe *op, unsigned long addr)
 {
 	return ((unsigned long)op->kp.addr <= addr &&
 		(unsigned long)op->kp.addr + op->optinsn.size > addr);
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 098f396..7daddb0 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -1402,7 +1402,7 @@ static inline int check_kprobe_rereg(struct kprobe *p)
 	return ret;
 }
 
-static __kprobes int check_kprobe_address_safe(struct kprobe *p,
+static __kprobes int check_kprobe_address_safe(const struct kprobe *p,
 					       struct module **probed_mod)
 {
 	int ret = 0;
-- 
1.8.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ