Hi.

> You know, you really are supposed to understand the code you are modifying...
> Quiz: what are those vfsmounts and how are they related?
>
These two vfsmounts should be same since the kernel doesn't support
rename or link operations that accrosses mount points.
So, we don't have to pass both old_vfsmount and new_vfsmount, do we?

By the way, there may be other approach to pass vfsmount to LSM hooks.

Instead of adding vfsmount parameter to VFS helper functions,
you could define

static inline struct dentry *save_vfsmount(struct dentry *dentry, struct 
vfsmount *vfsmount)
{
        current->last_vfsmount = vfsmount;
        return dentry;
}

and add

struct vfsmount *vfsmount;

to "struct task_struct" and use it like

-       host_err = vfs_rename(fdir, odentry, tdir, ndentry);
+       host_err = vfs_rename(fdir, save_vfsmount(odentry, 
ffhp->fh_export->ex_mnt), tdir, ndentry);

and read "current->last_vfsmount" from LSM functions.

This will keep number of parameters unchanged.

Regards.
-
To unsubscribe from this list: send the line "unsubscribe 
linux-security-module" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to