]> git.baikalelectronics.ru Git - kernel.git/commit
ecryptfs: use vfs_get_link()
authorMiklos Szeredi <mszeredi@redhat.com>
Fri, 9 Dec 2016 15:45:03 +0000 (16:45 +0100)
committerMiklos Szeredi <mszeredi@redhat.com>
Fri, 9 Dec 2016 15:45:03 +0000 (16:45 +0100)
commit00f673c1af3f402d6605cd62805a281c62d24386
treec17f5c57209779aca2b1f9845750fa73fa69e0d2
parent289f0f00e5d6187bb245b5824035f02f6b54d555
ecryptfs: use vfs_get_link()

Here again we are copying form one buffer to another, while jumping through
hoops to make kernel memory look like userspace memory.

For no good reason, since vfs_get_link() provides exactly what is needed.

As a bonus, now the security hook for readlink is also called on the
underlying inode.

Note: this can be called from link-following context.  But this is okay:

 - not in RCU mode

 - commit 0fd306f9c2a6 ("proc: prevent stacking filesystems on top")

 - ecryptfs is *reading* the underlying symlink not following it, so the
   right security hook is being called

Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Cc: Tyler Hicks <tyhicks@canonical.com>
fs/ecryptfs/inode.c