Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752112AbZLXC1B (ORCPT ); Wed, 23 Dec 2009 21:27:01 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751478AbZLXC1A (ORCPT ); Wed, 23 Dec 2009 21:27:00 -0500 Received: from lists.laptop.org ([18.85.2.145]:48026 "EHLO mail.laptop.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751108AbZLXC07 (ORCPT ); Wed, 23 Dec 2009 21:26:59 -0500 Date: Wed, 23 Dec 2009 21:29:02 -0500 From: Michael Stone To: linux-kernel@vger.kernel.org Cc: linux-security-module@vger.kernel.org, Andi Kleen , David Lang , Oliver Hartkopp , Alan Cox , Herbert Xu , Valdis Kletnieks , Bryan Donlan , Evgeniy Polyakov , "C. Scott Ananian" , James Morris , "Eric W. Biederman" , Bernie Innocenti , Mark Seaborn , Randy Dunlap , =?iso-8859-1?Q?Am=E9rico?= Wang , Michael Stone Subject: A basic question about the security_* hooks Message-ID: <20091224022902.GA24234@heat> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1356 Lines: 32 Dear kernel folks, There are a variety of places where I'd like to be able to get the kernel to return EPERM more often [1]. Many of these places already have security hooks. Unfortunately, I don't feel that I can make effective use of these hooks because they seem to be "occupied" by the large mandatory access control frameworks. I'm hoping that you can tell me why this state of affairs persists. More specifically, now that LSMs are statically linked, why is it good for the security hooks to call into a single monolithic "security_ops" struct instead of cheaper and simpler alternatives? In particular, what would be worse about a kernel in which each security hook contained nothing but conditionally-compiled function calls to the appropriate "real" implementation functions with early-exit jumps on non-zero return codes? Thanks, Michael [1]: Two examples include my recent network-privileges patches and Eric Biederman's suggestions on how to make unprivileged unshare(CLONE_NEWNET) safe. I have little doubt that I'd think of more if I thought that the security hooks were accessible to me. -- 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/