freebsd-skq/tests/sys
John Baldwin bb430bc740 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.
2016-03-21 21:37:33 +00:00
..
acl DIRDEPS_BUILD: Connect MK_TESTS. 2016-03-09 22:46:01 +00:00
aio Fully handle size_t lengths in AIO requests. 2016-03-21 21:37:33 +00:00
fifo DIRDEPS_BUILD: Connect MK_TESTS. 2016-03-09 22:46:01 +00:00
file DIRDEPS_BUILD: Connect MK_TESTS. 2016-03-09 22:46:01 +00:00
geom DIRDEPS_BUILD: Connect MK_TESTS. 2016-03-09 22:46:01 +00:00
kern DIRDEPS_BUILD: Connect MK_TESTS. 2016-03-09 22:46:01 +00:00
kqueue DIRDEPS_BUILD: Connect MK_TESTS. 2016-03-09 22:46:01 +00:00
mac DIRDEPS_BUILD: Connect MK_TESTS. 2016-03-09 22:46:01 +00:00
mqueue DIRDEPS_BUILD: Connect MK_TESTS. 2016-03-09 22:46:01 +00:00
netinet DIRDEPS_BUILD: Connect MK_TESTS. 2016-03-09 22:46:01 +00:00
opencrypto DIRDEPS_BUILD: Connect MK_TESTS. 2016-03-09 22:46:01 +00:00
pjdfstest DIRDEPS_BUILD: Connect MK_TESTS. 2016-03-09 22:46:01 +00:00
posixshm DIRDEPS_BUILD: Connect MK_TESTS. 2016-03-09 22:46:01 +00:00
vfs DIRDEPS_BUILD: Connect MK_TESTS. 2016-03-09 22:46:01 +00:00
vm DIRDEPS_BUILD: Connect MK_TESTS. 2016-03-09 22:46:01 +00:00
Makefile Test directories can build in parallel fine. 2016-02-16 02:13:59 +00:00
Makefile.depend DIRDEPS_BUILD: Connect MK_TESTS. 2016-03-09 22:46:01 +00:00