Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90625
b: refs/heads/master
c: 0044787
h: refs/heads/master
i:
  90623: f004633
v: v3
  • Loading branch information
Paul Moore authored and David S. Miller committed Apr 13, 2008
1 parent 91c944f commit 143012d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b9f3124f08fffe2ad706fd164f6702fdca409a91
refs/heads/master: 00447872a643787411c2c0cb1df6169dda8b0c47
14 changes: 10 additions & 4 deletions trunk/include/net/netlabel.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ struct netlbl_lsm_secattr_catmap {

/**
* struct netlbl_lsm_secattr - NetLabel LSM security attributes
* @flags: indicate which attributes are contained in this structure
* @flags: indicate structure attributes, see NETLBL_SECATTR_*
* @type: indicate the NLTYPE of the attributes
* @domain: the NetLabel LSM domain
* @cache: NetLabel LSM specific cache
Expand All @@ -180,17 +180,22 @@ struct netlbl_lsm_secattr_catmap {
* NetLabel itself when returning security attributes to the LSM.
*
*/
struct netlbl_lsm_secattr {
u32 flags;
/* bitmap values for 'flags' */
#define NETLBL_SECATTR_NONE 0x00000000
#define NETLBL_SECATTR_DOMAIN 0x00000001
#define NETLBL_SECATTR_DOMAIN_CPY (NETLBL_SECATTR_DOMAIN | \
NETLBL_SECATTR_FREE_DOMAIN)
#define NETLBL_SECATTR_CACHE 0x00000002
#define NETLBL_SECATTR_MLS_LVL 0x00000004
#define NETLBL_SECATTR_MLS_CAT 0x00000008
#define NETLBL_SECATTR_SECID 0x00000010
/* bitmap meta-values for 'flags' */
#define NETLBL_SECATTR_FREE_DOMAIN 0x01000000
#define NETLBL_SECATTR_CACHEABLE (NETLBL_SECATTR_MLS_LVL | \
NETLBL_SECATTR_MLS_CAT | \
NETLBL_SECATTR_SECID)
struct netlbl_lsm_secattr {
u32 flags;
u32 type;
char *domain;
struct netlbl_lsm_cache *cache;
Expand Down Expand Up @@ -303,7 +308,8 @@ static inline void netlbl_secattr_init(struct netlbl_lsm_secattr *secattr)
*/
static inline void netlbl_secattr_destroy(struct netlbl_lsm_secattr *secattr)
{
kfree(secattr->domain);
if (secattr->flags & NETLBL_SECATTR_FREE_DOMAIN)
kfree(secattr->domain);
if (secattr->flags & NETLBL_SECATTR_CACHE)
netlbl_secattr_cache_free(secattr->cache);
if (secattr->flags & NETLBL_SECATTR_MLS_CAT)
Expand Down
2 changes: 1 addition & 1 deletion trunk/security/selinux/ss/services.c
Original file line number Diff line number Diff line change
Expand Up @@ -2649,7 +2649,7 @@ int security_netlbl_sid_to_secattr(u32 sid, struct netlbl_lsm_secattr *secattr)
goto netlbl_sid_to_secattr_failure;
secattr->domain = kstrdup(policydb.p_type_val_to_name[ctx->type - 1],
GFP_ATOMIC);
secattr->flags |= NETLBL_SECATTR_DOMAIN;
secattr->flags |= NETLBL_SECATTR_DOMAIN_CPY;
mls_export_netlbl_lvl(ctx, secattr);
rc = mls_export_netlbl_cat(ctx, secattr);
if (rc != 0)
Expand Down
2 changes: 1 addition & 1 deletion trunk/security/smack/smack_lsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1275,7 +1275,7 @@ static void smack_to_secattr(char *smack, struct netlbl_lsm_secattr *nlsp)

switch (smack_net_nltype) {
case NETLBL_NLTYPE_CIPSOV4:
nlsp->domain = kstrdup(smack, GFP_ATOMIC);
nlsp->domain = smack;
nlsp->flags = NETLBL_SECATTR_DOMAIN | NETLBL_SECATTR_MLS_LVL;

rc = smack_to_cipso(smack, &cipso);
Expand Down

0 comments on commit 143012d

Please sign in to comment.