freebsd-dev/sys/cddl/contrib/opensolaris/uts
Edward Tomasz Napierala 9280affe16 Fix enforcement of file size limit with O_APPEND on ZFS.
vn_rlimit_fsize takes uio->uio_offset and uio->uio_resid into account
when determining whether given write would exceed RLIMIT_FSIZE.

When APPEND flag is specified, ZFS updates uio->uio_offset to point to the
end of file.

But this happens after a call to vn_rlimit_fsize, so vn_rlimit_fsize check
can be rendered ineffective by thread that opens some file with O_APPEND
and lseeks below RLIMIT_FSIZE before calling write.

Submitted by:	Mateusz Guzik <mjguzik at gmail dot com>
MFC after:	2 weeks
2012-05-22 10:54:42 +00:00
..
common Fix enforcement of file size limit with O_APPEND on ZFS. 2012-05-22 10:54:42 +00:00
intel Replace fasttrap_copyout() with uwrite(). FreeBSD copyout() is not able to 2011-11-07 01:55:58 +00:00
mips Add MIPS support to cddl/contrib part: 2012-03-24 04:52:18 +00:00
sparc In order to maximize the re-usability of kernel code in user space this 2011-09-16 13:58:51 +00:00