From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756253Ab2DTWfy (ORCPT ); Fri, 20 Apr 2012 18:35:54 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:51810 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755420Ab2DTWfv convert rfc822-to-8bit (ORCPT ); Fri, 20 Apr 2012 18:35:51 -0400 MIME-Version: 1.0 In-Reply-To: <20120420221315.GN6871@ZenIV.linux.org.uk> References: <1334772473.2137.22.camel@falcor> <20120418183938.GH6589@ZenIV.linux.org.uk> <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> From: Linus Torvalds Date: Fri, 20 Apr 2012 15:35:29 -0700 X-Google-Sender-Auth: 7LTFhqGnO6QHZCHmEBcz1Qlatqs Message-ID: Subject: Re: [RFC] situation with fput() locking (was Re: [PULL REQUEST] : ima-appraisal patches) To: Al Viro Cc: Hugh Dickins , linux-fsdevel@vger.kernel.org, James Morris , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, David Safford , Dmitry Kasatkin , Mimi Zohar , David Miller , Andrew Morton Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 20, 2012 at 3:13 PM, Al Viro wrote: > > Kinda-sorta.  I agree that such helpers make sense, but you are too > optimistic about the number of such places.  And clusterfuck around > mremap() is fairly deep, so propagating all way back to up_write() > wont' be fun. Fair enough. I'll do the helpers and see how much they get rid of, just because looking at all the callers, those helpers seem to be obviously the right thing anyway. So even if we don't do anything else, we can improve things regardless. For do_brk(), for example, it looks like do_brk() itself should actually be entirely static to mm/mmap.c, because every single caller from the outside actually wants the self-locking version. So plan right now: do "vm_xyzzy()" helper functions that do "do_xyzzy()" and take the lock (and do not take the "mm" argument, because it had better always be the current one - keep the calling convention as simple as possible). Linus From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: [RFC] situation with fput() locking (was Re: [PULL REQUEST] : ima-appraisal patches) Date: Fri, 20 Apr 2012 15:35:29 -0700 Message-ID: References: <1334772473.2137.22.camel@falcor> <20120418183938.GH6589@ZenIV.linux.org.uk> <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=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Hugh Dickins , linux-fsdevel@vger.kernel.org, James Morris , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, David Safford , Dmitry Kasatkin , Mimi Zohar , David Miller , Andrew Morton To: Al Viro Return-path: In-Reply-To: <20120420221315.GN6871@ZenIV.linux.org.uk> Sender: linux-security-module-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Fri, Apr 20, 2012 at 3:13 PM, Al Viro wrot= e: > > Kinda-sorta. =A0I agree that such helpers make sense, but you are too > optimistic about the number of such places. =A0And clusterfuck around > mremap() is fairly deep, so propagating all way back to up_write() > wont' be fun. =46air enough. I'll do the helpers and see how much they get rid of, just because looking at all the callers, those helpers seem to be obviously the right thing anyway. So even if we don't do anything else, we can improve things regardless. =46or do_brk(), for example, it looks like do_brk() itself should actually be entirely static to mm/mmap.c, because every single caller from the outside actually wants the self-locking version. So plan right now: do "vm_xyzzy()" helper functions that do "do_xyzzy()" and take the lock (and do not take the "mm" argument, because it had better always be the current one - keep the calling convention as simple as possible). Linus -- To unsubscribe from this list: send the line "unsubscribe linux-securit= y-module" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html