diff options
author | Paul Moore <paul.moore@hp.com> | 2008-04-10 10:48:14 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2008-04-18 06:26:16 -0400 |
commit | 3e11217263d0521e212cb8a017fbc2a1514db78f (patch) | |
tree | d3b399c3d907cd90afd27003000fd9d99212f44b /security/selinux/include | |
parent | 832cbd9aa1293cba57d06571f5fc8f0917c672af (diff) |
SELinux: Add network port SID cache
Much like we added a network node cache, this patch adds a network port
cache. The design is taken almost completely from the network node cache
which in turn was taken from the network interface cache. The basic idea is
to cache entries in a hash table based on protocol/port information. The
hash function only takes the port number into account since the number of
different protocols in use at any one time is expected to be relatively
small.
Signed-off-by: Paul Moore <paul.moore@hp.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/selinux/include')
-rw-r--r-- | security/selinux/include/objsec.h | 6 | ||||
-rw-r--r-- | security/selinux/include/security.h | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/security/selinux/include/objsec.h b/security/selinux/include/objsec.h index 957b10d0f76f..300b61bad7b3 100644 --- a/security/selinux/include/objsec.h +++ b/security/selinux/include/objsec.h | |||
@@ -103,6 +103,12 @@ struct netnode_security_struct { | |||
103 | u16 family; /* address family */ | 103 | u16 family; /* address family */ |
104 | }; | 104 | }; |
105 | 105 | ||
106 | struct netport_security_struct { | ||
107 | u32 sid; /* SID for this node */ | ||
108 | u16 port; /* port number */ | ||
109 | u8 protocol; /* transport protocol */ | ||
110 | }; | ||
111 | |||
106 | struct sk_security_struct { | 112 | struct sk_security_struct { |
107 | u32 sid; /* SID of this object */ | 113 | u32 sid; /* SID of this object */ |
108 | u32 peer_sid; /* SID of peer */ | 114 | u32 peer_sid; /* SID of peer */ |
diff --git a/security/selinux/include/security.h b/security/selinux/include/security.h index bc823ef70a12..1904c462a605 100644 --- a/security/selinux/include/security.h +++ b/security/selinux/include/security.h | |||
@@ -102,8 +102,7 @@ int security_context_to_sid_default(char *scontext, u32 scontext_len, | |||
102 | int security_get_user_sids(u32 callsid, char *username, | 102 | int security_get_user_sids(u32 callsid, char *username, |
103 | u32 **sids, u32 *nel); | 103 | u32 **sids, u32 *nel); |
104 | 104 | ||
105 | int security_port_sid(u16 domain, u16 type, u8 protocol, u16 port, | 105 | int security_port_sid(u8 protocol, u16 port, u32 *out_sid); |
106 | u32 *out_sid); | ||
107 | 106 | ||
108 | int security_netif_sid(char *name, u32 *if_sid); | 107 | int security_netif_sid(char *name, u32 *if_sid); |
109 | 108 | ||