From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932300Ab2D0Req (ORCPT ); Fri, 27 Apr 2012 13:34:46 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:58253 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760331Ab2D0Reo (ORCPT ); Fri, 27 Apr 2012 13:34:44 -0400 Date: Fri, 27 Apr 2012 18:34:18 +0100 From: Al Viro To: "Kasatkin, Dmitry" Cc: Linus Torvalds , Hugh Dickins , linux-fsdevel@vger.kernel.org, James Morris , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, David Safford , Mimi Zohar , David Miller , Andrew Morton Subject: Re: [RFC] situation with fput() locking (was Re: [PULL REQUEST] : ima-appraisal patches) Message-ID: <20120427173417.GK6871@ZenIV.linux.org.uk> References: <1334865448.2429.35.camel@falcor> <20120420004303.GB6871@ZenIV.linux.org.uk> <20120420190418.GK6871@ZenIV.linux.org.uk> <20120420195833.GM6871@ZenIV.linux.org.uk> <20120420221315.GN6871@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 27, 2012 at 10:35:25AM +0300, Kasatkin, Dmitry wrote: > But have you seen the proposed patch for __fput()? > [PATCH v4 10/12] ima: defer calling __fput() > > It defers only of course the last AND mmap_sem is locked AND open for write. > > if (current->mm && rwsem_is_locked(¤t->mm->mmap_sem)) { > if (ima_defer_fput(file) == 0) > return; > } > > Just 5 out of ~100,000 mmap_sem held fput() calls were deferred. Let me get it straight. a) You still ignore all the problems with that described in the posting right in the beginning of this thread. b) You ignore the problems with semantics changes from user-visible delays of fput() past the return from syscall (described in Linus' posting upthread - they apply to this "solution" as well). c) You seem to consider the fact that this path will be exercised very rarely, thus making any races on it damn hard to reproduce and debug as a good thing. And as for the sentiment expressed in the beginning of your posting (that smaller patch size is worth more than clean locking rules, maintainability of resulting kernel, etc.)... I'm sorry, but you guys need to decide what IMA is. If it's a first-class part of the kernel, you have your priorities backwards...