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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 11 Aug 2016 09:20:40 -0700
From:	tip-bot for Frederic Weisbecker <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	torvalds@...ux-foundation.org, pbonzini@...hat.com,
	mingo@...nel.org, kernellwp@...il.com, hpa@...or.com,
	riel@...hat.com, linux-kernel@...r.kernel.org,
	peterz@...radead.org, rkrcmar@...hat.com, fweisbec@...il.com,
	wanpeng.li@...mail.com, tglx@...utronix.de
Subject: [tip:sched/urgent] sched/cputime: Fix omitted ticks passed in
 parameter

Commit-ID:  26f2c75cd2cf10a6120ef02ca9a94db77cc9c8e0
Gitweb:     http://git.kernel.org/tip/26f2c75cd2cf10a6120ef02ca9a94db77cc9c8e0
Author:     Frederic Weisbecker <fweisbec@...il.com>
AuthorDate: Thu, 11 Aug 2016 14:58:24 +0200
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Thu, 11 Aug 2016 16:34:37 +0200

sched/cputime: Fix omitted ticks passed in parameter

Commit:

  f9bcf1e0e014 ("sched/cputime: Fix steal time accounting")

... fixes a leak on steal time accounting but forgets to account
the ticks passed in parameters, assuming there is only one to
take into account.

Let's consider that parameter back.

Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
Acked-by: Wanpeng Li <kernellwp@...il.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Paolo Bonzini <pbonzini@...hat.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Radim <rkrcmar@...hat.com>
Cc: Rik van Riel <riel@...hat.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Wanpeng Li <wanpeng.li@...mail.com>
Cc: linux-tip-commits@...r.kernel.org
Link: http://lkml.kernel.org/r/20160811125822.GB4214@lerouge
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 kernel/sched/cputime.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c
index 8b9bcc5..9858266 100644
--- a/kernel/sched/cputime.c
+++ b/kernel/sched/cputime.c
@@ -509,12 +509,13 @@ void account_process_tick(struct task_struct *p, int user_tick)
 void account_idle_ticks(unsigned long ticks)
 {
 	cputime_t cputime, steal;
+
 	if (sched_clock_irqtime) {
 		irqtime_account_idle_ticks(ticks);
 		return;
 	}
 
-	cputime = cputime_one_jiffy;
+	cputime = jiffies_to_cputime(ticks);
 	steal = steal_account_process_time(cputime);
 
 	if (steal >= cputime)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ