All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: richard@nod.at, dedekind1@gmail.com, adrian.hunter@intel.com,
	linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
	linux-fsdevel@vger.kernel.org
Cc: Oleksij Rempel <o.rempel@pengutronix.de>
Subject: [PATCH v2 2/3] fs: ubifs: update i_version on inode changes
Date: Tue, 11 Apr 2017 11:50:54 +0200	[thread overview]
Message-ID: <20170411095055.26328-3-o.rempel@pengutronix.de> (raw)
In-Reply-To: <20170411095055.26328-1-o.rempel@pengutronix.de>

increment i_version to notify security/IMA about changes
made in inode.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 fs/ubifs/file.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
index d9ae86f96df7..29213724259b 100644
--- a/fs/ubifs/file.c
+++ b/fs/ubifs/file.c
@@ -1104,6 +1104,8 @@ static void do_attr_changes(struct inode *inode, const struct iattr *attr)
 			mode &= ~S_ISGID;
 		inode->i_mode = mode;
 	}
+	if (IS_I_VERSION(inode))
+		inode_inc_iversion(inode);
 }
 
 /**
@@ -1401,6 +1403,9 @@ int ubifs_update_time(struct inode *inode, struct timespec *time,
 	if (!(inode->i_sb->s_flags & MS_LAZYTIME))
 		iflags |= I_DIRTY_SYNC;
 
+	if (IS_I_VERSION(inode))
+		inode_inc_iversion(inode);
+
 	release = ui->dirty;
 	__mark_inode_dirty(inode, iflags);
 	mutex_unlock(&ui->ui_mutex);
@@ -1435,6 +1440,8 @@ static int update_mctime(struct inode *inode)
 
 		mutex_lock(&ui->ui_mutex);
 		inode->i_mtime = inode->i_ctime = ubifs_current_time(inode);
+		if (IS_I_VERSION(inode))
+			inode_inc_iversion(inode);
 		release = ui->dirty;
 		mark_inode_dirty_sync(inode);
 		mutex_unlock(&ui->ui_mutex);
@@ -1580,6 +1587,8 @@ static int ubifs_vm_page_mkwrite(struct vm_fault *vmf)
 
 		mutex_lock(&ui->ui_mutex);
 		inode->i_mtime = inode->i_ctime = ubifs_current_time(inode);
+		if (IS_I_VERSION(inode))
+			inode_inc_iversion(inode);
 		release = ui->dirty;
 		mark_inode_dirty_sync(inode);
 		mutex_unlock(&ui->ui_mutex);
-- 
2.11.0

  parent reply	other threads:[~2017-04-11  9:51 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-11  9:50 [PATCH v2 0/3] make ubifs compatible with IMA and EVM Oleksij Rempel
2017-04-11  9:50 ` [PATCH v2 1/3] fs: ubifs: parse iversion mount option Oleksij Rempel
2017-04-11  9:50 ` Oleksij Rempel [this message]
2017-04-11 16:05   ` [PATCH v2 2/3] fs: ubifs: update i_version on inode changes Christoph Hellwig
2017-04-11 21:13     ` Richard Weinberger
2017-04-12  6:05       ` Oleksij Rempel
2017-04-12  6:08         ` Christoph Hellwig
2017-04-12  7:04           ` Oleksij Rempel
2017-04-24 15:44             ` Richard Weinberger
2017-04-11  9:50 ` [PATCH v2 3/3] fs: ubifs: set s_uuid in super block Oleksij Rempel
2017-04-11 20:43   ` Richard Weinberger
2017-04-12  5:48     ` Christoph Hellwig
2017-04-12  7:15       ` Oleksij Rempel
2017-04-24 15:47         ` Richard Weinberger
2017-04-27 22:03           ` Richard Weinberger
2017-04-28  8:53             ` Amir Goldstein
2017-05-02  5:30               ` Oleksij Rempel
2017-05-02  7:19             ` Amir Goldstein
2017-05-02  7:37               ` Richard Weinberger
2017-05-09  4:13                 ` Oleksij Rempel
     [not found]                   ` <CAOQ4uxiEGJLSGS5rK8V8GRNvf9aWqbVG5odu2=nv73xTOmvfNQ@mail.gmail.com>
2017-05-09  5:52                     ` Oleksij Rempel
2017-05-09  7:01                       ` Richard Weinberger
2017-05-09  7:08                         ` Amir Goldstein
2017-05-09  7:35                           ` Oleksij Rempel
2017-05-09  7:35                           ` Richard Weinberger
2017-05-09  7:50                             ` Amir Goldstein
2017-05-02  7:23     ` Artem Bityutskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170411095055.26328-3-o.rempel@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=adrian.hunter@intel.com \
    --cc=dedekind1@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.