From: Chris Wright <chrisw@osdl.org>
To: akpm@osdl.org, torvalds@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] add disable param to capabilities module
Date: Tue, 11 May 2004 16:56:39 -0700 [thread overview]
Message-ID: <20040511165639.Q21045@build.pdx.osdl.net> (raw)
In-Reply-To: <20040511165000.P21045@build.pdx.osdl.net>; from chrisw@osdl.org on Tue, May 11, 2004 at 04:50:00PM -0700
Add disable param to capabilities module. Similar to the SELinux param
for disabling at boot time. This allows vendors to ship single binary
image with capabilities compiled statically, and disable it if they
provide another security model compiled as module.
--- linus-2.5/security/capability.c~disable 2004-05-11 16:14:36.121676768 -0700
+++ linus-2.5/security/capability.c 2004-05-11 16:19:25.906622760 -0700
@@ -22,6 +22,7 @@
#include <linux/skbuff.h>
#include <linux/netlink.h>
#include <linux/ptrace.h>
+#include <linux/moduleparam.h>
static struct security_operations capability_ops = {
.ptrace = cap_ptrace,
@@ -52,9 +53,16 @@
/* flag to keep track of how we were registered */
static int secondary;
+static int capability_disable;
+module_param_named(disable, capability_disable, int, 0);
+MODULE_PARM_DESC(disable, "To disable capabilities module set disable = 1");
static int __init capability_init (void)
{
+ if (capability_disable) {
+ printk(KERN_INFO "Capabilities disabled at initialization\n");
+ return 0;
+ }
/* register ourselves with the security framework */
if (register_security (&capability_ops)) {
/* try registering with primary module */
@@ -72,6 +80,8 @@
static void __exit capability_exit (void)
{
+ if (capability_disable)
+ return;
/* remove ourselves from the security framework */
if (secondary) {
if (mod_unreg_security (MY_NAME, &capability_ops))
prev parent reply other threads:[~2004-05-12 0:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-11 23:46 [PATCH 1/3] remove empty build of capability.o Chris Wright
2004-05-11 23:50 ` [PATCH 2/3] minor cleanups in capability.c Chris Wright
2004-05-11 23:56 ` Chris Wright [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040511165639.Q21045@build.pdx.osdl.net \
--to=chrisw@osdl.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®