[Devel] Re: [RFC v14-rc2][PATCH 06/29] Dump memory address space

Oren Laadan orenl at cs.columbia.edu
Mon Apr 6 21:57:44 PDT 2009



Sukadev Bhattiprolu wrote:
> One comment below.

Thanks .. (and the other reviews as well - I fixed all of them)

[...]

> | +static char *
> | +cr_fill_fname(struct path *path, struct path *root, char *buf, int *n)
> | +{
> | +	struct path tmp = *root;
> | +	char *fname;
> | +
> | +	BUG_ON(!buf);
> | +	spin_lock(&dcache_lock);
> | +	fname = __d_path(path, &tmp, buf, *n);
> | +	spin_unlock(&dcache_lock);
> | +	if (!IS_ERR(fname))
> | +		*n = (buf + (*n) - fname);
> | +	/*
> | +	 * FIXME: if __d_path() changed these, it must have stepped out of
> | +	 * init's namespace. Since currently we require a unified namespace
> | +	 * within the container: simply fail.
> | +	 */
> | +	if (tmp.mnt != root->mnt || tmp.dentry != root->dentry)
> | +		fname = ERR_PTR(-EBADF);
> | 
> 
> Shouldn't this be under if (!IS_ERR(fname)) ? 'tmp' may be uninitialized
> if __d_path() fails with ENAMETOOLONG. Even otherwise, it may be better
> to report the error from __dpath() first ?
> 

True, fixed.

Oren.
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list