This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/14821] New: sunrpc code problems for 64-bit


http://sourceware.org/bugzilla/show_bug.cgi?id=14821

             Bug #: 14821
           Summary: sunrpc code problems for 64-bit
           Product: glibc
           Version: 2.16
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: unassigned@sourceware.org
        ReportedBy: jsm28@gcc.gnu.org
                CC: drepper.fsp@gmail.com
    Classification: Unclassified


sunrpc/clnt_tcp.c:clnttcp_control writes u_long values into a buffer at offsets
both 12 and 16 (BYTES_PER_XDR_UNIT is always 4).  This has several problems:

* When u_long is 64 bits, these values overlap.

* When u_long is 64 bits, one of them will not be 8-byte-aligned but the
processor / ABI may require such values to be 8-byte aligned.

* When u_long is 64 bits and the processor is bit-endian, the value will be
written in a different location from where the other end of the connection, on
another system, expects it (htonl deals with getting the right byte order of
the low 4 bytes, but nothing ensures that the low 4 bytes of the value go in
the right place in the buffer).

clnt_udp.c and clnt_unix.c have the same issue.

This appears to cause NFS mounts, with an n64 MIPS mount.nfs binary, to fail; I
don't have a better testcase than that.

Testing a patch.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]