Bart and I worked through this some off-list and found the problem. The fix is in cvs trunk now, but I attached the patch in case anyone needs it.

There was an off by one error in a path length test that could cause a buffer overrun when attempting to access file names that are too long. I'm not sure what kernel versions it affected. I did not see any side affects from the bug on newer kernels, but I haven't confirmed if the vfs added a generic check for this or if I was just lucky. The rhel4 2.6.9 kernel can definitely trigger this condition.

-Phil

Bart Taylor wrote:
It did not seem to make a difference. I do not see any log message, client or kernel, that indicate what is happening. The pvfs2-client-core does die after the long file name commands run though.

Bart.



On Mon, Jun 30, 2008 at 2:10 PM, Phil Carns <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Hi Bart,

    Does the attached patch help this issue any?

    -Phil


    Phil Carns wrote:

        Hi Bart,

        I can't get those specific commands to cause a problem for me
        (using trunk at least, I haven't tried 2.7.1 yet).  However, I
        definitely see some problems in LTP.  For me it eventually hangs
        on the rename06 test, but valgrind is complaining about some
        memory problems in the pvfs2-client-core symlink path as well
        before reaching that point.

        I'll look into it and let you know what turns up.

        I might also see if I can cook up a script to include LTP in our
        nightly tinderbox builds as well; there are some good tests in here.

        -Phil

        Bart Taylor wrote:

            Hello all,

            I have run into a few problems when running some tests
            against the 2.7.1 release on RHEL4. They all seem to hinge
            around large file names of 256 characters or greater. The
            commands fail gracefully - reporting an error that the file
            names are too long - but the next access of PVFS (an 'ls'
            for instance) hangs the system so that it has to be
            rebooted. I ran into them using the LTP test suite, but they
            can be reliably repeated with simple commands. Create, open,
            rename, and stat are the operations that fail, and some
            example commands are provided below. The file does not need
            to exist for the open or stat commands. Occasionally it
            takes a few seconds after command has been executed for the
            problem to show itself. Do these commands cause problems for
            anyone else, or is it something unique to my setup or
            environment?

            Bart.



            create:  $echo "Hello World" >
            
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456


            open:  $cat
            
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456


            rename:  $mv test.file
            
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456


            stat:  $stat -f
            
/mnt/pvfs2/test/1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456




            
------------------------------------------------------------------------

            _______________________________________________
            Pvfs2-developers mailing list
            Pvfs2-developers@beowulf-underground.org
            <mailto:Pvfs2-developers@beowulf-underground.org>
            http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers


        _______________________________________________
        Pvfs2-developers mailing list
        Pvfs2-developers@beowulf-underground.org
        <mailto:Pvfs2-developers@beowulf-underground.org>
        http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers




? src/kernel/linux-2.6/pvfs2-utils.c.backup
Index: src/kernel/linux-2.6/namei.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/namei.c,v
retrieving revision 1.83
diff -a -u -p -r1.83 namei.c
--- src/kernel/linux-2.6/namei.c	9 Oct 2007 23:02:35 -0000	1.83
+++ src/kernel/linux-2.6/namei.c	18 Jul 2008 19:51:00 -0000
@@ -81,7 +81,7 @@ static struct dentry *pvfs2_lookup(
     */
     gossip_debug(GOSSIP_NAME_DEBUG, "pvfs2_lookup called on %s\n", dentry->d_name.name);
 
-    if (dentry->d_name.len > PVFS2_NAME_LEN)
+    if (dentry->d_name.len > (PVFS2_NAME_LEN-1))
     {
 	return ERR_PTR(-ENAMETOOLONG);
     }
_______________________________________________
Pvfs2-developers mailing list
Pvfs2-developers@beowulf-underground.org
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers

Reply via email to