From: Chad Sellers <csellers@tresys.com>
To: selinux@tycho.nsa.gov
Subject: [PATCH 3/4] Export object class and permission definitions
Date: Fri, 06 Oct 2006 16:09:54 -0400 [thread overview]
Message-ID: <20061006201104.330310000@tresys.com> (raw)
In-Reply-To: 20061006200951.006196000@tresys.com
This patch moves the definition of the 3 structs containing object class and permission definitions from avc.c to avc_ss.h so that the security server can access them. The patch also adds a new struct type, defined_classes_perms_t, suitable for allowing the security server to access these data structures from the avc.
Signed-off-by: Chad Sellers <csellers@tresys.com>
---
security/selinux/avc.c | 23 +++++++++++------------
security/selinux/include/avc_ss.h | 24 ++++++++++++++++++++++++
2 files changed, 35 insertions(+), 12 deletions(-)
Index: linux-2.6-discovery/security/selinux/avc.c
===================================================================
--- linux-2.6-discovery.orig/security/selinux/avc.c
+++ linux-2.6-discovery/security/selinux/avc.c
@@ -32,12 +32,7 @@
#include "avc.h"
#include "avc_ss.h"
-static const struct av_perm_to_string
-{
- u16 tclass;
- u32 value;
- const char *name;
-} av_perm_to_string[] = {
+static const struct av_perm_to_string_t av_perm_to_string[] = {
#define S_(c, v, s) { c, v, s },
#include "av_perm_to_string.h"
#undef S_
@@ -57,17 +52,21 @@ static const char *class_to_string[] = {
#undef TE_
#undef S_
-static const struct av_inherit
-{
- u16 tclass;
- const char **common_pts;
- u32 common_base;
-} av_inherit[] = {
+static const struct av_inherit_t av_inherit[] = {
#define S_(c, i, b) { c, common_##i##_perm_to_string, b },
#include "av_inherit.h"
#undef S_
};
+const struct defined_classes_perms_t defined_classes_perms = {
+ av_perm_to_string,
+ ARRAY_SIZE(av_perm_to_string),
+ class_to_string,
+ ARRAY_SIZE(class_to_string),
+ av_inherit,
+ ARRAY_SIZE(av_inherit)
+};
+
#define AVC_CACHE_SLOTS 512
#define AVC_DEF_CACHE_THRESHOLD 512
#define AVC_CACHE_RECLAIM 16
Index: linux-2.6-discovery/security/selinux/include/avc_ss.h
===================================================================
--- linux-2.6-discovery.orig/security/selinux/include/avc_ss.h
+++ linux-2.6-discovery/security/selinux/include/avc_ss.h
@@ -10,5 +10,29 @@
int avc_ss_reset(u32 seqno);
+struct av_perm_to_string_t
+{
+ u16 tclass;
+ u32 value;
+ const char *name;
+};
+
+struct av_inherit_t
+{
+ u16 tclass;
+ const char **common_pts;
+ u32 common_base;
+};
+
+struct defined_classes_perms_t
+{
+ const struct av_perm_to_string_t *av_perm_to_string;
+ u32 av_perm_to_string_len;
+ const char **class_to_string;
+ u32 class_to_string_len;
+ const struct av_inherit_t *av_inherit;
+ u32 av_inherit_len;
+};
+
#endif /* _SELINUX_AVC_SS_H_ */
--
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next prev parent reply other threads:[~2006-10-06 20:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-06 20:09 [PATCH 0/4] Validate kernel object classes and permissions Chad Sellers
2006-10-06 20:09 ` [PATCH 1/4] Bug fix in polidydb_destroy Chad Sellers
2006-10-06 20:38 ` James Morris
2006-10-06 20:09 ` [PATCH 2/4] Remove current validation mechanism Chad Sellers
2006-10-06 21:07 ` Stephen Smalley
2006-10-06 22:19 ` Chad Sellers
2006-10-06 20:09 ` Chad Sellers [this message]
2006-10-06 20:09 ` [PATCH 4/4] Validate kernel object classes and permissions Chad Sellers
2006-10-06 21:37 ` Stephen Smalley
2006-10-06 22:25 ` Chad Sellers
2006-10-10 13:25 ` Stephen Smalley
2006-10-10 14:14 ` Chad Sellers
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=20061006201104.330310000@tresys.com \
--to=csellers@tresys.com \
--cc=selinux@tycho.nsa.gov \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.