From owner-cvs-all@FreeBSD.ORG Sat May 19 20:51:00 2007 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B047616A400; Sat, 19 May 2007 20:51:00 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id A146C13C4B0; Sat, 19 May 2007 20:51:00 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l4JKp0h1074724; Sat, 19 May 2007 20:51:00 GMT (envelope-from andre@repoman.freebsd.org) Received: (from andre@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l4JKp0rF074703; Sat, 19 May 2007 20:51:00 GMT (envelope-from andre) Message-Id: <200705192051.l4JKp0rF074703@repoman.freebsd.org> From: Andre Oppermann Date: Sat, 19 May 2007 20:51:00 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/kern uipc_syscalls.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 May 2007 20:51:00 -0000 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