diff options
| -rw-r--r-- | include/linux/fs.h | 2 | ||||
| -rw-r--r-- | security/integrity/ima/ima_appraise.c | 15 |
2 files changed, 16 insertions, 1 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index c6baf767619e..d9e60824c374 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -1321,6 +1321,8 @@ extern int send_sigurg(struct fown_struct *fown); | |||
| 1321 | 1321 | ||
| 1322 | /* sb->s_iflags to limit user namespace mounts */ | 1322 | /* sb->s_iflags to limit user namespace mounts */ |
| 1323 | #define SB_I_USERNS_VISIBLE 0x00000010 /* fstype already mounted */ | 1323 | #define SB_I_USERNS_VISIBLE 0x00000010 /* fstype already mounted */ |
| 1324 | #define SB_I_IMA_UNVERIFIABLE_SIGNATURE 0x00000020 | ||
| 1325 | #define SB_I_UNTRUSTED_MOUNTER 0x00000040 | ||
| 1324 | 1326 | ||
| 1325 | /* Possible states of 'frozen' field */ | 1327 | /* Possible states of 'frozen' field */ |
| 1326 | enum { | 1328 | enum { |
diff --git a/security/integrity/ima/ima_appraise.c b/security/integrity/ima/ima_appraise.c index 1b177461f20e..4bafb397ee91 100644 --- a/security/integrity/ima/ima_appraise.c +++ b/security/integrity/ima/ima_appraise.c | |||
| @@ -302,7 +302,19 @@ int ima_appraise_measurement(enum ima_hooks func, | |||
| 302 | } | 302 | } |
| 303 | 303 | ||
| 304 | out: | 304 | out: |
| 305 | if (status != INTEGRITY_PASS) { | 305 | /* |
| 306 | * File signatures on some filesystems can not be properly verified. | ||
| 307 | * On these filesytems, that are mounted by an untrusted mounter, | ||
| 308 | * fail the file signature verification. | ||
| 309 | */ | ||
| 310 | if ((inode->i_sb->s_iflags & | ||
| 311 | (SB_I_IMA_UNVERIFIABLE_SIGNATURE | SB_I_UNTRUSTED_MOUNTER)) == | ||
| 312 | (SB_I_IMA_UNVERIFIABLE_SIGNATURE | SB_I_UNTRUSTED_MOUNTER)) { | ||
| 313 | status = INTEGRITY_FAIL; | ||
| 314 | cause = "unverifiable-signature"; | ||
| 315 | integrity_audit_msg(AUDIT_INTEGRITY_DATA, inode, filename, | ||
| 316 | op, cause, rc, 0); | ||
| 317 | } else if (status != INTEGRITY_PASS) { | ||
| 306 | if ((ima_appraise & IMA_APPRAISE_FIX) && | 318 | if ((ima_appraise & IMA_APPRAISE_FIX) && |
| 307 | (!xattr_value || | 319 | (!xattr_value || |
| 308 | xattr_value->type != EVM_IMA_XATTR_DIGSIG)) { | 320 | xattr_value->type != EVM_IMA_XATTR_DIGSIG)) { |
| @@ -319,6 +331,7 @@ out: | |||
| 319 | } else { | 331 | } else { |
| 320 | ima_cache_flags(iint, func); | 332 | ima_cache_flags(iint, func); |
| 321 | } | 333 | } |
| 334 | |||
| 322 | ima_set_cache_status(iint, func, status); | 335 | ima_set_cache_status(iint, func, status); |
| 323 | return status; | 336 | return status; |
| 324 | } | 337 | } |
