mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Serge Hallyn <serue@us.ibm.com>
To: Chris Wright <chrisw@osdl.org>
Cc: Andrew Morton <akpm@osdl.org>, lkml <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] [PATCH] [4/6] LSM Stacking: seclvl LSM stacking support
Date: Thu, 04 Nov 2004 17:09:55 -0600	[thread overview]
Message-ID: <1099609795.2096.20.camel@serge.austin.ibm.com> (raw)
In-Reply-To: <1099609471.2096.10.camel@serge.austin.ibm.com>

This patch adds stacking support to the BSD Secure Level LSM.

Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>

Index: linux-2.6.10-rc1-bk12-stack/security/seclvl.c
===================================================================
--- linux-2.6.10-rc1-bk12-stack.orig/security/seclvl.c	2004-11-02
20:28:47.000000000 -0600
+++ linux-2.6.10-rc1-bk12-stack/security/seclvl.c	2004-11-03
23:01:08.478130544 -0600
@@ -58,6 +58,8 @@
 MODULE_PARM_DESC(verbosity, "Initial verbosity level (0 or 1; defaults
to "
 		 "0, which is Quiet)");
 
+static int seclvl_idx;
+
 /**
  * Optional password which can be passed in to bring seclvl to 0
  * (i.e., for halt/reboot).  Defaults to NULL (the passwd attribute
@@ -498,7 +500,7 @@
 			return -EPERM;
 		}
 		/* claimed, mark it to release on close */
-		inode->i_security = current;
+		inode->i_security[seclvl_idx] = current;
 	}
 	return 0;
 }
@@ -506,12 +508,12 @@
 /* release the blockdev if you claimed it */
 static void seclvl_bd_release(struct inode *inode)
 {
-	if (inode && S_ISBLK(inode->i_mode) && inode->i_security == current) {
+	if (inode && S_ISBLK(inode->i_mode) && inode->i_security[seclvl_idx]
== current) {
 		struct block_device *bdev = inode->i_bdev;
 		if (bdev) {
 			bd_release(bdev);
 			blkdev_put(bdev);
-			inode->i_security = NULL;
+			inode->i_security[seclvl_idx] = NULL;
 		}
 	}
 }
@@ -697,11 +699,12 @@
 			      "seclvl: Failure registering with the "
 			      "kernel.\n");
 		/* try registering with primary module */
-		rc = mod_reg_security(MY_NAME, &seclvl_ops);
-		if (rc) {
+		seclvl_idx = mod_reg_security(MY_NAME, &seclvl_ops);
+		if (seclvl_idx < 0) {
 			seclvl_printk(0, KERN_ERR, "seclvl: Failure "
 				      "registering with primary security "
 				      "module.\n");
+			rc = seclvl_idx;
 			goto exit;
 		}		/* if primary module registered */
 		secondary = 1;



  parent reply	other threads:[~2004-11-04 22:17 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-04 23:04 [RFC] [PATCH] [0/6] LSM Stacking Serge Hallyn
2004-11-04 22:52 ` Chris Wright
2004-11-05  1:01   ` Serge E. Hallyn
2004-11-05  1:05     ` Chris Wright
2004-11-05  2:16       ` James Morris
2004-11-04 23:06 ` [RFC] [PATCH] [1/6] LSM Stacking: Replace LSM void* with arrays Serge Hallyn
2004-11-04 22:34   ` Chris Wright
2004-11-04 23:08 ` [RFC] [PATCH] [2/6] LSM Stacking: Add stacker LSM Serge Hallyn
2004-11-04 22:42   ` Chris Wright
2004-11-10 17:43   ` Jonathan Corbet
2004-11-10 19:32     ` Serge E. Hallyn
2004-11-04 23:08 ` [RFC] [PATCH] [3/6] LSM Stacking: capability LSM stacking support Serge Hallyn
2004-11-04 23:09 ` Serge Hallyn [this message]
2004-11-04 23:11 ` [RFC] [PATCH] [5/6] LSM Stacking: SELinux " Serge Hallyn
2004-11-04 22:45   ` Chris Wright
2004-11-04 23:12 ` [RFC] [PATCH] [6/6] LSM Stacking: temporary setprocattr hack Serge Hallyn
2004-11-04 22:48   ` Chris Wright
2004-11-05  0:52     ` Serge E. Hallyn
2004-11-05  0:56       ` Chris Wright
2004-11-04 23:14 ` [RFC] [PATCH] [1/3] LSM Stacking: stackable bsdjail (tasklookup) Serge Hallyn
2004-11-04 23:15 ` [RFC] [PATCH] [2/3] LSM Stacking: stackable bsdjail (bsdjail lsm) Serge Hallyn
2004-11-04 23:16 ` [RFC] [PATCH] [3/3] LSM Stacking: stackable bsdjail (Documentation) Serge Hallyn
2004-11-04 23:51 ` [RFC] [PATCH] [0/6] LSM Stacking James Morris
2004-11-05  7:23 ` Valdis.Kletnieks
2004-11-05 16:32   ` Serge E. Hallyn
2004-11-05 16:51   ` Stephen Smalley

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=1099609795.2096.20.camel@serge.austin.ibm.com \
    --to=serue@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=chrisw@osdl.org \
    --cc=linux-kernel@vger.kernel.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®