Re: [git pull] apparmor fix for __d_path() misuse

From: Tetsuo Handa
Date: Wed Dec 07 2011 - 00:44:39 EST


Al Viro wrote:
> > So, can we keep behavior of tomoyo_get_absolute_path() unchanged?
>
> Sure, you are always free to add
> if (pos == ERR_PTR(-EINVAL)) {
> pos = dentry_path(path->dentry, ...)
> /* do whatever you want to buffer to indicate that
> * beginning had been lost
> */
> }

Maybe I can call tomoyo_get_local_path() if tomoyo_get_absolute_path() failed
with -EINVAL.

> Or you might want to do __d_path() from (path->mnt,path->mnt->mnt_root) to
> path - that's the path from the last mountpoint to your object; i.e. it may
> be shorter if that vfsmount had been a binding into the guts of filesystem,
> but that is what __d_path() as you used it would stabilize to once the race
> window is over.

Excuse me, what "once the race window is over" means?
Does

do {
pos = d_absolute_path(path, buffer, buflen - 1);
} while (pos == ERR_PTR(-EINVAL));

work (i.e. racing with "umount -l" is a temporary failure)?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/