cvs commit: src/sys/kern uipc_syscalls.c

Robert Watson rwatson at FreeBSD.org
Tue May 22 10:28:47 UTC 2007


On Mon, 21 May 2007, Alfred Perlstein wrote:

> Is this the same bug that used to be in sendfile but got corrected some 
> years back?

Dunno, but it sounds like we really need a comprehensive set of edge-case 
tests for sendfile.

Robert N M Watson
Computer Laboratory
University of Cambridge

>
> * Andre Oppermann <andre at FreeBSD.org> [070519 13:52] wrote:
>> andre       2007-05-19 20:50:59 UTC
>>
>>   FreeBSD src repository
>>
>>   Modified files:
>>     sys/kern             uipc_syscalls.c
>>   Log:
>>   In kern_sendfile() adjust byte accounting of the file sending loop to
>>   ignore the size of any headers that were passed with the sendfile(2)
>>   system call.  Otherwise the file sent will be truncated by the header
>>   size if the nbytes parameter was provided.  The bug doesn't show up
>>   when either nbytes is zero, meaning send the whole file, or no header
>>   iovec is provided.
>>
>>   Resolve a potential error aliasing of errors from the VM and sf_buf
>>   parts and the protocol send parts where an error of the latter over-
>>   writes one of the former.
>>
>>   Update comments.
>>
>>   The byte accounting bug wasn't seen in earlier because none of the popular
>>   sendfile(2) consumers, Apache, lighttpd and our ftpd(8) use it in modes
>>   that trigger it.  The varnish HTTP proxy makes full use of it and exposed
>>   the problem.
>>
>>   Bug found by:   phk
>>   Tested by:      phk
>>
>>   Revision  Changes    Path
>>   1.256     +37 -13    src/sys/kern/uipc_syscalls.c
>
> -- 
> - Alfred Perlstein
>


More information about the cvs-src mailing list