Re: [AppArmor 19/45] Add struct vfsmount parameters to vfs_rename()

John Johansen
2007-10-26T18:22:55Z

[-- Attachment #1: Type: text/plain, Size: 1081 bytes --]

On Fri, Oct 26, 2007 at 08:37:49AM +0100, Al Viro wrote:
> On Thu, Oct 25, 2007 at 11:40:43PM -0700, jjohansen@suse.de wrote:
> > The vfsmount will be passed down to the LSM hook so that LSMs can compute
> > pathnames.
>
> You know, you really are supposed to understand the code you are modifying...
> Quiz: what are those vfsmounts and how are they related?
>

In the current code, both vfsmounts are always identical, and so one of
the two should go, agreed.

The thought behind passing both vfsmounts was that they could differ but
point to the same super_block, in which case renames would still be
possible at least from a filesystem point of view. The essential
restriction here is that both files must be on the same device; the vfs
restriction of not allowing cross-mount renames is arbitrary.
Cross-mount renames are not allowed currently, and granted, they may not
be very useful, either.

> Al, carefully abstaining from saying what he really thinks of LSM and its
> users...

As always, it's a pleasure to see the genuine Viro charm at play.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]