linux/security/integrity/ima
Roberto Sassu 0014cc04e8 ima: Set file->f_mode instead of file->f_flags in ima_calc_file_hash()
Commit a408e4a86b ("ima: open a new file instance if no read
permissions") tries to create a new file descriptor to calculate a file
digest if the file has not been opened with O_RDONLY flag. However, if a
new file descriptor cannot be obtained, it sets the FMODE_READ flag to
file->f_flags instead of file->f_mode.

This patch fixes this issue by replacing f_flags with f_mode as it was
before that commit.

Cc: stable@vger.kernel.org # 4.20.x
Fixes: a408e4a86b ("ima: open a new file instance if no read permissions")
Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Reviewed-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
2020-05-07 21:30:58 -04: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 integrity: Remove duplicate pr_fmt definitions 2020-02-28 14:32:58 -05: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_keys.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_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
ima_template.c integrity: Remove duplicate pr_fmt definitions 2020-02-28 14:32:58 -05:00
ima.h IMA: Defined delayed workqueue to free the queued keys 2020-01-23 07:37:31 -05: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