[RFC][PATCH 1/4] fs: preserve S_IMA inode flag in fsstack_copy_attr_all()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The S_IMA inode flag of the upper inode must be preserved to avoid IMA
tries to free its own structure for inodes that were not measured before.

Signed-off-by: Roberto Sassu <roberto.sassu@xxxxxxxxx>
---
 fs/stack.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/stack.c b/fs/stack.c
index 4a6f7f4..a6deb1c 100644
--- a/fs/stack.c
+++ b/fs/stack.c
@@ -73,7 +73,7 @@ void fsstack_copy_attr_all(struct inode *dest, const struct inode *src)
 	dest->i_mtime = src->i_mtime;
 	dest->i_ctime = src->i_ctime;
 	dest->i_blkbits = src->i_blkbits;
-	dest->i_flags = src->i_flags;
+	dest->i_flags = (src->i_flags & ~S_IMA) + (dest->i_flags & S_IMA);
 	dest->i_nlink = src->i_nlink;
 }
 EXPORT_SYMBOL_GPL(fsstack_copy_attr_all);
-- 
1.7.4.4

Attachment: smime.p7s
Description: S/MIME cryptographic signature


[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux