[RFC][PATCH 1/4] fs: preserve S_IMA inode flag in fsstack_copy_attr_all()
From: Roberto Sassu
Date: Fri Apr 29 2011 - 09:44:40 EST
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