lkml.org 
[lkml]   [2011]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC][PATCH 5/7] smack: import the security label in smack_secctx_to_secid()
Date
The security label passed as argument in smack_secctx_to_secid() must be
first imported in the 'smack_known_list' list before finding the security
identifier associated to it. This allows the function
set_security_override_from_ctx() to be performed successfully even if the
label is not yet present in the smack list.

Signed-off-by: Roberto Sassu <roberto.sassu@polito.it>
---
security/smack/smack_lsm.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
index 0e7ed31..6612ba1 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -3346,7 +3346,13 @@ static int smack_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)
*/
static int smack_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid)
{
- *secid = smack_to_secid(secdata);
+ char *smack;
+
+ smack = smk_import(secdata, seclen);
+ if (smack == NULL)
+ return -EINVAL;
+
+ *secid = smack_to_secid(smack);
return 0;
}

--
1.7.4.4
[unhandled content-type:application/x-pkcs7-signature]
\
 
 \ /
  Last update: 2011-04-27 14:39    [W:0.193 / U:0.808 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site