Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754946Ab2EPPXo (ORCPT ); Wed, 16 May 2012 11:23:44 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:33015 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753218Ab2EPPXl convert rfc822-to-8bit (ORCPT ); Wed, 16 May 2012 11:23:41 -0400 MIME-Version: 1.0 In-Reply-To: References: <1336963631-3541-1-git-send-email-zohar@us.ibm.com> <1337112446.20904.50.camel@falcor> <20120516004251.GO22082@ZenIV.linux.org.uk> <1337175731.2492.4.camel@localhost> <1337176336.3522.5.camel@falcor> From: Linus Torvalds Date: Wed, 16 May 2012 08:23:19 -0700 X-Google-Sender-Auth: 8ZNzzhZ-gjvTcvOM0UApfjLMSG4 Message-ID: Subject: Re: [PATCH] vfs: fix IMA lockdep circular locking dependency To: Eric Paris Cc: Mimi Zohar , James Morris , Al Viro , Mimi Zohar , linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org 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 Content-Length: 1412 Lines: 30 On Wed, May 16, 2012 at 7:06 AM, Eric Paris wrote: > > But it would be flat wrong to put it there. ?True historically we did > things differently, but this patch is right given Linus is doing it a > different way. Indeed. As Eric points out, I'm forcing the address capability checks on everybody, so defaulting to them is actively the wrong thing to do. I think the NULL pointer games are from back when we inlined the security hooks into the code directly, rather than have out-of-line helper functions. At that point, the code expansion overhead of loading the pointer, checking it for NULL, and then calling it was quite noticeable. But we uninlined them in 2007 (commit 20510f2f4e2d: "security: Convert LSM into a static interface"), so I think the "set to default so that you can do an unconditional jump" is not all that useful any more. Of course, if all security models do export the fn, not having the conditional is still useful. But defaulting to the capability one is not in this case, since we will call the capability version later anyway. So it should be defaulted to something that just returns 0. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/