summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2018-11-05 17:40:30 +0000
committerAl Viro <viro@zeniv.linux.org.uk>2019-03-20 18:49:06 -0400
commit2db154b3ea8e14b04fee23e3fdfd5e9d17fbc6ae (patch)
treeb7c4c1f2497b6c04b3481fdfd461c652befbca6d /security
parenta07b20004793d8926f78d63eb5980559f7813404 (diff)
downloadlinux-2db154b3ea8e14b04fee23e3fdfd5e9d17fbc6ae.tar.gz
linux-2db154b3ea8e14b04fee23e3fdfd5e9d17fbc6ae.tar.bz2
linux-2db154b3ea8e14b04fee23e3fdfd5e9d17fbc6ae.zip
vfs: syscall: Add move_mount(2) to move mounts around
Add a move_mount() system call that will move a mount from one place to another and, in the next commit, allow to attach an unattached mount tree. The new system call looks like the following: int move_mount(int from_dfd, const char *from_path, int to_dfd, const char *to_path, unsigned int flags); Signed-off-by: David Howells <dhowells@redhat.com> cc: linux-api@vger.kernel.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'security')
-rw-r--r--security/security.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/security/security.c b/security/security.c
index 23cbb1a295a3..5b3d23e427b3 100644
--- a/security/security.c
+++ b/security/security.c
@@ -866,6 +866,11 @@ int security_add_mnt_opt(const char *option, const char *val, int len,
}
EXPORT_SYMBOL(security_add_mnt_opt);
+int security_move_mount(const struct path *from_path, const struct path *to_path)
+{
+ return call_int_hook(move_mount, 0, from_path, to_path);
+}
+
int security_inode_alloc(struct inode *inode)
{
int rc = lsm_inode_alloc(inode);