lkml.org 
[lkml]   [2011]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [git pull] apparmor fix for __d_path() misuse
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?


\
 
 \ /
  Last update: 2011-12-07 02:47    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog