diff options
Diffstat (limited to 'security')
-rw-r--r-- | security/integrity/ima/ima_main.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c index 71fecfef0939..e467664965e7 100644 --- a/security/integrity/ima/ima_main.c +++ b/security/integrity/ima/ima_main.c | |||
@@ -472,8 +472,10 @@ int ima_post_read_file(struct file *file, void *buf, loff_t size, | |||
472 | 472 | ||
473 | if (!file && read_id == READING_FIRMWARE) { | 473 | if (!file && read_id == READING_FIRMWARE) { |
474 | if ((ima_appraise & IMA_APPRAISE_FIRMWARE) && | 474 | if ((ima_appraise & IMA_APPRAISE_FIRMWARE) && |
475 | (ima_appraise & IMA_APPRAISE_ENFORCE)) | 475 | (ima_appraise & IMA_APPRAISE_ENFORCE)) { |
476 | pr_err("Prevent firmware loading_store.\n"); | ||
476 | return -EACCES; /* INTEGRITY_UNKNOWN */ | 477 | return -EACCES; /* INTEGRITY_UNKNOWN */ |
478 | } | ||
477 | return 0; | 479 | return 0; |
478 | } | 480 | } |
479 | 481 | ||
@@ -517,6 +519,12 @@ int ima_load_data(enum kernel_load_data_id id) | |||
517 | pr_err("impossible to appraise a kernel image without a file descriptor; try using kexec_file_load syscall.\n"); | 519 | pr_err("impossible to appraise a kernel image without a file descriptor; try using kexec_file_load syscall.\n"); |
518 | return -EACCES; /* INTEGRITY_UNKNOWN */ | 520 | return -EACCES; /* INTEGRITY_UNKNOWN */ |
519 | } | 521 | } |
522 | break; | ||
523 | case LOADING_FIRMWARE: | ||
524 | if (ima_appraise & IMA_APPRAISE_FIRMWARE) { | ||
525 | pr_err("Prevent firmware sysfs fallback loading.\n"); | ||
526 | return -EACCES; /* INTEGRITY_UNKNOWN */ | ||
527 | } | ||
520 | default: | 528 | default: |
521 | break; | 529 | break; |
522 | } | 530 | } |