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: <1206455513.17227.4.camel@elijah.suse.cz>
Date:	Tue, 25 Mar 2008 15:31:53 +0100
From:	Petr Tesarik <ptesarik@...e.cz>
To:	linux-kernel@...r.kernel.org
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Roland McGrath <roland@...hat.com>,
	Oleg Nesterov <oleg@...sign.ru>
Subject: [PATCH] Discard notification signals when a tracer exits

When a tracer exits without detaching from the traced process, the
tracee may be at a tracer notification stop and will thus interpret
the value in task->exit_code (SIGTRAP | 0x80) as the signal to be
delivered.

This patch fixes the problem by clearing exit_code when detaching
the traced process from a dying tracer.

Signed-off-by: Petr Tesarik <ptesarik@...e.cz>

---
 exit.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -642,8 +642,10 @@ reparent_thread(struct task_struct *p, s
 			/*
 			 * If it was at a trace stop, turn it into
 			 * a normal stop since it's no longer being
-			 * traced.
+			 * traced.  Cancel the notification signal,
+			 * or the tracee may get a SIGTRAP.
 			 */
+			p->exit_code = 0;
 			ptrace_untrace(p);
 		}
 	}
@@ -713,6 +715,10 @@ static void forget_original_parent(struc
 			p->real_parent = reaper;
 			reparent_thread(p, father, 0);
 		} else {
+			/* cancel the notification signal at a trace stop */
+			if (p->state == TASK_TRACED)
+				p->exit_code = 0;
+
 			/* reparent ptraced task to its real parent */
 			__ptrace_unlink (p);
 			if (p->exit_state == EXIT_ZOMBIE && p->exit_signal != -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