projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
20ba96a
)
selinux: use kmemdup in security_sid_to_context_core()
author
Rasmus Villemoes
<linux@rasmusvillemoes.dk>
Wed, 21 Oct 2015 21:44:26 +0000
(17:44 -0400)
committer
Paul Moore
<pmoore@redhat.com>
Wed, 21 Oct 2015 21:44:26 +0000
(17:44 -0400)
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: Paul Moore <pmoore@redhat.com>
security/selinux/ss/services.c
patch
|
blob
|
blame
|
history
diff --git
a/security/selinux/ss/services.c
b/security/selinux/ss/services.c
index c550df0e0ff15a26a091687d5dea883c15707232..994c824a34c650268ec783a9de1a2ee3b8a4c39d 100644
(file)
--- a/
security/selinux/ss/services.c
+++ b/
security/selinux/ss/services.c
@@
-1259,12
+1259,12
@@
static int security_sid_to_context_core(u32 sid, char **scontext,
*scontext_len = strlen(initial_sid_to_string[sid]) + 1;
if (!scontext)
goto out;
- scontextp = kmalloc(*scontext_len, GFP_ATOMIC);
+ scontextp = kmemdup(initial_sid_to_string[sid],
+ *scontext_len, GFP_ATOMIC);
if (!scontextp) {
rc = -ENOMEM;
goto out;
}
- strcpy(scontextp, initial_sid_to_string[sid]);
*scontext = scontextp;
goto out;
}