HomeFreeBSD

Handle int rank issues in in vn_getsize_locked() and vn_seek()

Description

Handle int rank issues in in vn_getsize_locked() and vn_seek()

In vn_getsize_locked(), when storing vattr.va_size of type u_quad_t into
off_t size, we must avoid overflow.

Then, the check for fsize < 0, introduced in the commit
f45feecfb27ca51067d6789eaa43547cadc4990b 'vfs: add vn_getsize', is nop [1].

Reported and reviewed by: jhb
Coverity CID: 1502346
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D38133

Details

Provenance
kibAuthored on Jan 20 2023, 6:45 AM
Differential Revision
D38133: Handle int rank issues in in vn_getsize_locked() and vn_seek()
Parents
rG5657f49ef33b: kern_umtx.c do_wait(): correct confusing indent
Branches
Unknown
Tags
Unknown