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: <cfd18e0f0806250749od875635r9e533d9f834bd8c4@mail.gmail.com>
Date:	Wed, 25 Jun 2008 16:49:33 +0200
From:	"Michael Kerrisk" <mtk.manpages@...glemail.com>
To:	"Thomas Gleixner" <tglx@...utronix.de>,
	"Oleg Nesterov" <oleg@...sign.ru>
Cc:	lkml <linux-kernel@...r.kernel.org>,
	"Andrew Morton" <akpm@...ux-foundation.org>,
	"Bart Van Assche" <bart.vanassche@...il.com>
Subject: [patch] make siginfo_t si_utime + si_sstime report times in USER_HZ, not HZ

Oleg, Thomas,

In the switch to configurable HZ in 2.6, the treatment of the si_utime
and si_stime fields that are exposed to userland via the siginfo
structure looks to have been botched.  As things stand, these fields
report times in units of HZ, so that userland gets information that
varies depending on the HZ that the kernel was configured with.  This
(trivial, untested) patch changes the reported values to use USER_HZ
units.  What do you think of making this change?

Signed-off-by: Michael Kerrisk <mtk.manpages@...il.com>

--- /home/mtk/ARCHIVE/KERNEL/linux-2.6.26-rc7/kernel/signal.c.orig	2008-06-24
16:20:39.000000000 +0200
+++ /home/mtk/ARCHIVE/KERNEL/linux-2.6.26-rc7/kernel/signal.c	2008-06-24
16:22:17.000000000 +0200
@@ -1379,10 +1379,9 @@

 	info.si_uid = tsk->uid;

-	/* FIXME: find out whether or not this is supposed to be c*time. */
-	info.si_utime = cputime_to_jiffies(cputime_add(tsk->utime,
+	info.si_utime = cputime_to_clock_t(cputime_add(tsk->utime,
 						       tsk->signal->utime));
-	info.si_stime = cputime_to_jiffies(cputime_add(tsk->stime,
+	info.si_stime = cputime_to_clock_t(cputime_add(tsk->stime,
 						       tsk->signal->stime));

 	info.si_status = tsk->exit_code & 0x7f;
@@ -1450,9 +1449,8 @@

 	info.si_uid = tsk->uid;

-	/* FIXME: find out whether or not this is supposed to be c*time. */
-	info.si_utime = cputime_to_jiffies(tsk->utime);
-	info.si_stime = cputime_to_jiffies(tsk->stime);
+	info.si_utime = cputime_to_clock_t(tsk->utime);
+	info.si_stime = cputime_to_clock_t(tsk->stime);

  	info.si_code = why;
  	switch (why) {
--
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