Date: Mon, 21 Mar 2016 14:40:04 -0700 From: John Baldwin <jhb@freebsd.org> 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 Message-ID: <1676365.VT1hrVG4ID@ralph.baldwin.cx> In-Reply-To: <201603212137.u2LLbX46033048@repo.freebsd.org> References: <201603212137.u2LLbX46033048@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <aio.h> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1676365.VT1hrVG4ID>