[Bugme-new] [Bug 16603] New: send of data > 4 GB fails on 64 bit systems

bugzilla-daemon at bugzilla.kernel.org bugzilla-daemon at bugzilla.kernel.org
Mon Aug 16 03:01:09 PDT 2010


https://bugzilla.kernel.org/show_bug.cgi?id=16603

           Summary: send of data > 4 GB fails on 64 bit systems
           Product: Networking
           Version: 2.5
          Platform: All
        OS/Version: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: IPV4
        AssignedTo: shemminger at linux-foundation.org
        ReportedBy: bono at onlinehome.de
        Regression: No


Sending of data using linux function send fails if size is too large. glibc
function is:

ssize_t send(int sockfd, const void *buf, size_t len, int flags);

Type of len is size_t, argument is stored in a kernel structure msgheader which
contains an iovec. This iovec contains a size_t (64bit) length field, but in
the linux kernel in function tcp_sendmsg the following lines

       while (--iovlen >= 0) {
                int seglen = iov->iov_len;
                unsigned char __user *from = iov->iov_base;


convert the len to int (32 bit).

Thus sending of 5 GB of data results in 1 GB sent (no problem), but sending of
4 GB results in 0 bytes sent.

Workaround in userspace is easy (e.g. instead of len use len < 0x8000000 ? len
: 0x7fffffff) but the kernel should handle this correctly.

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


More information about the Bugme-new mailing list