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-next>] [day] [month] [year] [list]
Message-Id: <1316127412-1912-1-git-send-email-andi@firstfloor.org>
Date:	Thu, 15 Sep 2011 15:56:49 -0700
From:	Andi Kleen <andi@...stfloor.org>
To:	a.p.zijlstra@...llo.nl
Cc:	acme@...stprotocols.net, linux-kernel@...r.kernel.org,
	Andi Kleen <ak@...ux.intel.com>
Subject: [PATCH 1/4] ptrace: Add variant of profile_pc for passing in pc

From: Andi Kleen <ak@...ux.intel.com>

Add a variant of profile_pc() that allows passing in the
instruction pointer.

Signed-off-by: Andi Kleen <ak@...ux.intel.com>
---
 arch/x86/include/asm/ptrace.h |    1 +
 arch/x86/kernel/time.c        |    9 ++++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h
index 3566454..0fafaac 100644
--- a/arch/x86/include/asm/ptrace.h
+++ b/arch/x86/include/asm/ptrace.h
@@ -139,6 +139,7 @@ struct cpuinfo_x86;
 struct task_struct;
 
 extern unsigned long profile_pc(struct pt_regs *regs);
+extern unsigned long __profile_pc(unsigned long pc, struct pt_regs *regs);
 #define profile_pc profile_pc
 
 extern unsigned long
diff --git a/arch/x86/kernel/time.c b/arch/x86/kernel/time.c
index 5a64d05..cd98120 100644
--- a/arch/x86/kernel/time.c
+++ b/arch/x86/kernel/time.c
@@ -26,10 +26,8 @@
 DEFINE_VVAR(volatile unsigned long, jiffies) = INITIAL_JIFFIES;
 #endif
 
-unsigned long profile_pc(struct pt_regs *regs)
+unsigned long __profile_pc(unsigned long pc, struct pt_regs *regs)
 {
-	unsigned long pc = instruction_pointer(regs);
-
 	if (!user_mode_vm(regs) && in_lock_functions(pc)) {
 #ifdef CONFIG_FRAME_POINTER
 		return *(unsigned long *)(regs->bp + sizeof(long));
@@ -49,6 +47,11 @@ unsigned long profile_pc(struct pt_regs *regs)
 	}
 	return pc;
 }
+
+unsigned long profile_pc(struct pt_regs *regs)
+{
+	return __profile_pc(instruction_pointer(regs), regs);
+}
 EXPORT_SYMBOL(profile_pc);
 
 /*
-- 
1.7.4.4

--
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