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]
Date:	Tue, 18 Mar 2008 18:38:11 +0300
From:	Oleg Nesterov <oleg@...sign.ru>
To:	"Eric W. Biederman" <ebiederm@...ssion.com>,
	Pavel Emelyanov <xemul@...nvz.org>
Cc:	linux-kernel@...r.kernel.org
Subject: rfc, leader_pid_type()

Eric, Pavel.

Without tasklist lock held, task_tgid/task_pgrp/task_session can return the
bogus NULL. Note that the last 2 can return NULL even if task == current.

What do you think if we add yet another helper?

	struct pid *leader_pid_type(struct task_struct *task, enum pid_type type)
	{
		struct pid *ret;
	retry:
		ret = task->group_leader->pids[type].pid;
		if (likely(ret != NULL) || !pid_alive(task))
			return ret;
		/*
		 * We hit the old leader in the middle of de_thread(),
		 * or setsid/setpgrp is in progress.
		 */
		cpu_relax();
		goto retry;
	}

Yes, we already have a lot helpers... The one potential user is
check_kill_permission(), but it can live without it.

What do you think, do you see other possible users? Say, do_task_stat() may
report sid = 0, but this is minor of course...

Oleg.	

--
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