hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-12345) Credential length in CredentialsSys.java incorrect
Date Wed, 22 Jun 2016 18:52:31 GMT

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

ASF GitHub Bot commented on HADOOP-12345:
-----------------------------------------

GitHub user pradeep1288 opened a pull request:

    https://github.com/apache/hadoop/pull/103

    HADOOP-12345,HADOOP-11823 fixes

    I have already filed the HADOOP-12345 and HADOOP-11823 jira. 
    
    The fix for HADOOP-12345 is to correctly compute the credential length which is passed
as part of the NFS request. We need to round the XDR bytes to a multiple of 4 if the hostname
in the credential is not a multiple of 4.
    
    The fix for HADOOP-11823 is when RPC returns a denied reply, the code should not check
for a verifier. It is a bug as it doesn't match the RPC protocol. (See Page 33 from NFS Illustrated
book).
     
    
    This is my first time contributing to Hadoop. 

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/pradeep1288/hadoop trunk

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/hadoop/pull/103.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #103
    
----
commit b65f2fb06263cb393cafc8aa5a04ddfe55851331
Author: Pradeep Nayak <pradeepu@netapp.com>
Date:   2016-06-22T18:47:20Z

    Fix for HADOOP-12345,HADOOP-11823 jira's

----


> Credential length in CredentialsSys.java incorrect
> --------------------------------------------------
>
>                 Key: HADOOP-12345
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12345
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: nfs
>    Affects Versions: 2.6.0, 2.7.0
>            Reporter: Pradeep Nayak Udupi Kadbet
>            Priority: Critical
>             Fix For: 2.6.0, 2.7.0
>
>         Attachments: HADOOP-12345.patch
>
>
> Hi -
> There is a bug in the way hadoop-nfs sets the credential length in "Credentials" field
of the NFS RPC packet when using AUTH_SYS
> In CredentialsSys.java, when we are writing the creds in to XDR object, we set the length
as follows:
>  // mStamp + mHostName.length + mHostName + mUID + mGID + mAuxGIDs.count
> 96     mCredentialsLength = 20 + mHostName.getBytes().length;
> (20 corresponds to 4 bytes for mStamp, 4 bytes for mUID, 4 bytes for mGID, 4 bytes for
length field of hostname, 4 bytes for number of aux 4 gids) and this is okay.
> However when we add the length of the hostname to this, we are not adding the extra padded
bytes for the hostname (If the length is not a multiple of 4) and thus when the NFS server
reads the packet, it returns GARBAGE_ARGS because it doesn't read the uid field when it is
expected to read. I can reproduce this issue constantly on machines where the hostname length
is not a multiple of 4.
> A possible fix is to do something this:
> int pad = mHostName.getBytes().length % 4;
>  // mStamp + mHostName.length + mHostName + mUID + mGID + mAuxGIDs.count
> mCredentialsLength = 20 + mHostName.getBytes().length + pad;
> I would be happy to submit the patch but I need some help to commit into mainline. I
haven't committed into Hadoop yet.
> Cheers!
> Pradeep



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org


Mime
View raw message