read_lock(&current->fs->lock); our_vfsmnt = mntget(current->fs->rootmnt); base = dget(current->fs->root); read_unlock(&current->fs->lock);  spin_lock(&vfsmount_lock); de = root; mnt = vfsmnt;  while (vfsmnt != our_vfsmnt) { if (vfsmnt == vfsmnt->mnt_parent) goto out; de = vfsmnt->mnt_mountpoint; vfsmnt = vfsmnt->mnt_parent; }  if (!is_subdir(de, base)) goto out; spin_unlock(&vfsmount_lock);  exit: dput(base); mntput(our_vfsmnt); dput(root); mntput(mnt); return res; out: spin_unlock(&vfsmount_lock); res = -EACCES; goto exit; 
return proc_check_chroot(root, vfsmnt); 
static int proc_check_root(struct inode *inode){	struct dentry *de, *base, *root;	struct vfsmount *our_vfsmnt, *vfsmnt, *mnt;	int res = 0;	if (proc_root_link(inode, &root, &vfsmnt)) /* Ewww... */		return -ENOENT;	read_lock(&current->fs->lock);	our_vfsmnt = mntget(current->fs->rootmnt);	base = dget(current->fs->root);	read_unlock(&current->fs->lock);	spin_lock(&vfsmount_lock);	de = root;	mnt = vfsmnt;	while (vfsmnt != our_vfsmnt) {		if (vfsmnt == vfsmnt->mnt_parent)			goto out;		de = vfsmnt->mnt_mountpoint;		vfsmnt = vfsmnt->mnt_parent;	}	if (!is_subdir(de, base))		goto out;	spin_unlock(&vfsmount_lock);exit:	dput(base);	mntput(our_vfsmnt);	dput(root);	mntput(mnt);	return res;out:	spin_unlock(&vfsmount_lock);	res = -EACCES;	goto exit;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/66dcca062847bcd261ebb3ac96d51101f31a8630/base.c/buggy/fs/proc/base.c