diff options
author | trasz <trasz@FreeBSD.org> | 2012-05-22 10:54:42 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2012-05-22 10:54:42 +0000 |
commit | 1efd81b29756f20e1a8bfbd51a184b918fb1880d (patch) | |
tree | 75d5975ae6b0ebb3f1767e73f2ed2b9485eb0032 /contrib/diff/src/side.c | |
parent | 72726b2f32de1148afe56527b9425e60f48d8242 (diff) | |
download | FreeBSD-src-1efd81b29756f20e1a8bfbd51a184b918fb1880d.zip FreeBSD-src-1efd81b29756f20e1a8bfbd51a184b918fb1880d.tar.gz |
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
Diffstat (limited to 'contrib/diff/src/side.c')
0 files changed, 0 insertions, 0 deletions