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:	Thu, 28 May 2009 13:41:00 +0200
From:	Oleg Nesterov <oleg@...hat.com>
To:	Roland McGrath <roland@...hat.com>
Cc:	Christoph Hellwig <hch@...radead.org>, Ingo Molnar <mingo@...e.hu>,
	linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 11/12 v2] ptrace: mv task_struct->ptrace_message
	ptrace_ctx->message

On 05/28, Oleg Nesterov wrote:
>
> ptrace_event() can use current->ptrace_ctx safely. If mask == 0 and we do
> not check task_ptrace() we are called from tracehook_report_clone_complete(),
> in this case trace == T means current was traced when it called do_fork().

Perhaps it is better to optimize out "mask != 0" check in ptrace_event().
This special !mask case is only needed for _report_clone(), we can use
mask == PT_PTRACED instead.

Oleg.

--- PTRACE/include/linux/ptrace.h~10_HOOK_COMPLETE	2009-05-28 11:19:33.000000000 +0200
+++ PTRACE/include/linux/ptrace.h	2009-05-28 11:49:29.000000000 +0200
@@ -157,7 +157,7 @@ int generic_ptrace_pokedata(struct task_
  */
 static inline int ptrace_event(int mask, int event, unsigned long message)
 {
-	if (mask && likely(!(task_ptrace(current) & mask)))
+	if (likely(!(task_ptrace(current) & mask)))
 		return 0;
 	current->ptrace_message = message;
 	ptrace_notify((event << 8) | SIGTRAP);
--- PTRACE/include/linux/tracehook.h~10_HOOK_COMPLETE	2009-05-28 08:41:11.000000000 +0200
+++ PTRACE/include/linux/tracehook.h	2009-05-28 11:50:14.000000000 +0200
@@ -344,7 +344,7 @@ static inline void tracehook_report_clon
 						   struct task_struct *child)
 {
 	if (unlikely(trace))
-		ptrace_event(0, trace, pid);
+		ptrace_event(PT_PTRACED, trace, pid);
 }
 
 /**

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