HomeFreeBSD

Fix enforcement of file size limit with O_APPEND on ZFS.
rS235781Unpublished

Unpublished Commit ยท Learn More

No further details are available.

Description

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

Details

Provenance
traszAuthored on
Parents
rS235780: Fix a compilation error with some compilers: __attribute__
Branches
Unknown
Tags
Unknown

Event Timeline