freebsd-dev/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
..
amd64 Regen for r297061 (fstatfs64 Linux syscall). 2016-03-20 13:23:01 +00:00
arm Use the internal references for ADC, this fixes the ADC readings on uBMC. 2016-03-21 03:39:38 +00:00
arm64 Move the opt_ files to be included first so their definitions can be used 2016-03-18 16:32:22 +00:00
boot DIRDEPS_BUILD: Update dependencies. 2016-03-21 18:02:26 +00:00
bsm Merge from contrib/openbsm to bring the kernel audit bits up to date with OpenBSM 1.2 alpha 4: 2015-12-20 23:22:04 +00:00
cam Make sure we check for CAM_CDB_POINTER for all drivers. Also, for the 2016-03-15 05:17:29 +00:00
cddl Remove unused variables dtrace_in_probe and dtrace_in_probe_addr. 2016-03-17 18:55:54 +00:00
compat Check bsd_to_linux_statfs() return value. Forgotten in r297070. 2016-03-20 19:06:21 +00:00
conf Remove from NOTES - it's built as a module now. 2016-03-21 05:51:21 +00:00
contrib Fix crash in krping when run as a client due to NULL pointer access. 2016-03-16 08:49:38 +00:00
crypto Break up opencrypto/xform.c so it can be reused piecemeal 2015-12-30 22:43:07 +00:00
ddb Add helper to catch single step debug event and distinguish it from bkpt 2015-11-27 19:03:59 +00:00
dev rum: do not try to restore bssid/TSF synchronization when device 2016-03-21 21:33:30 +00:00
fs Pacify Coverity in a better way, to avoid write-only variable when building 2016-03-16 14:00:45 +00:00
gdb
geom Don't assume that bio_cmd is a bit mask. 2016-03-10 06:25:39 +00:00
gnu Update our copy of the Linux dts files to be in sync with Linux 4.5-rc1. We 2016-02-09 16:42:32 +00:00
i386 Regen for r297061 (fstatfs64 Linux syscall). 2016-03-20 13:23:01 +00:00
isa Replace all resource occurrences of '0UL/~0UL' with '0/~0'. 2016-03-03 05:07:35 +00:00
kern Fully handle size_t lengths in AIO requests. 2016-03-21 21:37:33 +00:00
kgssapi kcrypto_aes: Use separate sessions for AES and SHA1 2016-02-02 00:14:51 +00:00
libkern
mips Use uintmax_t (typedef'd to rman_res_t type) for rman ranges. 2016-03-18 01:28:41 +00:00
modules [urtwn] migrate urtwn out into sys/dev/urtwn/ . 2016-03-20 03:54:57 +00:00
net buf_ring/drbr: Add buf_ring_peek_clear_sc and use it in drbr_peek 2016-02-29 03:54:51 +00:00
net80211 net80211: enable software beacon miss timer in SLEEP state 2016-03-21 20:52:09 +00:00
netgraph Migrate many bus_alloc_resource() calls to bus_alloc_resource_anywhere(). 2016-02-27 03:38:01 +00:00
netinet Fix kernel build after adding new sysctl asserts in r296933. 2016-03-16 10:42:24 +00:00
netinet6 Modify defrouter_remove() to perform the router lookup before removal. 2016-03-17 19:01:44 +00:00
netipsec Fix handling of net.inet.ipsec.dfbit=2 variable. 2016-03-18 09:03:00 +00:00
netnatm
netpfil pf: Improve forwarding detection 2016-03-16 06:42:15 +00:00
netsmb
nfs If the dhcp server provides an interface-mtu option, parse the value and 2016-03-21 14:51:51 +00:00
nfsclient
nfsserver
nlm
ofed Add missing curly brackets in for loop. 2016-03-17 12:30:21 +00:00
opencrypto Break up opencrypto/xform.c so it can be reused piecemeal 2015-12-30 22:43:07 +00:00
pc98 Another convert to bus_alloc_resource_anywhere(). 2016-03-03 01:09:00 +00:00
powerpc Fix fallout from r292180 (Dec 2015)... ensure that every driver which has 2016-03-21 00:52:24 +00:00
riscv Add support for ddb(4). 2016-03-10 15:51:43 +00:00
rpc Fix incorrect (fortunately bigger) malloc size. 2016-03-19 11:48:06 +00:00
security Busy the mount point which is the owner of the audit vnode, around 2016-01-16 10:06:33 +00:00
sparc64 Use uintmax_t (typedef'd to rman_res_t type) for rman ranges. 2016-03-18 01:28:41 +00:00
sys Fully handle size_t lengths in AIO requests. 2016-03-21 21:37:33 +00:00
teken
tests
tools Fix MFS builds when both MD_ROOT_SIZE and MFS_IMAGE are specified 2016-02-02 07:02:51 +00:00
ufs The UFS filesystem requires that the last block of a file always be 2016-02-24 01:58:40 +00:00
vm Remove UMA_ZONE_REFCNT feature, now unused. 2016-03-01 00:33:32 +00:00
x86 Check IPI status more frequently when waiting. 2016-03-18 19:48:49 +00:00
xdr
xen xenbus: add a comment with the names of the generated accessors 2016-01-15 14:34:31 +00:00
Makefile Add riscv to the list of architectures for cscope. 2016-02-29 16:39:27 +00:00