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]
Date:	Thu, 22 Mar 2012 16:58:43 +0200
From:	"Kasatkin, Dmitry" <dmitry.kasatkin@...el.com>
To:	Mimi Zohar <zohar@...ux.vnet.ibm.com>
Cc:	Al Viro <viro@...iv.linux.org.uk>,
	linux-security-module@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	David Safford <safford@...ux.vnet.ibm.com>,
	Matt Helsley <matt.helsley@...il.com>,
	Mimi Zohar <zohar@...ibm.com>
Subject: Re: [PATCH v3 10/12] ima: defer calling __fput()

On Thu, Mar 22, 2012 at 4:53 PM, Mimi Zohar <zohar@...ux.vnet.ibm.com> wrote:
> On Thu, 2012-03-22 at 14:22 +0000, Al Viro wrote:
>> On Wed, Mar 21, 2012 at 02:54:15PM -0400, Mimi Zohar wrote:
>> > If a file is closed before it is munmapped, __fput() is called with
>> > the mmap_sem taken.  With IMA-appraisal enabled, this results in an
>> > mmap_sem/i_mutex lockdep.  ima_defer_fput() increments the f_count
>> > to defer __fput() being called until after the mmap_sem is released.
>>
>> NAK.  It's far too heavy-weight for what's a very common path.  Worse,
>> it causes different locking conditions on IMA and non-IMA kernels and makes
>> bugs harder to spot.  Rejected with extreme prejudice; please, fix your
>> locking instead.
>
> Al, thanks for replying!  I realize you are very prejudiced against IMA,
> but have you taken a look at IMA-appraisal?  It probably would have been
> better if we used another name in order to avoid this prejudice, but
> unfortunately we didn't.  :(  IMA-appraisal is about enforcing file
> integrity.
>
>> BTW, you've missed several other places in mm/* doing fput(), so it wouldn't
>> be enough to paper over your problem anyway.
>>

In current solution, deferred call can be added directly to __fput and checking
if mmap_sem is locked.

>> Final fput() *can* happen under mmap_sem.  Period.
>
> I think I got that loud and clear; otherwise we wouldn't have come up
> with deferring the __fput().  We have a very real problem here - writing
> extended attributes requires taking the i_mutex.  I'm open to any
> suggestions.
>
> 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