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: <20090506053322.GA31981@redhat.com>
Date:	Wed, 6 May 2009 07:33:22 +0200
From:	Oleg Nesterov <oleg@...hat.com>
To:	Roland McGrath <roland@...hat.com>
Cc:	linux-kernel@...r.kernel.org
Subject: [FOR REVIEW, PATCH 1/2] shift "ptrace implies WUNTRACED" from
	ptrace_do_wait() to wait_task_stopped()

No functional changes, preparation for the next patch.

ptrace_do_wait() adds WUNTRACED to options for wait_task_stopped()
which should always accept the stopped tracee, even if do_wait() was
called without WUNTRACED.

Change wait_task_stopped() to check "ptrace || WUNTRACED" instead.
This makes the code more explicit, and "int options" argument becomes
const in do_wait() pathes.

Signed-off-by: Oleg Nesterov <oleg@...hat.com>
---

 kernel/exit.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

--- PTRACE/kernel/exit.c~1_WUNTRACED	2009-05-03 23:24:14.000000000 +0200
+++ PTRACE/kernel/exit.c	2009-05-06 01:48:51.000000000 +0200
@@ -1330,7 +1330,8 @@ static int wait_task_stopped(int ptrace,
 	uid_t uid = 0; /* unneeded, required by compiler */
 	pid_t pid;
 
-	if (!(options & WUNTRACED))
+	/* Traditionally we see ptrace'd stopped tasks regardless of options */
+	if (!ptrace && !(options & WUNTRACED))
 		return 0;
 
 	exit_code = 0;
@@ -1548,11 +1549,6 @@ static int ptrace_do_wait(struct task_st
 {
 	struct task_struct *p;
 
-	/*
-	 * Traditionally we see ptrace'd stopped tasks regardless of options.
-	 */
-	options |= WUNTRACED;
-
 	list_for_each_entry(p, &tsk->ptraced, ptrace_entry) {
 		int ret = wait_consider_task(tsk, 1, p, notask_error,
 					     type, pid, options,

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