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>] [day] [month] [year] [list]
Message-Id: <20200516121535.387997-1-me@upsuper.org>
Date:   Sat, 16 May 2020 22:15:35 +1000
From:   Xidorn Quan <me@...uper.org>
To:     linux-kernel@...r.kernel.org
Cc:     Balbir Singh <bsingharora@...il.com>, Xidorn Quan <me@...uper.org>
Subject: [PATCH] taskstats: set version field for tgid exit

Currently, an aggregated taskstats struct for task group exit does not
have its version field set. This patch fixes it.

Signed-off-by: Xidorn Quan <me@...uper.org>
---
Users of taskstats may expect that version of the struct is always set
up properly, so that they can check whether it's supported.
---
 kernel/taskstats.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/kernel/taskstats.c b/kernel/taskstats.c
index e2ac0e37c4ae..c646b27f18ac 100644
--- a/kernel/taskstats.c
+++ b/kernel/taskstats.c
@@ -258,18 +258,21 @@ static int fill_stats_for_tgid(pid_t tgid, struct taskstats *stats)
 static void fill_tgid_exit(struct task_struct *tsk)
 {
 	unsigned long flags;
+	struct taskstats *stats;
 
 	spin_lock_irqsave(&tsk->sighand->siglock, flags);
-	if (!tsk->signal->stats)
+	stats = tsk->signal->stats;
+	if (!stats)
 		goto ret;
 
 	/*
 	 * Each accounting subsystem calls its functions here to
 	 * accumalate its per-task stats for tsk, into the per-tgid structure
 	 *
-	 *	per-task-foo(tsk->signal->stats, tsk);
+	 *	per-task-foo(stats, tsk);
 	 */
-	delayacct_add_tsk(tsk->signal->stats, tsk);
+	delayacct_add_tsk(stats, tsk);
+	stats->version = TASKSTATS_VERSION;
 ret:
 	spin_unlock_irqrestore(&tsk->sighand->siglock, flags);
 	return;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ