]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
ima: Use i_version only when filesystem supports it
authorSascha Hauer <s.hauer@pengutronix.de>
Wed, 27 Sep 2017 06:39:54 +0000 (08:39 +0200)
committerMimi Zohar <zohar@linux.vnet.ibm.com>
Mon, 18 Dec 2017 14:43:49 +0000 (09:43 -0500)
commita2a2c3c8580a9158bca61221648fd6d5c98c443a
tree757954b05ff282edd655f8fdd3929fd7aa80d72c
parent02c324a55ed9ee4d790eaa9ac8e7cdecbe3e0a22
ima: Use i_version only when filesystem supports it

i_version is only supported by a filesystem when the SB_I_VERSION
flag is set. This patch tests for the SB_I_VERSION flag before using
i_version. If we can't use i_version to detect a file change then we
must assume the file has changed in the last_writer path and remeasure
it.

On filesystems without i_version support IMA used to measure a file
only once and didn't detect any changes to a file. With this patch
IMA now works properly on these filesystems.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
security/integrity/ima/ima_main.c