linux/security/integrity/ima
Daniel Glöckner 1ac202e978 ima: accept previously set IMA_NEW_FILE
Modifying the attributes of a file makes ima_inode_post_setattr reset
the IMA cache flags. So if the file, which has just been created,
is opened a second time before the first file descriptor is closed,
verification fails since the security.ima xattr has not been written
yet. We therefore have to look at the IMA_NEW_FILE even if the file
already existed.

With this patch there should no longer be an error when cat tries to
open testfile:

$ rm -f testfile
$ ( echo test >&3 ; touch testfile ; cat testfile ) 3>testfile

A file being new is no reason to accept that it is missing a digital
signature demanded by the policy.

Signed-off-by: Daniel Glöckner <dg@emlix.com>
Cc: stable@vger.kernel.org
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
2017-03-07 07:06:10 -05:00
..
ima_api.c ima: allow to check MAY_APPEND 2017-01-27 14:17:21 -05:00
ima_appraise.c ima: accept previously set IMA_NEW_FILE 2017-03-07 07:06:10 -05:00
ima_crypto.c ima: platform-independent hash value 2016-12-20 09:48:46 -08:00
ima_fs.c ima: define a canonical binary_runtime_measurements list format 2016-12-20 09:48:45 -08:00
ima_init.c ima: on soft reboot, restore the measurement list 2016-12-20 09:48:43 -08:00
ima_kexec.c ima: define a canonical binary_runtime_measurements list format 2016-12-20 09:48:45 -08:00
ima_main.c ima: allow to check MAY_APPEND 2017-01-27 14:17:21 -05:00
ima_mok.c IMA: Use the the system trusted keyrings instead of .ima_mok 2016-04-11 22:49:15 +01:00
ima_policy.c integrity: mark default IMA rules as __ro_after_init 2017-03-06 19:08:57 -05:00
ima_queue.c ima: maintain memory size needed for serializing the measurement list 2016-12-20 09:48:44 -08:00
ima_template_lib.c ima: define a canonical binary_runtime_measurements list format 2016-12-20 09:48:45 -08: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
ima_template.c ima: define a canonical binary_runtime_measurements list format 2016-12-20 09:48:45 -08:00
ima.h ima: fix ima_d_path() possible race with rename 2017-01-27 14:16:02 -05:00
Kconfig ima: maintain memory size needed for serializing the measurement list 2016-12-20 09:48:44 -08:00
Makefile ima: on soft reboot, restore the measurement list 2016-12-20 09:48:43 -08:00