lkml.org 
[lkml]   [2012]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 10/12] ima: defer calling __fput()
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.

BTW, you've missed several other places in mm/* doing fput(), so it wouldn't
be enough to paper over your problem anyway.

Final fput() *can* happen under mmap_sem. Period.


\
 
 \ /
  Last update: 2012-03-22 15:25    [W:0.108 / U:0.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site