diff options
author | James Morris <jmorris@namei.org> | 2008-10-10 18:26:14 -0400 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2008-10-10 18:26:14 -0400 |
commit | 0da939b0058742ad2d8580b7db6b966d0fc72252 (patch) | |
tree | 47cb109fdf97135191bff5db4e3bfc905136bf8b /security/selinux/ss/services.c | |
parent | 4bdec11f560b8f405a011288a50e65b1a81b3654 (diff) | |
parent | d91d40799165b0c84c97e7c71fb8039494ff07dc (diff) |
Merge branch 'master' of git://git.infradead.org/users/pcmoore/lblnet-2.6_next into next
Diffstat (limited to 'security/selinux/ss/services.c')
-rw-r--r-- | security/selinux/ss/services.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index ab0cc0c7b944..343c8ab14af0 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c | |||
@@ -2955,7 +2955,7 @@ netlbl_secattr_to_sid_return_cleanup: | |||
2955 | */ | 2955 | */ |
2956 | int security_netlbl_sid_to_secattr(u32 sid, struct netlbl_lsm_secattr *secattr) | 2956 | int security_netlbl_sid_to_secattr(u32 sid, struct netlbl_lsm_secattr *secattr) |
2957 | { | 2957 | { |
2958 | int rc = -ENOENT; | 2958 | int rc; |
2959 | struct context *ctx; | 2959 | struct context *ctx; |
2960 | 2960 | ||
2961 | if (!ss_initialized) | 2961 | if (!ss_initialized) |
@@ -2963,11 +2963,18 @@ int security_netlbl_sid_to_secattr(u32 sid, struct netlbl_lsm_secattr *secattr) | |||
2963 | 2963 | ||
2964 | read_lock(&policy_rwlock); | 2964 | read_lock(&policy_rwlock); |
2965 | ctx = sidtab_search(&sidtab, sid); | 2965 | ctx = sidtab_search(&sidtab, sid); |
2966 | if (ctx == NULL) | 2966 | if (ctx == NULL) { |
2967 | rc = -ENOENT; | ||
2967 | goto netlbl_sid_to_secattr_failure; | 2968 | goto netlbl_sid_to_secattr_failure; |
2969 | } | ||
2968 | secattr->domain = kstrdup(policydb.p_type_val_to_name[ctx->type - 1], | 2970 | secattr->domain = kstrdup(policydb.p_type_val_to_name[ctx->type - 1], |
2969 | GFP_ATOMIC); | 2971 | GFP_ATOMIC); |
2970 | secattr->flags |= NETLBL_SECATTR_DOMAIN_CPY; | 2972 | if (secattr->domain == NULL) { |
2973 | rc = -ENOMEM; | ||
2974 | goto netlbl_sid_to_secattr_failure; | ||
2975 | } | ||
2976 | secattr->attr.secid = sid; | ||
2977 | secattr->flags |= NETLBL_SECATTR_DOMAIN_CPY | NETLBL_SECATTR_SECID; | ||
2971 | mls_export_netlbl_lvl(ctx, secattr); | 2978 | mls_export_netlbl_lvl(ctx, secattr); |
2972 | rc = mls_export_netlbl_cat(ctx, secattr); | 2979 | rc = mls_export_netlbl_cat(ctx, secattr); |
2973 | if (rc != 0) | 2980 | if (rc != 0) |