From owner-svn-src-head@freebsd.org Mon Mar 21 22:36:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F59CAD83FF; Mon, 21 Mar 2016 22:36:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0140498A; Mon, 21 Mar 2016 22:36:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 11939B9B2; Mon, 21 Mar 2016 18:36:09 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297167 - in head: lib/libc/sys sys/kern sys/sys tests/sys/aio Date: Mon, 21 Mar 2016 14:40:04 -0700 Message-ID: <1676365.VT1hrVG4ID@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201603212137.u2LLbX46033048@repo.freebsd.org> References: <201603212137.u2LLbX46033048@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 21 Mar 2016 18:36:09 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2016 22:36:10 -0000 On Monday, March 21, 2016 09:37:33 PM John Baldwin wrote: > Author: jhb > Date: Mon Mar 21 21:37:33 2016 > New Revision: 297167 > URL: https://svnweb.freebsd.org/changeset/base/297167 > > Log: > Fully handle size_t lengths in AIO requests. > > First, update the return types of aio_return() and aio_waitcomplete() to > ssize_t. > > POSIX requires aio_return() to return a ssize_t so that it can represent > all return values from read() and write(). aio_waitcomplete() should use > ssize_t for the same reason. > > aio_return() has used ssize_t in since r31620 but the manpage and > system call entry were not updated. aio_waitcomplete() has always > returned int. > > Note that this does not require new system call stubs as this is > effectively only an API change in how the compiler interprets the return > value. > > Second, allow aio_nbytes values up to IOSIZE_MAX instead of just INT_MAX. > > aio_read/write should now honor the same length limits as normal read/write. > > Third, use longs instead of ints in the aio_return() and aio_waitcomplete() > system call functions so that the 64-bit size_t in the in-kernel aiocb > isn't truncated to 32-bits before being copied out to userland or > being returned. > > Finally, a simple test has been added to verify the bounds checking on the > maximum read size from a file. Oops, missed the metadata: Reviewed by: kib (not the test, I added that later) Sponsored by: Chelsio Differential Revision: https://reviews.freebsd.org/D5679 -- John Baldwin