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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081202221244.GA991@us.ibm.com>
Date:	Tue, 2 Dec 2008 14:12:45 -0800
From:	Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>
To:	Bastian Blank <bastian@...di.eu.org>, oleg@...hat.com,
	ebiederm@...ssion.com, roland@...hat.com,
	containers@...ts.osdl.org, linux-kernel@...r.kernel.org,
	xemul@...nvz.org
Subject: Re: [RFC][PATCH 1/5] pid: Implement ns_of_pid

Bastian Blank [bastian@...di.eu.org] wrote:
| On Mon, Dec 01, 2008 at 12:24:22PM -0800, Sukadev Bhattiprolu wrote:
| > Bastian Blank [bastian@...di.eu.org] wrote:
| > | On Tue, Nov 25, 2008 at 07:44:42PM -0800, Sukadev Bhattiprolu wrote:
| > | > +/* ns_of_pid returns the pid namespace in which the specified
| > | > + * pid was allocated.
| > | > + */
| > | > +static inline struct pid_namespace *ns_of_pid(struct pid *pid)
| > | > +{
| > | > +	struct pid_namespace *ns = NULL;
| > | > +	if (pid)
| > | > +		ns = pid->numbers[pid->level].ns;
| > | > +	return ns;
| > | > +}
| > | > +
| > | When can the pid argument be null?
| > Soon after creation but more importantly, after detach_pid()
| > (release_task).
| 
| pid is a function argument and the function does not call detach_pid. So
| please try again.

ns_of_pid() like pid_nr(), pid_nr_ns(), pid_task() etc is a low level helper
unction. ns_of_pid(), like the other helpers can potentially be called for a
process that has already called detach_pid() (i.e for a task that is exiting
but not yet waited on).  Hence the 'if (pid)' in ns_of_pid().

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