kernel-hacking-2024-linux-s.../security/integrity/ima
Roberto Sassu 2e3a34e9f4 ima: Fix return value of ima_write_policy()
This patch fixes the return value of ima_write_policy() when a new policy
is directly passed to IMA and the current policy requires appraisal of the
file containing the policy. Currently, if appraisal is not in ENFORCE mode,
ima_write_policy() returns 0 and leads user space applications to an
endless loop. Fix this issue by denying the operation regardless of the
appraisal mode.

Cc: stable@vger.kernel.org # 4.10.x
Fixes: 19f8a84713 ("ima: measure and appraise the IMA policy itself")
Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Reviewed-by: Krzysztof Struczynski <krzysztof.struczynski@huawei.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
2020-05-07 21:36:31 -04:00
..
ima.h IMA: Defined delayed workqueue to free the queued keys 2020-01-23 07:37:31 -05:00
ima_api.c IMA: Add support to limit measuring keys 2019-12-12 08:53:50 -05:00
ima_appraise.c IMA: Add support to limit measuring keys 2019-12-12 08:53:50 -05:00
ima_asymmetric_keys.c integrity: Remove duplicate pr_fmt definitions 2020-02-28 14:32:58 -05:00
ima_crypto.c ima: Set file->f_mode instead of file->f_flags in ima_calc_file_hash() 2020-05-07 21:30:58 -04:00
ima_fs.c ima: Fix return value of ima_write_policy() 2020-05-07 21:36:31 -04:00
ima_init.c integrity: Remove duplicate pr_fmt definitions 2020-02-28 14:32:58 -05:00
ima_kexec.c integrity: Remove duplicate pr_fmt definitions 2020-02-28 14:32:58 -05:00
ima_main.c integrity: Remove duplicate pr_fmt definitions 2020-02-28 14:32:58 -05:00
ima_modsig.c ima: Fix use after free in ima_read_modsig() 2019-08-28 15:01:24 -04:00
ima_mok.c Revert "Merge tag 'keys-acl-20190703' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs" 2019-07-10 18:43:43 -07:00
ima_policy.c integrity: Remove duplicate pr_fmt definitions 2020-02-28 14:32:58 -05:00
ima_queue.c integrity: Remove duplicate pr_fmt definitions 2020-02-28 14:32:58 -05:00
ima_queue_keys.c integrity: Remove duplicate pr_fmt definitions 2020-02-28 14:32:58 -05:00
ima_template.c integrity: Remove duplicate pr_fmt definitions 2020-02-28 14:32:58 -05:00
ima_template_lib.c integrity: Remove duplicate pr_fmt definitions 2020-02-28 14:32:58 -05:00
ima_template_lib.h ima: Define ima-modsig template 2019-08-05 18:40:25 -04:00
Kconfig ima: add a new CONFIG for loading arch-specific policies 2020-03-12 07:43:57 -04:00
Makefile IMA: Update KBUILD_MODNAME for IMA files to ima 2020-02-28 14:32:58 -05:00