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

From: Andrew Morton <[email-masked]>
Date: Mon, 27 Sep 2010 20:56:24 -0700

On Mon, 27 Sep 2010 20:24:25 -0700 (PDT) David Miller <[email-masked]> wrote:

> Ok, I suspect the following is enough to fix this specific bug
> report, TCP sending.
> 
> However, as I stated in my previous reply there are creepy
> crawlies all over the place.
> 
> For example, all of the routines in net/core/iovec.c (memcpy_toiovec,
> memcpy_toiovecend, memcpy_fromiovec, memcpy_fromiovecend,
> csum_partial_copy_fromiovecend) that cast using min_t() are currently
> casting "down" to "unsigned int".
> 
> They should probably case "up" to "size_t".

eep.

A blanket suckyfix might be, at the syscall level:

	if (size > 4g) {
		do_it_in_4g_hunks();
		do_the_last_bit();
	}

unless that would break some networking syscall->framesize guarantees
or something?

And such a "fix" would make it hard to test the real fix!

I'm surprised that this issue hasn't come up before.