[PATCH] LSM: add missing hook to do_compat_readv_writev()
Changes
1 files changed · +4 −0
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| fs/compat.c | modified | +4 | −0 | View file |
fs/compat.c
View filediff --git a/fs/compat.c b/fs/compat.c
index 7f8e26e..2e32bd3 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -1217,6 +1217,10 @@ static ssize_t compat_do_readv_writev(int type, struct file *file,
if (ret < 0)
goto out;
+ ret = security_file_permission(file, type == READ ? MAY_READ:MAY_WRITE);
+ if (ret)
+ goto out;
+
fnv = NULL;
if (type == READ) {
fn = file->f_op->read;