projects
/
GitHub
/
LineageOS
/
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:
7a36283
)
selinux: Use kmemdup instead of kmalloc + memcpy
author
Duan Jiong
<duanj.fnst@cn.fujitsu.com>
Thu, 26 Sep 2013 19:52:13 +0000
(15:52 -0400)
committer
Paul Moore
<pmoore@redhat.com>
Thu, 26 Sep 2013 19:52:13 +0000
(15:52 -0400)
Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/xfrm.c
patch
|
blob
|
blame
|
history
diff --git
a/security/selinux/xfrm.c
b/security/selinux/xfrm.c
index 425b9f91d755f6aa229f9bc71c58a747d0f9fa98..a91d205ec0c6094cc9a0fecb5d427d4d24b1ed9a 100644
(file)
--- a/
security/selinux/xfrm.c
+++ b/
security/selinux/xfrm.c
@@
-268,10
+268,10
@@
int selinux_xfrm_policy_clone(struct xfrm_sec_ctx *old_ctx,
if (!old_ctx)
return 0;
- new_ctx = kmalloc(sizeof(*old_ctx) + old_ctx->ctx_len, GFP_ATOMIC);
+ new_ctx = kmemdup(old_ctx, sizeof(*old_ctx) + old_ctx->ctx_len,
+ GFP_ATOMIC);
if (!new_ctx)
return -ENOMEM;
- memcpy(new_ctx, old_ctx, sizeof(*old_ctx) + old_ctx->ctx_len);
atomic_inc(&selinux_xfrm_refcount);
*new_ctxp = new_ctx;