]> git.ipfire.org Git - thirdparty/kernel/stable.git/blobdiff - fs/userfaultfd.c
fs: Rename anon_inode_getfile_secure() and anon_inode_getfd_secure()
[thirdparty/kernel/stable.git] / fs / userfaultfd.c
index 56eaae9dac1ab2fbd76dffbd895d4e1ca5dcddc2..7a1cf8bab5eb87f9fd270cdd68320385973f9f78 100644 (file)
@@ -1033,7 +1033,7 @@ static int resolve_userfault_fork(struct userfaultfd_ctx *new,
 {
        int fd;
 
-       fd = anon_inode_getfd_secure("[userfaultfd]", &userfaultfd_fops, new,
+       fd = anon_inode_create_getfd("[userfaultfd]", &userfaultfd_fops, new,
                        O_RDONLY | (new->flags & UFFD_SHARED_FCNTL_FLAGS), inode);
        if (fd < 0)
                return fd;
@@ -2205,7 +2205,8 @@ static int new_userfaultfd(int flags)
        /* prevent the mm struct to be freed */
        mmgrab(ctx->mm);
 
-       fd = anon_inode_getfd_secure("[userfaultfd]", &userfaultfd_fops, ctx,
+       /* Create a new inode so that the LSM can block the creation.  */
+       fd = anon_inode_create_getfd("[userfaultfd]", &userfaultfd_fops, ctx,
                        O_RDONLY | (flags & UFFD_SHARED_FCNTL_FLAGS), NULL);
        if (fd < 0) {
                mmdrop(ctx->mm);