freebsd-dev/lib/libc
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
..
aarch64 Add support for usermode (vdso-like) gettimeofday(2) and 2015-12-07 12:20:26 +00:00
amd64 libc/{i386,amd64}: Do not export .cerror when building WITHOUT_SYMVER 2016-03-08 00:09:34 +00:00
arm Do not compile ARMv6 instructions on ARMv4/v5. Although clang is fine 2015-12-24 22:13:52 +00:00
capability use .Mt to mark up email addresses consistently (part4) 2014-06-23 08:25:03 +00:00
compat-43 Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. 2015-09-20 20:53:24 +00:00
db libc: don't build compat functions if building WITHOUT_SYMVER 2016-03-15 19:26:32 +00:00
gdtoa META MODE: Don't create .meta files when symlinking sources into the obj directory. 2015-11-25 19:44:43 +00:00
gen libc: don't build compat functions if building WITHOUT_SYMVER 2016-03-15 19:26:32 +00:00
gmon Replace the last non-optional use of sbrk() in the tree with mmap(). 2016-01-21 18:17:19 +00:00
i386 libc/{i386,amd64}: Do not export .cerror when building WITHOUT_SYMVER 2016-03-08 00:09:34 +00:00
iconv libc: don't build compat functions if building WITHOUT_SYMVER 2016-03-15 19:26:32 +00:00
include Fix the gcc build after r295407. 2016-02-08 22:02:56 +00:00
inet Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. 2015-09-20 20:50:56 +00:00
isc Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. 2015-09-23 16:16:16 +00:00
locale mbtowc(3): set errno to EILSEQ if an incomplete character is passed. 2016-03-01 19:15:34 +00:00
md Bring the md5 functions into libc for internal use only. 2014-08-12 12:25:56 +00:00
mips Fix the implementations of PSEUDO_NOERROR and PSEUDO. 2016-01-21 17:29:01 +00:00
nameser Add missing break. 2014-08-20 14:58:25 +00:00
net sendmsg(3) -> sendmsg(2) 2016-02-29 17:19:15 +00:00
nls Move logic to destroy a struct catentry to its own function. 2016-02-02 23:33:58 +00:00
posix1e libc: don't build compat functions if building WITHOUT_SYMVER 2016-03-15 19:26:32 +00:00
powerpc Make unions in PowerPC libc endian-safe. 2016-02-26 20:38:23 +00:00
powerpc64 Make unions in PowerPC libc endian-safe. 2016-02-26 20:38:23 +00:00
quad Remove MK_ARM_EABI, the armeb issues have been fixed. The code to support 2014-10-01 08:26:51 +00:00
regex Add -static to CFLAGS to unbreak the tests by using a libc.a with 2015-12-13 06:33:52 +00:00
resolv Allow users override DEBUG on the command line via DEBUG_FLAGS="-DDEBUG" with 2015-12-15 05:37:09 +00:00
riscv Bring in initial libc and libstand support for RISC-V. 2016-01-17 15:21:23 +00:00
rpc Stray tabs and spaces. 2016-03-05 01:17:23 +00:00
secure libc: don't build compat functions if building WITHOUT_SYMVER 2016-03-15 19:26:32 +00:00
softfloat Replace use of ${.CURDIR} by ${LIBC_SRCTOP} and define ${LIBC_SRCTOP} 2014-03-04 02:19:39 +00:00
sparc64 Fix unused-but-set-variable 2015-11-15 20:44:22 +00:00
stdio fputs: Return the number of bytes written. 2016-02-15 21:18:52 +00:00
stdlib Update jemalloc to 4.1.0. 2016-02-29 19:10:32 +00:00
stdtime Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. 2015-09-20 20:51:52 +00:00
string Make it clear that the "size" argument is for the dst string. 2016-02-26 22:14:19 +00:00
sys Fully handle size_t lengths in AIO requests. 2016-03-21 21:37:33 +00:00
tests DIRDEPS_BUILD: Connect MK_TESTS. 2016-03-09 22:46:01 +00:00
uuid Replace use of ${.CURDIR} by ${LIBC_SRCTOP} and define ${LIBC_SRCTOP} 2014-03-04 02:19:39 +00:00
xdr Bring in initial libc and libstand support for RISC-V. 2016-01-17 15:21:23 +00:00
yp If a NIS server has long entries on its database that is bigger than 2015-11-19 13:36:53 +00:00
libc.ldscript Attempt to move the POSIX iconv* symbols out of runtime linker space. 2013-11-17 22:52:17 +00:00
Makefile Remove excess whitespace 2016-01-27 00:24:24 +00:00
Makefile.depend DIRDEPS_BUILD: Regenerate without local dependencies. 2016-02-24 17:20:11 +00:00
Versions.def Fix the inheritance of the FBSDprivate_1.0 namespace. 2014-04-03 17:31:38 +00:00