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]
Message-ID: <tip-cc59c9e8d0165c632fd056c4a23e36f917507fb4@git.kernel.org>
Date:	Tue, 24 Mar 2009 15:48:27 GMT
From:	Lai Jiangshan <laijs@...fujitsu.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
	fweisbec@...il.com, srostedt@...hat.com, tglx@...utronix.de,
	laijs@...fujitsu.com, mingo@...e.hu
Subject: [tip:tracing/ftrace] ftrace: show virtual PID

Commit-ID:  cc59c9e8d0165c632fd056c4a23e36f917507fb4
Gitweb:     http://git.kernel.org/tip/cc59c9e8d0165c632fd056c4a23e36f917507fb4
Author:     Lai Jiangshan <laijs@...fujitsu.com>
AuthorDate: Tue, 24 Mar 2009 11:03:01 +0800
Committer:  Ingo Molnar <mingo@...e.hu>
CommitDate: Tue, 24 Mar 2009 16:42:49 +0100

ftrace: show virtual PID

Impact: fix PID output under namespaces

When current namespace is not the global namespace,
pid read from set_ftrace_pid is no correct.

 # ~/newpid_namespace_run bash
 # echo $$
 1
 # echo 1 > set_ftrace_pid
 # cat set_ftrace_pid
 3756

Since we write virtual PID to set_ftrace_pid, we need get
virtual PID when we read it.

Signed-off-by: Lai Jiangshan <laijs@...fujitsu.com>
Cc: Steven Rostedt <srostedt@...hat.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
LKML-Reference: <49C84D65.9050606@...fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@...e.hu>


---
 kernel/trace/ftrace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 02d2de9..bb37711 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2264,7 +2264,7 @@ ftrace_pid_read(struct file *file, char __user *ubuf,
 	if (ftrace_pid_trace == ftrace_swapper_pid)
 		r = sprintf(buf, "swapper tasks\n");
 	else if (ftrace_pid_trace)
-		r = sprintf(buf, "%u\n", pid_nr(ftrace_pid_trace));
+		r = sprintf(buf, "%u\n", pid_vnr(ftrace_pid_trace));
 	else
 		r = sprintf(buf, "no pid\n");
 
--
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