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]
Date:   Thu, 28 May 2020 12:09:56 +0800
From:   liuchao <liuchao173@...wei.com>
To:     <mingo@...nel.org>, <tglx@...utronix.de>
CC:     <linux-kernel@...r.kernel.org>, <hushiyuan@...wei.com>,
        <hewenliang4@...wei.com>, liuchao <liuchao173@...wei.com>
Subject: [RFC] decrease tsk->signal->live before profile_task_exit

I want to dermine which thread is the last one to enter
do_exit in profile_task_exit. But when a lot of threads
exit, tsk->signal->live is not correct since it decrease
after profile_task_exit.

Signed-off-by: liuchao <liuchao173@...wei.com>
---
 kernel/exit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/exit.c b/kernel/exit.c
index ce2a75bc0ade..1693764bc356 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -708,6 +708,7 @@ void __noreturn do_exit(long code)
 	struct task_struct *tsk = current;
 	int group_dead;
 
+	group_dead = atomic_dec_and_test(&tsk->signal->live);
 	profile_task_exit(tsk);
 	kcov_task_exit(tsk);
 
@@ -755,7 +756,6 @@ void __noreturn do_exit(long code)
 	if (tsk->mm)
 		sync_mm_rss(tsk->mm);
 	acct_update_integrals(tsk);
-	group_dead = atomic_dec_and_test(&tsk->signal->live);
 	if (group_dead) {
 		/*
 		 * If the last thread of global init has exited, panic
-- 
2.19.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ