You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Hudson (JIRA)" <ji...@apache.org> on 2013/06/11 22:07:20 UTC

[jira] [Commented] (HADOOP-9635) Fix Potential Stack Overflow in DomainSocket.c

    [ https://issues.apache.org/jira/browse/HADOOP-9635?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13680607#comment-13680607 ] 

Hudson commented on HADOOP-9635:
--------------------------------

Integrated in Hadoop-trunk-Commit #3898 (See [https://builds.apache.org/job/Hadoop-trunk-Commit/3898/])
    HADOOP-9635. Fix potential stack overflow in DomainSocket.c (V. Karthik Kumar via cmccabe) (Revision 1491927)

     Result = SUCCESS
cmccabe : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1491927
Files : 
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/net/unix/DomainSocket.c
* /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

                
> Fix Potential Stack Overflow in DomainSocket.c
> ----------------------------------------------
>
>                 Key: HADOOP-9635
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9635
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: native
>    Affects Versions: 2.3.0
>         Environment: OSX 10.8
>            Reporter: V. Karthik Kumar
>              Labels: patch, security
>             Fix For: 2.3.0
>
>         Attachments: 0001-HADOOP-9635-Fix-Potential-Stack-Overflow-in-DomainSo.patch
>
>
> When I was running on OSX, the DataNode was segfaulting. On investigation, it was tracked down to this code. A potential stack overflow was also identified. 
> {code}
>    utfLength = (*env)->GetStringUTFLength(env, jstr);
>    if (utfLength > sizeof(path)) {
>      jthr = newIOException(env, "path is too long!  We expected a path "
>          "no longer than %zd UTF-8 bytes.", sizeof(path));
>      goto done;
>    }
>   // GetStringUTFRegion does not pad with NUL
>    (*env)->GetStringUTFRegion(env, jstr, 0, utfLength, path);
> ...
>   //strtok_r can set rest pointer to NULL when no tokens found.
>   //Causes JVM to crash in rest[0]
>    for (check[0] = '/', check[1] = '\0', rest = path, token = "";
>        token && rest[0];
>         token = strtok_r(rest, "/", &rest)) {
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira