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: <20070313044546.GE8884@us.ibm.com>
Date:	Mon, 12 Mar 2007 21:45:46 -0700
From:	sukadev@...ibm.com
To:	Andrew Morton <akpm@...l.org>
Cc:	Cedric Le Goater <clg@...ibm.com>,
	Dave Hansen <haveblue@...ibm.com>,
	Serge Hallyn <serue@...ibm.com>,
	Eric Biederman <ebiederm@...ssion.com>,
	Herbert Poetzl <herbert@...hfloor.at>,
	containers@...ts.osdl.org, linux-kernel@...r.kernel.org
Subject: [PATCH 5/5] Use task_pgrp() task_session() in copy_process()


From: Sukadev Bhattiprolu <sukadev@...ibm.com>
Subject: [PATCH 5/5] Use task_pgrp() task_session() in copy_process().

Use task_pgrp() and task_session() in copy_process(), and
avoid find_pid() call when attaching the task to its process
group and session.

Signed-off-by: Sukadev Bhattiprolu <sukadev@...ibm.com>
Cc: Cedric Le Goater <clg@...ibm.com>
Cc: Dave Hansen <haveblue@...ibm.com>
Cc: Serge Hallyn <serue@...ibm.com>
Cc: containers@...ts.osdl.org
Acked-by: Eric W. Biederman <ebiederm@...ssion.com>
---
 kernel/fork.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Index: lx26-21-rc3-mm2/kernel/fork.c
===================================================================
--- lx26-21-rc3-mm2.orig/kernel/fork.c	2007-03-12 17:18:03.000000000 -0700
+++ lx26-21-rc3-mm2/kernel/fork.c	2007-03-12 17:18:11.000000000 -0700
@@ -1252,14 +1252,11 @@ static struct task_struct *copy_process(
 	tracehook_init_task(p);
 
 	if (thread_group_leader(p)) {
-		pid_t pgid = process_group(current);
-		pid_t sid = process_session(current);
-
 		p->signal->tty = current->signal->tty;
-		p->signal->pgrp = pgid;
+		p->signal->pgrp = process_group(current);
 		set_signal_session(p->signal, process_session(current));
-		attach_pid(p, PIDTYPE_PGID, find_pid(pgid));
-		attach_pid(p, PIDTYPE_SID, find_pid(sid));
+		attach_pid(p, PIDTYPE_PGID, task_pgrp(current));
+		attach_pid(p, PIDTYPE_SID, task_session(current));
 
 		list_add_tail_rcu(&p->tasks, &init_task.tasks);
 		__get_cpu_var(process_counts)++;
-
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