lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALLzPKbqAa7-vJnXbYFbkaD5NVW=6wHQQMDc_Ww==p1hwQ1EJg@mail.gmail.com>
Date:	Wed, 12 Dec 2012 00:57:21 +0200
From:	"Kasatkin, Dmitry" <dmitry.kasatkin@...el.com>
To:	Eric Paris <eparis@...isplace.org>
Cc:	Mimi Zohar <zohar@...ux.vnet.ibm.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Al Viro <viro@...iv.linux.org.uk>,
	linux-fsdevel <linux-fsdevel@...r.kernel.org>,
	LSM List <linux-security-module@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	James Morris <jmorris@...ei.org>
Subject: Re: [PATCH 0/2] ima: policy search speedup

On Tue, Dec 11, 2012 at 10:08 PM, Eric Paris <eparis@...isplace.org> wrote:
> S_PRIVATE is totally unacceptable as it has a meaning across all LSMs,
> not just IMA.
>
> S_NOSEC means 'this is not setuid or setgid and we don't need to do
> those checks on modify'
>
> You are going to need to use a S_NOIMA.
>
> Of Dmitry's 90,000 fewer policy lookups using the per sb flag, how
> many of them are the same inode over and over again which would be
> circumvented using S_NOIMA per inode flag?
>

IIRC those were only newly instantiated inodes.

For new inodes, S_NOIMA would not be set and used at that point.
IMA must do the policy search and then would set the S_NOIMA.

For subsequent calls, S_NOIMA makes sense.

If we would have the SB flag like MS_NOIMA, then we could replicate sb
flag to inode S_NOIMA flag,
in similar way as inode_has_no_xattr() does:

static inline void inode_has_no_xattr(struct inode *inode)
{
	if (!is_sxid(inode->i_mode) && (inode->i_sb->s_flags & MS_NOSEC))
		inode->i_flags |= S_NOSEC;
}

Then later there is no need to dereference inode->i_sb...

Can we reach conclusion about it?
Will we have SB flag?
if yes, then where, s_flags, or in some other field like s_feature_flags?
if not, then we can stop this discussion...

- Dmitry

>
>
> On Tue, Dec 11, 2012 at 2:48 PM, Mimi Zohar <zohar@...ux.vnet.ibm.com> wrote:
>> On Tue, 2012-12-11 at 11:10 -0800, Linus Torvalds wrote:
>>
>>> Anyway, the whole "you can do it at file granularity" isn't the bulk
>>> of my argument (the "we already have the field that makes sense" is).
>>> But my point is that per-inode is not only the logically more
>>> straightforward place to do it, it's also the much more flexible place
>>> to do it. Because it *allows* for things like that.
>>
>> Ok. To summarize, S_IMA indicates that there is a rule and that the iint
>> was allocated.  To differentiate between 'haven't looked/don't know' and
>> 'definitely not', we need another bit.  For this, you're suggesting
>> using IS_PRIVATE()?  Hopefully, I misunderstood.
>>
>> thanks,
>>
>> Mimi
>>
>>
>>
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ