]> git.baikalelectronics.ru Git - kernel.git/commit
afs: Distinguish mountpoints from symlinks by file mode alone
authorDavid Howells <dhowells@redhat.com>
Thu, 16 Mar 2017 16:27:45 +0000 (16:27 +0000)
committerDavid Howells <dhowells@redhat.com>
Thu, 16 Mar 2017 16:27:45 +0000 (16:27 +0000)
commit18159a8e7e49d55fe3ae805c1a1183fceef7e7c5
treea8659f1ecc395bef4f80b3f38bc6bb7dc070e4f0
parent3f9063cc6f87cc38212209b6f61facbb3bbca798
afs: Distinguish mountpoints from symlinks by file mode alone

In AFS, mountpoints appear as symlinks with mode 0644 and normal symlinks
have mode 0777, so use this to distinguish them rather than reading the
content and parsing it.  In the case of a mountpoint, the symlink body is a
formatted string indicating the location of the target volume.

Note that with this, kAFS no longer 'pre-fetches' the contents of symlinks,
so afs_readpage() may fail with an access-denial because when the VFS calls
d_automount(), it wraps the call in an credentials override that sets the
initial creds - thereby preventing access to the caller's keyrings and the
authentication keys held therein.

To this end, a patch reverting that change to the VFS is required also.

Reported-by: Jeffrey Altman <jaltman@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
fs/afs/inode.c
fs/afs/internal.h
fs/afs/mntpt.c