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

Roberto Sassu roberto.sassu at polito.it
Fri Apr 29 13:41:49 UTC 2011


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 at polito.it>
---
 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 2061 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20110429/83510ea3/attachment-0001.bin>


More information about the AppArmor mailing list