[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <09b6266e3209433bac9b57baf39e073945533d5a.1323880769.git.dmitry.kasatkin@intel.com>
Date: Wed, 14 Dec 2011 18:44:57 +0200
From: Dmitry Kasatkin <dmitry.kasatkin@...el.com>
To: linux-fsdevel@...r.kernel.org,
linux-security-module@...r.kernel.org
Cc: akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
zohar@...ux.vnet.ibm.com
Subject: [PATCH 1/1] do_truncate needs to increment iversion
IMA/EVM uses iversion to identify if file content has been changed.
It has been found that when file is opened, truncated with ftruncate()
and then closed, iversion is not updated.
This patch adds iversion incrementation to do_truncate().
Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@...el.com>
---
fs/open.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/fs/open.c b/fs/open.c
index 22c41b5..d7e8df2 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -56,6 +56,8 @@ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
newattrs.ia_valid |= ret | ATTR_FORCE;
mutex_lock(&dentry->d_inode->i_mutex);
+ if (IS_I_VERSION(dentry->d_inode))
+ inode_inc_iversion(dentry->d_inode);
ret = notify_change(dentry, &newattrs);
mutex_unlock(&dentry->d_inode->i_mutex);
return ret;
--
1.7.4.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists