From: Chris Wright <chrisw@osdl.org>
To: serue@us.ibm.com
Cc: James Morris <jmorris@redhat.com>,
lkml <linux-kernel@vger.kernel.org>,
Chris Wright <chrisw@osdl.org>,
Stephen Smalley <sds@epoch.ncsc.mil>,
Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH] Stacker - single-use static slots
Date: Wed, 3 Aug 2005 10:57:42 -0700 [thread overview]
Message-ID: <20050803175742.GI7762@shell0.pdx.osdl.net> (raw)
In-Reply-To: <20050803164516.GB13691@serge.austin.ibm.com>
* serue@us.ibm.com (serue@us.ibm.com) wrote:
> Index: linux-2.6.12/include/linux/security.h
> ===================================================================
> --- linux-2.6.12.orig/include/linux/security.h 2005-08-01 20:00:51.000000000 -0500
> +++ linux-2.6.12/include/linux/security.h 2005-08-01 20:23:52.000000000 -0500
> @@ -44,24 +44,65 @@ struct security_list {
> };
>
>
> +static inline void *__get_value(void *head, int idx)
> +{
> + void **p = head + sizeof(struct hlist_head);
> +#if 0
> + printk(KERN_NOTICE "__get_value: %s (%d): head %lx p %lx idx %d returning %lx at %lx\n",
> + __FUNCTION__, __LINE__, (long)head, (long)p, idx, (long)p[idx], (long)&p[idx]);
> +#endif
> + return p[idx];
pr_debug
> +}
> +
> +static inline void __set_value(void *head, int idx, void *v)
> +{
> + void **p = head + sizeof(struct hlist_head);
> + p[idx] = v;
> +#if 0
> + printk(KERN_NOTICE "%s (%d): hd %lx, p %lx, idx %d,"
> + "v %lx, p[idx] %lx at %lx\n",
> + __FUNCTION__, __LINE__, (long) (head),
> + (long) p, idx, (long) (v),
> + (long)p[idx], (long)&p[idx]);
> +#endif
pr_debug
> Index: linux-2.6.12/security/Kconfig
> ===================================================================
> --- linux-2.6.12.orig/security/Kconfig 2005-08-01 20:00:51.000000000 -0500
> +++ linux-2.6.12/security/Kconfig 2005-08-01 20:24:11.000000000 -0500
> @@ -112,5 +112,17 @@ config SECURITY_STACKER
> help
> Stack multiple LSMs.
>
> +config SECURITY_STACKER_NUMFIELDS
> + int "Number of security fields to reserve"
> + depends on SECURITY_STACKER
> + default 1
Not sure config is worth it, also, James had suggested smth like 3
slots.
> INIT_HLIST_HEAD(&inode->i_security);
> + memset(&inode->i_security_p, 0,
> + CONFIG_SECURITY_STACKER_NUMFIELDS*sizeof(void *));
This CONFIG... is a bit rough. Can we use a simple name, and if config
is necessary, assign config to simple name?
> inode->dirtied_when = 0;
> if (security_inode_alloc(inode)) {
> if (inode->i_sb->s_op->destroy_inode)
> Index: linux-2.6.12/include/linux/binfmts.h
> ===================================================================
> --- linux-2.6.12.orig/include/linux/binfmts.h 2005-08-01 20:00:50.000000000 -0500
> +++ linux-2.6.12/include/linux/binfmts.h 2005-08-01 20:24:41.000000000 -0500
> @@ -30,6 +30,7 @@ struct linux_binprm{
> int e_uid, e_gid;
> kernel_cap_t cap_inheritable, cap_permitted, cap_effective;
> struct hlist_head security;
> + void * security_p[CONFIG_SECURITY_STACKER_NUMFIELDS];
> int argc, envc;
> char * filename; /* Name of binary as seen by procps */
> char * interp; /* Name of the binary really executed. Most
> Index: linux-2.6.12/include/linux/fs.h
> ===================================================================
> --- linux-2.6.12.orig/include/linux/fs.h 2005-08-01 20:00:50.000000000 -0500
> +++ linux-2.6.12/include/linux/fs.h 2005-08-01 20:24:55.000000000 -0500
> @@ -486,6 +486,7 @@ struct inode {
>
> atomic_t i_writecount;
> struct hlist_head i_security;
> + void *i_security_p[CONFIG_SECURITY_STACKER_NUMFIELDS];
James had suggested to effectively stash the list in the last slot, so
there's only the array with one reserved slot.
thanks,
-chris
next prev parent reply other threads:[~2005-08-03 18:01 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-27 18:17 [patch 0/15] lsm stacking v0.3: intro serue
2005-07-27 18:19 ` [patch 1/15] lsm stacking v0.3: introduce securityfs serue
2005-07-27 18:20 ` [patch 2/15] lsm stacking v0.3: add module * to security_ops serue
2005-07-27 18:21 ` [patch 3/15] lsm stacking v0.3: don't default to dummy_##hook serue
2005-07-27 18:23 ` [patch 4/15] lsm stacking v0.3: swith ->security to hlist serue
2005-07-27 18:24 ` [patch 5/15] lsm stacking v0.3: introduce security_*_value API serue
2005-07-27 18:24 ` [patch 6/15] lsm stacking v0.3: stacker documentation serue
2005-07-27 18:24 ` [patch 7/15] lsm stacking v0.3: actual stacker module serue
2005-07-27 18:25 ` [patch 8/15] lsm stacking v0.3: stackable capabilities lsm serue
2005-07-27 18:26 ` [patch 9/15] lsm stacking v0.3: selinux: update ->security structs serue
2005-07-27 18:26 ` [patch 10/15] lsm stacking v0.3: selinux: use security_*_value API serue
2005-07-27 18:27 ` [patch 11/15] lsm stacking v0.3: selinux: remove secondary support serue
2005-07-27 18:27 ` [patch 12/15] lsm stacking v0.3: hook completeness verification script serue
2005-07-27 18:28 ` [patch 13/15] lsm stacking v0.3: seclvl: update for stacking serue
2005-07-27 18:28 ` [patch 14/15] lsm stacking v0.3: fix security_{del,unlink}_value race serue
2005-07-27 18:28 ` [patch 15/15] lsm stacking v0.3: stacking for digsig serue
2005-07-27 19:34 ` [patch 0/15] lsm stacking v0.3: intro James Morris
2005-07-27 19:37 ` James Morris
2005-08-03 16:45 ` [PATCH] Stacker - single-use static slots serue
2005-08-03 17:57 ` Chris Wright [this message]
2005-08-03 19:27 ` serue
2005-08-03 19:45 ` Chris Wright
2005-08-03 20:31 ` serge
2005-08-05 15:55 ` James Morris
2005-08-05 17:27 ` serue
2005-08-05 17:34 ` serue
2005-08-10 14:45 ` serue
2005-08-11 7:42 ` James Morris
2005-08-11 21:22 ` serue
2005-08-11 23:02 ` James Morris
2005-07-27 19:54 ` [patch 0/15] lsm stacking v0.3: intro serue
2005-07-30 5:07 ` Tony Jones
2005-07-30 19:02 ` serge
2005-07-30 20:18 ` Tony Jones
2005-07-31 3:22 ` Steve Beattie
2005-07-31 3:44 ` serge
2005-07-31 4:13 ` Tony Jones
2005-07-31 13:37 ` serge
2005-07-31 3:53 ` serge
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=20050803175742.GI7762@shell0.pdx.osdl.net \
--to=chrisw@osdl.org \
--cc=akpm@osdl.org \
--cc=jmorris@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sds@epoch.ncsc.mil \
--cc=serue@us.ibm.com \
/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