linux/security/integrity
Roberto Sassu 020aae3ee5 ima: do not update security.ima if appraisal status is not INTEGRITY_PASS
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.

Cc: stable@vger.kernel.org
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>
2017-11-20 08:23:10 +11:00
..
evm EVM: Only complain about a missing HMAC key once 2017-11-08 15:16:36 -05:00
ima ima: do not update security.ima if appraisal status is not INTEGRITY_PASS 2017-11-20 08:23:10 +11:00
digsig_asymmetric.c integrity: Small code improvements 2017-06-21 14:37:12 -04:00
digsig.c integrity: use kernel_read_file_from_path() to read x509 certs 2017-11-08 15:16:36 -05:00
iint.c integrity: use kernel_read_file_from_path() to read x509 certs 2017-11-08 15:16:36 -05:00
integrity_audit.c Merge git://git.infradead.org/users/eparis/audit 2014-04-12 12:38:53 -07:00
integrity.h integrity: use kernel_read_file_from_path() to read x509 certs 2017-11-08 15:16:36 -05:00
Kconfig security: integrity: Remove select to deleted option PUBLIC_KEY_ALGO_RSA 2016-04-12 19:54:58 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00