lkml.org 
[lkml]   [2006]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 11/22] [PATCH] selinux: check for failed kmalloc in security_sid_to_context()
    -stable review patch.  If anyone has any objections, please let us know.
    ------------------

    Check for NULL kmalloc return value before writing to it.

    Signed-off-by: "Serge E. Hallyn" <serue@us.ibm.com>
    Acked-by: James Morris <jmorris@namei.org>
    Cc: Stephen Smalley <sds@tycho.nsa.gov>
    Signed-off-by: Andrew Morton <akpm@osdl.org>
    Signed-off-by: Linus Torvalds <torvalds@osdl.org>
    Signed-off-by: Chris Wright <chrisw@sous-sol.org>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
    ---

    security/selinux/ss/services.c | 4 ++++
    1 file changed, 4 insertions(+)

    --- linux-2.6.16.16.orig/security/selinux/ss/services.c
    +++ linux-2.6.16.16/security/selinux/ss/services.c
    @@ -592,6 +592,10 @@ int security_sid_to_context(u32 sid, cha

    *scontext_len = strlen(initial_sid_to_string[sid]) + 1;
    scontextp = kmalloc(*scontext_len,GFP_ATOMIC);
    + if (!scontextp) {
    + rc = -ENOMEM;
    + goto out;
    + }
    strcpy(scontextp, initial_sid_to_string[sid]);
    *scontext = scontextp;
    goto out;
    --
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2006-05-18 00:22    [W:0.021 / U:94.704 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site