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

From: Al Viro
Date: Tue Dec 06 2011 - 20:45:01 EST


On Wed, Dec 07, 2011 at 01:37:20AM +0000, Al Viro wrote:
> + if (path->mnt->mnt_flags & MNT_INTERNAL) {
> + /* it's not mounted anywhere */
> + res = dentry_path(path->dentry, buf, buflen);
> + *name = res;
> + if (IS_ERR(res)) {
> + *name = buf;
> + return PTR_ERR(res);
> + }
> + if (path->dentry->d_sb->s_magic == PROC_SUPER_MAGIC &&
> + strncmp(*name, "/sys/", 5) == 0) {
> + /* TODO: convert over to using a per namespace
> + * control instead of hard coded /proc
> + */
> + return prepend(name, *name - buf, "/proc", 5);


Incidentally, why only /proc/sys? For one thing, we won't be accessing
anything else on internal vfsmount of proc, so strncmp() part looks
wrong; for another, if some code starts doing that, why would acting
as if it was on normally mounted /proc be the wrong thing? John?
--
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/