Skip to contentSkip to conversation

security/integrity/ima/ima_main.c: Fix return value

PATCH In review wzt wzt 2 participants 2 messages Feb 8, 2010

Subsystems (3)
lore
Share & tools
lore

wzt wzt

author
#0 lore raw

PATCH 1/1 security/integrity/ima/ima_main.c: Fix return value

Hi:
In security/integrity/ima/ima_main.c ima_file_mmap() called by
security_file_mmap(), it depend on the return value of ima_file_mmap(), not always return 0. see also in ima_bprm_check().

(quoted diff) +0 -0

b/security/integrity/ima/ima_main.c
index 294b005..705a991 100644

security/integrity/ima/ima_main.c +2 -2
@@ -271,7 +271,7 @@ int ima_file_mmap(struct file *file, unsigned long prot)
        if (prot & PROT_EXEC)
                rc = process_measurement(file, file->f_dentry->d_name.name,
                                         MAY_EXEC, FILE_MMAP);
-       return 0;
+       return rc;
 }
 
 /**
@@ -293,7 +293,7 @@ int ima_bprm_check(struct linux_binprm *bprm)
 
        rc = process_measurement(bprm->file, bprm->filename,
                                 MAY_EXEC, BPRM_CHECK);
-       return 0;
+       return rc;
 }
#1 lore raw
Quoted 23 lines · wzt wzt

Hi:
In security/integrity/ima/ima_main.c ima_file_mmap() called by
security_file_mmap(), it depend on the return value of ima_file_mmap(), not always return 0. see also in ima_bprm_check().

security/integrity/ima/ima_main.c +1 -1
index 294b005..705a991 100644
@@ -271,7 +271,7 @@ int ima_file_mmap(struct file *file, unsigned long prot)
        if (prot & PROT_EXEC)
                rc = process_measurement(file, file->f_dentry->d_name.name,
                                         MAY_EXEC, FILE_MMAP);
-       return 0;
+       return rc;
 }
 
 /**

security/integrity/ima/ima_main.c int ima_bprm_check(struct linux_binprm *bprm) · line 297

Quoted 6 lines
security/integrity/ima/ima_main.c +1 -1
@@ -293,7 +293,7 @@ int ima_bprm_check(struct linux_binprm *bprm)
 
        rc = process_measurement(bprm->file, bprm->filename,
                                 MAY_EXEC, BPRM_CHECK);
-       return 0;
+       return rc;
 }

nack. Sorry, we're not at the point where we can enforce integrity. The return code will eventually be based on measurement appraisal.

Mimi