From: Venkat Yekkirala <vyekkirala@TrustedCS.com>
To: selinux@tycho.nsa.gov
Cc: jmorris@namei.org, sds@tycho.nsa.gov, latten@austin.ibm.com
Subject: [PATCH] selinux_xfrm_sec_ctx_alloc: null-terminate context string
Date: Tue, 24 Jul 2007 09:53:23 -0500 [thread overview]
Message-ID: <46A61263.2050404@trustedcs.com> (raw)
xfrm_audit_log() expects the context string to be null-terminated
which currently doesn't happen with user-supplied contexts.
Signed-off-by: Venkat Yekkirala <vyekkirala@TrustedCS.com>
---
security/selinux/xfrm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- selinux-2.6/security/selinux/xfrm.c 2007-07-24 09:43:23.000000000 -0500
+++ selinux-2.6/security/selinux/xfrm.c 2007-07-24 09:44:11.000000000 -0500
@@ -216,7 +216,7 @@ static int selinux_xfrm_sec_ctx_alloc(st
return -ENOMEM;
*ctxp = ctx = kmalloc(sizeof(*ctx) +
- uctx->ctx_len,
+ uctx->ctx_len + 1,
GFP_KERNEL);
if (!ctx)
@@ -229,6 +229,7 @@ static int selinux_xfrm_sec_ctx_alloc(st
memcpy(ctx->ctx_str,
uctx+1,
ctx->ctx_len);
+ ctx->ctx_str[ctx->ctx_len] = 0;
rc = security_context_to_sid(ctx->ctx_str,
ctx->ctx_len,
&ctx->ctx_sid);
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next reply other threads:[~2007-07-24 14:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-24 14:53 Venkat Yekkirala [this message]
2007-07-24 16:22 ` [PATCH] selinux_xfrm_sec_ctx_alloc: null-terminate context string Joy Latten
2007-07-24 16:45 ` Joy Latten
2007-07-24 19:20 ` Stephen Smalley
2007-07-24 20:44 ` James Morris
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46A61263.2050404@trustedcs.com \
--to=vyekkirala@trustedcs.com \
--cc=jmorris@namei.org \
--cc=latten@austin.ibm.com \
--cc=sds@tycho.nsa.gov \
--cc=selinux@tycho.nsa.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.