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:	Mon, 05 Jan 2009 17:11:00 -0500
From:	Masami Hiramatsu <mhiramat@...hat.com>
To:	"Rafael J. Wysocki" <rjw@...k.pl>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Ananth N Mavinakayanahalli <ananth@...ibm.com>
CC:	"Cheng Renquan (程任全)" <crquan@...il.com>,
	Arjan van de Ven <arjan@...ux.intel.com>,
	Al Viro <viro@...iv.linux.org.uk>,
	Matt Helsley <matthltc@...ibm.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Adrian Bunk <bunk@...nel.org>, anil.s.keshavamurthy@...el.com,
	davem@...emloft.net, linux-kernel@...r.kernel.org,
	Pavel Machek <pavel@...e.cz>
Subject: [PATCH] kprobes: check CONFIG_FREEZER instead of CONFIG_PM

Hi,

Rafael J. Wysocki wrote:
> On Monday 05 January 2009, Cheng Renquan (程任全) wrote:
>> 1. "check_safety" in "kernel/kprobes.c" call thaw_processes if both
>> CONFIG_PREEMPT and CONFIG_PM defined,
>> 2. "thaw_processes" function is implemented in "kernel/power/process.c",
>> 3. but it is only used if CONFIG_FREEZER defined, from <linux/freezer.h>,
>> 4. else (CONFIG_FREEZER undefined) it's a null macro defined in
>> <linux/freezer.h>,
>> 5. but process.o only get compile if CONFIG_PM_SLEEP defined, from
>> "kernel/power/Makefile",
>>
>> Now I'm confused on how to resolve this?
> 
> I'd make process.o depend on CONFIG_FREEZER (patch below).

Thank you for fixing.
In addition, I think that kprobes also should check CONFIG_FREEZER
instead of CONFIG_PM.
---
From: Masami Hiramatsu <mhiramat@...hat.com>

Check CONFIG_FREEZER instead of CONFIG_PM because kprobe booster
depends on freeze_processes() and thaw_processes() when CONFIG_PREEMPT=y.

This fixes a linkage error which occurs when CONFIG_PREEMPT=y, CONFIG_PM=y
and CONFIG_FREEZER=n.

Reported-by: Cheng Renquan <crquan@...il.com>
Signed-off-by: Masami Hiramatsu <mhiramat@...hat.com>
---
 arch/ia64/kernel/kprobes.c |    2 +-
 arch/x86/kernel/kprobes.c  |    2 +-
 kernel/kprobes.c           |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

Index: 2.6.28/arch/ia64/kernel/kprobes.c
===================================================================
--- 2.6.28.orig/arch/ia64/kernel/kprobes.c
+++ 2.6.28/arch/ia64/kernel/kprobes.c
@@ -868,7 +868,7 @@ static int __kprobes pre_kprobes_handler
 		return 1;

 ss_probe:
-#if !defined(CONFIG_PREEMPT) || defined(CONFIG_PM)
+#if !defined(CONFIG_PREEMPT) || defined(CONFIG_FREEZER)
 	if (p->ainsn.inst_flag == INST_FLAG_BOOSTABLE && !p->post_handler) {
 		/* Boost up -- we can execute copied instructions directly */
 		ia64_psr(regs)->ri = p->ainsn.slot;
Index: 2.6.28/arch/x86/kernel/kprobes.c
===================================================================
--- 2.6.28.orig/arch/x86/kernel/kprobes.c
+++ 2.6.28/arch/x86/kernel/kprobes.c
@@ -445,7 +445,7 @@ void __kprobes arch_prepare_kretprobe(st
 static void __kprobes setup_singlestep(struct kprobe *p, struct pt_regs *regs,
 				       struct kprobe_ctlblk *kcb)
 {
-#if !defined(CONFIG_PREEMPT) || defined(CONFIG_PM)
+#if !defined(CONFIG_PREEMPT) || defined(CONFIG_FREEZER)
 	if (p->ainsn.boostable == 1 && !p->post_handler) {
 		/* Boost up -- we can execute copied instructions directly */
 		reset_current_kprobe();
Index: 2.6.28/kernel/kprobes.c
===================================================================
--- 2.6.28.orig/kernel/kprobes.c
+++ 2.6.28/kernel/kprobes.c
@@ -122,7 +122,7 @@ static int collect_garbage_slots(void);
 static int __kprobes check_safety(void)
 {
 	int ret = 0;
-#if defined(CONFIG_PREEMPT) && defined(CONFIG_PM)
+#if defined(CONFIG_PREEMPT) && defined(CONFIG_FREEZER)
 	ret = freeze_processes();
 	if (ret == 0) {
 		struct task_struct *p, *q;



-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@...hat.com


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