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 14:12:55 -0700 Message-ID: References: <1334754302.2137.8.camel@falcor> <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> 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: <20120420195833.GM6871@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 12:58 PM, Al Viro wro= te: > > So does a bunch of other places. =A0Let me dig out the call graph cir= ca > 3.3.0... =A0Here is the relevant part: Yes, but a lot of those would actually be helped by a helper function that does all of: - grab mmap_sem - call do_m[un]map() - release mmap_sem and that would actually clean them up even in the current case. And then we could do the cleanup in just the helper function. Not all, no. But a preparatory patch that just creates the helper functions for doing brk/mmap/munmap would get rid of a fairly big chunk of them. You can visualize how many of them do that by just doing git grep -5 do_m[un]*map and then high-lghting '_write(' (to visually show the down_write/up_write pairs that surround most of them) by searching for it. Are they all like that? No. But most of the ones outside of mm/ do fit that simple pattern and should probably be fixed up just to have them not contain VM locking details in them *anyway*. 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