1
0
Fork 0
alistair23-linux/security/integrity
Roberto Sassu 26d72a8460 ima: Don't modify file descriptor mode on the fly
commit 207cdd565d upstream.

Commit a408e4a86b ("ima: open a new file instance if no read
permissions") already introduced a second open to measure a file when the
original file descriptor does not allow it. However, it didn't remove the
existing method of changing the mode of the original file descriptor, which
is still necessary if the current process does not have enough privileges
to open a new one.

Changing the mode isn't really an option, as the filesystem might need to
do preliminary steps to make the read possible. Thus, this patch removes
the code and keeps the second open as the only option to measure a file
when it is unreadable with the original file descriptor.

Cc: <stable@vger.kernel.org> # 4.20.x: 0014cc04e8 ima: Set file->f_mode
Fixes: 2fe5d6def1 ("ima: integrity appraisal extension")
Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-30 11:51:39 +01:00
..
evm evm: Check size of security.evm before using it 2020-11-01 12:01:05 +01:00
ima ima: Don't modify file descriptor mode on the fly 2020-12-30 11:51:39 +01:00
platform_certs efi: Only print errors about failing to get certs if EFI vars are found 2020-03-12 13:00:14 +01:00
Kconfig integrity: Select CONFIG_KEYS instead of depending on it 2019-08-05 18:40:20 -04:00
Makefile integrity: remove pointless subdir-$(CONFIG_...) 2019-10-05 15:29:49 +09:00
digsig.c ima: Implement support for module-style appended signatures 2019-08-05 18:40:23 -04:00
digsig_asymmetric.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
iint.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
integrity.h ima: Implement support for module-style appended signatures 2019-08-05 18:40:23 -04:00
integrity_audit.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00