diff options
Diffstat (limited to 'security/integrity/ima/ima_main.c')
-rw-r--r-- | security/integrity/ima/ima_main.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c index 52ac6cf41f88..dcc98cf542d8 100644 --- a/security/integrity/ima/ima_main.c +++ b/security/integrity/ima/ima_main.c | |||
@@ -214,8 +214,11 @@ static int process_measurement(struct file *file, const char *filename, | |||
214 | xattr_ptr = &xattr_value; | 214 | xattr_ptr = &xattr_value; |
215 | 215 | ||
216 | rc = ima_collect_measurement(iint, file, xattr_ptr, &xattr_len); | 216 | rc = ima_collect_measurement(iint, file, xattr_ptr, &xattr_len); |
217 | if (rc != 0) | 217 | if (rc != 0) { |
218 | if (file->f_flags & O_DIRECT) | ||
219 | rc = (iint->flags & IMA_PERMIT_DIRECTIO) ? 0 : -EACCES; | ||
218 | goto out_digsig; | 220 | goto out_digsig; |
221 | } | ||
219 | 222 | ||
220 | pathname = filename ?: ima_d_path(&file->f_path, &pathbuf); | 223 | pathname = filename ?: ima_d_path(&file->f_path, &pathbuf); |
221 | 224 | ||