aboutsummaryrefslogtreecommitdiffstats
path: root/fs/splice.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/splice.c')
-rw-r--r--fs/splice.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/splice.c b/fs/splice.c
index ed2ce995475c..ef808227bc11 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -28,6 +28,7 @@
28#include <linux/module.h> 28#include <linux/module.h>
29#include <linux/syscalls.h> 29#include <linux/syscalls.h>
30#include <linux/uio.h> 30#include <linux/uio.h>
31#include <linux/security.h>
31 32
32/* 33/*
33 * Attempt to steal a page from a pipe buffer. This should perhaps go into 34 * Attempt to steal a page from a pipe buffer. This should perhaps go into
@@ -961,6 +962,10 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
961 if (unlikely(ret < 0)) 962 if (unlikely(ret < 0))
962 return ret; 963 return ret;
963 964
965 ret = security_file_permission(out, MAY_WRITE);
966 if (unlikely(ret < 0))
967 return ret;
968
964 return out->f_op->splice_write(pipe, out, ppos, len, flags); 969 return out->f_op->splice_write(pipe, out, ppos, len, flags);
965} 970}
966 971
@@ -983,6 +988,10 @@ static long do_splice_to(struct file *in, loff_t *ppos,
983 if (unlikely(ret < 0)) 988 if (unlikely(ret < 0))
984 return ret; 989 return ret;
985 990
991 ret = security_file_permission(in, MAY_READ);
992 if (unlikely(ret < 0))
993 return ret;
994
986 return in->f_op->splice_read(in, ppos, pipe, len, flags); 995 return in->f_op->splice_read(in, ppos, pipe, len, flags);
987} 996}
988 997