Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1621104 > unrolled thread

[PATCH v2 0/3] make ubifs compatible with IMA and EVM.

Started byOleksij Rempel <o.rempel@pengutronix.de>
First post2017-04-11 12:00 +0200
Last post2017-04-11 12:00 +0200
Articles 7 on this page of 27 — 6 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2 0/3] make ubifs compatible with IMA and EVM. Oleksij Rempel <o.rempel@pengutronix.de> - 2017-04-11 12:00 +0200
    [PATCH v2 3/3] fs: ubifs: set s_uuid in super block Oleksij Rempel <o.rempel@pengutronix.de> - 2017-04-11 12:00 +0200
      Re: [PATCH v2 3/3] fs: ubifs: set s_uuid in super block Richard Weinberger <richard@nod.at> - 2017-04-11 22:50 +0200
        Re: [PATCH v2 3/3] fs: ubifs: set s_uuid in super block Christoph Hellwig <hch@infradead.org> - 2017-04-12 07:50 +0200
          Re: [PATCH v2 3/3] fs: ubifs: set s_uuid in super block Oleksij Rempel <ore@pengutronix.de> - 2017-04-12 09:20 +0200
            Re: [PATCH v2 3/3] fs: ubifs: set s_uuid in super block Richard Weinberger <richard@nod.at> - 2017-04-24 17:50 +0200
              Re: [PATCH v2 3/3] fs: ubifs: set s_uuid in super block Richard Weinberger <richard@nod.at> - 2017-04-28 00:10 +0200
                Re: [PATCH v2 3/3] fs: ubifs: set s_uuid in super block Amir Goldstein <amir73il@gmail.com> - 2017-04-28 11:00 +0200
                  Re: [PATCH v2 3/3] fs: ubifs: set s_uuid in super block Oleksij Rempel <ore@pengutronix.de> - 2017-05-02 07:40 +0200
                Re: [PATCH v2 3/3] fs: ubifs: set s_uuid in super block Amir Goldstein <amir73il@gmail.com> - 2017-05-02 09:30 +0200
                  Re: [PATCH v2 3/3] fs: ubifs: set s_uuid in super block Richard Weinberger <richard@nod.at> - 2017-05-02 09:40 +0200
                    Re: [PATCH v2 3/3] fs: ubifs: set s_uuid in super block Oleksij Rempel <ore@pengutronix.de> - 2017-05-09 06:20 +0200
                      Re: [PATCH v2 3/3] fs: ubifs: set s_uuid in super block Oleksij Rempel <ore@pengutronix.de> - 2017-05-09 08:00 +0200
                        Re: [PATCH v2 3/3] fs: ubifs: set s_uuid in super block Amir Goldstein <amir73il@gmail.com> - 2017-05-09 09:10 +0200
                          Re: [PATCH v2 3/3] fs: ubifs: set s_uuid in super block Oleksij Rempel <ore@pengutronix.de> - 2017-05-09 09:40 +0200
                          Re: [PATCH v2 3/3] fs: ubifs: set s_uuid in super block Richard Weinberger <richard@nod.at> - 2017-05-09 09:40 +0200
                            Re: [PATCH v2 3/3] fs: ubifs: set s_uuid in super block Amir Goldstein <amir73il@gmail.com> - 2017-05-09 10:00 +0200
                        Re: [PATCH v2 3/3] fs: ubifs: set s_uuid in super block Richard Weinberger <richard@nod.at> - 2017-05-09 09:10 +0200
        Re: [PATCH v2 3/3] fs: ubifs: set s_uuid in super block Artem Bityutskiy <dedekind1@gmail.com> - 2017-05-02 09:30 +0200
    [PATCH v2 2/3] fs: ubifs: update i_version on inode changes Oleksij Rempel <o.rempel@pengutronix.de> - 2017-04-11 12:00 +0200
      Re: [PATCH v2 2/3] fs: ubifs: update i_version on inode changes Christoph Hellwig <hch@infradead.org> - 2017-04-11 18:10 +0200
        Re: [PATCH v2 2/3] fs: ubifs: update i_version on inode changes Richard Weinberger <richard@nod.at> - 2017-04-11 23:20 +0200
          Re: [PATCH v2 2/3] fs: ubifs: update i_version on inode changes Oleksij Rempel <ore@pengutronix.de> - 2017-04-12 08:10 +0200
            Re: [PATCH v2 2/3] fs: ubifs: update i_version on inode changes Christoph Hellwig <hch@infradead.org> - 2017-04-12 08:10 +0200
              Re: [PATCH v2 2/3] fs: ubifs: update i_version on inode changes Oleksij Rempel <ore@pengutronix.de> - 2017-04-12 09:10 +0200
                Re: [PATCH v2 2/3] fs: ubifs: update i_version on inode changes Richard Weinberger <richard@nod.at> - 2017-04-24 17:50 +0200
    [PATCH v2 1/3] fs: ubifs: parse iversion mount option Oleksij Rempel <o.rempel@pengutronix.de> - 2017-04-11 12:00 +0200

Page 2 of 2 — ← Prev page 1 [2]


#1621436 — Re: [PATCH v2 2/3] fs: ubifs: update i_version on inode changes

FromChristoph Hellwig <hch@infradead.org>
Date2017-04-11 18:10 +0200
SubjectRe: [PATCH v2 2/3] fs: ubifs: update i_version on inode changes
Message-ID<tv6wG-NB-15@gated-at.bofh.it>
In reply to#1621111
On Tue, Apr 11, 2017 at 11:50:54AM +0200, Oleksij Rempel wrote:
> increment i_version to notify security/IMA about changes
> made in inode.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>

And how is this stored on disk?

[toc] | [prev] | [next] | [standalone]


#1621627 — Re: [PATCH v2 2/3] fs: ubifs: update i_version on inode changes

FromRichard Weinberger <richard@nod.at>
Date2017-04-11 23:20 +0200
SubjectRe: [PATCH v2 2/3] fs: ubifs: update i_version on inode changes
Message-ID<tvbmF-3WD-5@gated-at.bofh.it>
In reply to#1621436
Am 11.04.2017 um 18:05 schrieb Christoph Hellwig:
> On Tue, Apr 11, 2017 at 11:50:54AM +0200, Oleksij Rempel wrote:
>> increment i_version to notify security/IMA about changes
>> made in inode.
>>
>> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> 
> And how is this stored on disk?
> 

Hehe, I was about to ask the same question. :-)

Thanks,
//richard

[toc] | [prev] | [next] | [standalone]


#1621825 — Re: [PATCH v2 2/3] fs: ubifs: update i_version on inode changes

FromOleksij Rempel <ore@pengutronix.de>
Date2017-04-12 08:10 +0200
SubjectRe: [PATCH v2 2/3] fs: ubifs: update i_version on inode changes
Message-ID<tvjDA-Xu-7@gated-at.bofh.it>
In reply to#1621627
On Tue, Apr 11, 2017 at 11:13:24PM +0200, Richard Weinberger wrote:
> Am 11.04.2017 um 18:05 schrieb Christoph Hellwig:
> > On Tue, Apr 11, 2017 at 11:50:54AM +0200, Oleksij Rempel wrote:
> >> increment i_version to notify security/IMA about changes
> >> made in inode.
> >>
> >> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> > 
> > And how is this stored on disk?
> > 
> 
> Hehe, I was about to ask the same question. :-)

No. it is not stored to fs.
Heh, the same question i asked my self. On linux-ima-user i found
this post (2009-07-23):
https://sourceforge.net/p/linux-ima/mailman/message/23152923/
---
When an inode entry is removed from dcache, the corresponding iint entry
is removed from the radix tree. Unmounting an fs will cause the inodes,
and by extension iint's, to be freed.  When the fs is remounted, any
file accessed will result in allocating a new iint structure with the
i_version set to 0.
---

The code seems to confirm it. So i assumed that IMA don't care if
i_version is stored to disk or not. And i_version is the only way
to notify IMA about inode changes.
Since IMA documentation explecitley set i_version as reqieremt, so this
option was provided as well.

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

[toc] | [prev] | [next] | [standalone]


#1621827 — Re: [PATCH v2 2/3] fs: ubifs: update i_version on inode changes

FromChristoph Hellwig <hch@infradead.org>
Date2017-04-12 08:10 +0200
SubjectRe: [PATCH v2 2/3] fs: ubifs: update i_version on inode changes
Message-ID<tvjDB-Xu-23@gated-at.bofh.it>
In reply to#1621825
On Wed, Apr 12, 2017 at 08:05:34AM +0200, Oleksij Rempel wrote:
> The code seems to confirm it. So i assumed that IMA don't care if
> i_version is stored to disk or not. And i_version is the only way
> to notify IMA about inode changes.
> Since IMA documentation explecitley set i_version as reqieremt, so this
> option was provided as well.

Maybe IMA doesn't care, but if you set MS_I_VERSION the fs does give
a guarantee.  Sp NAK on this patch as-is.

[toc] | [prev] | [next] | [standalone]


#1621860 — Re: [PATCH v2 2/3] fs: ubifs: update i_version on inode changes

FromOleksij Rempel <ore@pengutronix.de>
Date2017-04-12 09:10 +0200
SubjectRe: [PATCH v2 2/3] fs: ubifs: update i_version on inode changes
Message-ID<tvkzE-1we-9@gated-at.bofh.it>
In reply to#1621827
On Tue, Apr 11, 2017 at 11:08:47PM -0700, Christoph Hellwig wrote:
> On Wed, Apr 12, 2017 at 08:05:34AM +0200, Oleksij Rempel wrote:
> > The code seems to confirm it. So i assumed that IMA don't care if
> > i_version is stored to disk or not. And i_version is the only way
> > to notify IMA about inode changes.
> > Since IMA documentation explecitley set i_version as reqieremt, so this
> > option was provided as well.
> 
> Maybe IMA doesn't care, but if you set MS_I_VERSION the fs does give
> a guarantee.  Sp NAK on this patch as-is.

Ok, it was an expekted NACK :)
Suddenly right now i don't have good ide to solve it. IMA just won't to
know if some runtime changes was made to FS. Currently i can image
fallowing variants:
- rework IMA
- add MS_I_TEMP_VERSION and keep i_version using for it.
- add new variable for external use only. For example: ima_rt_i_version,
  or some thing like this.

Other ideas?

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

[toc] | [prev] | [next] | [standalone]


#1629685 — Re: [PATCH v2 2/3] fs: ubifs: update i_version on inode changes

FromRichard Weinberger <richard@nod.at>
Date2017-04-24 17:50 +0200
SubjectRe: [PATCH v2 2/3] fs: ubifs: update i_version on inode changes
Message-ID<tzOpr-mK-5@gated-at.bofh.it>
In reply to#1621860
Oleksij,

Am 12.04.2017 um 09:04 schrieb Oleksij Rempel:
> On Tue, Apr 11, 2017 at 11:08:47PM -0700, Christoph Hellwig wrote:
>> On Wed, Apr 12, 2017 at 08:05:34AM +0200, Oleksij Rempel wrote:
>>> The code seems to confirm it. So i assumed that IMA don't care if
>>> i_version is stored to disk or not. And i_version is the only way
>>> to notify IMA about inode changes.
>>> Since IMA documentation explecitley set i_version as reqieremt, so this
>>> option was provided as well.
>>
>> Maybe IMA doesn't care, but if you set MS_I_VERSION the fs does give
>> a guarantee.  Sp NAK on this patch as-is.
> 
> Ok, it was an expekted NACK :)
> Suddenly right now i don't have good ide to solve it. IMA just won't to
> know if some runtime changes was made to FS. Currently i can image
> fallowing variants:
> - rework IMA

I assumed that you checked that option already. I IMA *really* needs i_version,
we can think of an solution. Adding new filesystem features should be done with
care.

> - add MS_I_TEMP_VERSION and keep i_version using for it.

You mean a non-persistent i_version like fat and exofs use internally?

> - add new variable for external use only. For example: ima_rt_i_version,
>   or some thing like this.

hch will hate this for very good reasons. :-)

> Other ideas?

What about making i_version persistent?
We still have some empty fields in UBIFS' inode data structure.
But first we have to be very sure that we need it.

Artem, do you remember why UBIFS does not store i_version?

Thanks,
//richard

[toc] | [prev] | [next] | [standalone]


#1621112 — [PATCH v2 1/3] fs: ubifs: parse iversion mount option

FromOleksij Rempel <o.rempel@pengutronix.de>
Date2017-04-11 12:00 +0200
Subject[PATCH v2 1/3] fs: ubifs: parse iversion mount option
Message-ID<tv0KD-5hT-33@gated-at.bofh.it>
In reply to#1621104
From: Steffen Trumtrar <s.trumtrar@pengutronix.de>

this option is needed to make UBIFS work with IMA.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 fs/ubifs/super.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index b73811bd7676..bff1e8d6f7bd 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -931,6 +931,7 @@ enum {
 	Opt_chk_data_crc,
 	Opt_no_chk_data_crc,
 	Opt_override_compr,
+	Opt_i_version,
 	Opt_err,
 };
 
@@ -942,6 +943,7 @@ static const match_table_t tokens = {
 	{Opt_chk_data_crc, "chk_data_crc"},
 	{Opt_no_chk_data_crc, "no_chk_data_crc"},
 	{Opt_override_compr, "compr=%s"},
+	{Opt_i_version, "i_version"},
 	{Opt_err, NULL},
 };
 
@@ -986,6 +988,7 @@ static int ubifs_parse_options(struct ubifs_info *c, char *options,
 		return 0;
 
 	while ((p = strsep(&options, ","))) {
+		struct super_block *sb = c->vfs_sb;
 		int token;
 
 		if (!*p)
@@ -1042,10 +1045,12 @@ static int ubifs_parse_options(struct ubifs_info *c, char *options,
 			c->default_compr = c->mount_opts.compr_type;
 			break;
 		}
+		case Opt_i_version:
+			sb->s_flags |= MS_I_VERSION;
+			break;
 		default:
 		{
 			unsigned long flag;
-			struct super_block *sb = c->vfs_sb;
 
 			flag = parse_standard_option(p);
 			if (!flag) {
-- 
2.11.0

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | linux.kernel


csiph-web