android_kernel_oneplus_msm8998/security/integrity/ima
Roberto Sassu a9100b6f1a ima: do not update security.ima if appraisal status is not INTEGRITY_PASS
commit 020aae3ee58c1af0e7ffc4e2cc9fe4dc630338cb upstream.

Commit b65a9cfc2c ("Untangling ima mess, part 2: deal with counters")
moved the call of ima_file_check() from may_open() to do_filp_open() at a
point where the file descriptor is already opened.

This breaks the assumption made by IMA that file descriptors being closed
belong to files whose access was granted by ima_file_check(). The
consequence is that security.ima and security.evm are updated with good
values, regardless of the current appraisal status.

For example, if a file does not have security.ima, IMA will create it after
opening the file for writing, even if access is denied. Access to the file
will be allowed afterwards.

Avoid this issue by checking the appraisal status before updating
security.ima.

Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-24 08:32:24 +01:00
..
ima.h ima: fix ima_show_template_data_ascii() 2015-06-16 08:18:21 -04:00
ima_api.c ima: use file_dentry() 2016-10-16 17:36:15 +02:00
ima_appraise.c ima: do not update security.ima if appraisal status is not INTEGRITY_PASS 2017-11-24 08:32:24 +01:00
ima_crypto.c mm, page_alloc: rename __GFP_WAIT to __GFP_RECLAIM 2015-11-06 17:50:42 -08:00
ima_fs.c ima: fix ima_show_template_data_ascii() 2015-06-16 08:18:21 -04:00
ima_init.c ima: pass iint to ima_add_violation() 2015-05-21 13:59:29 -04:00
ima_main.c ima: pass iint to ima_add_violation() 2015-05-21 13:59:29 -04:00
ima_policy.c ima: update builtin policies 2015-06-16 08:18:45 -04:00
ima_queue.c integrity: fix checkpatch errors 2014-03-07 12:15:45 -05:00
ima_template.c ima: added support for new kernel cmdline parameter ima_template_fmt 2014-10-13 08:39:02 -04:00
ima_template_lib.c ima: fix ima_show_template_data_ascii() 2015-06-16 08:18:21 -04:00
ima_template_lib.h ima: wrap event related data to the new ima_event_data structure 2015-05-21 13:59:28 -04:00
Kconfig ima: /proc/keys is now mandatory 2015-02-02 13:19:48 +11:00
Makefile ima: define template fields library and new helpers 2013-10-25 17:17:05 -04:00