HomeFreeBSD

copy_file_range(2): Fix for small values of input file offset and len

Description

copy_file_range(2): Fix for small values of input file offset and len

r366302 broke copy_file_range(2) for small values of
input file offset and len.

It was possible for rem to be greater than len and then
"len - rem" was a large value, since both variables are
unsigned.

Reported by: koobs, Pablo <pablogsal gmail com> (Python)
Reviewed by: asomers, koobs
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D28981

Details

Provenance
rmacklemAuthored on Mar 1 2021, 2:28 PM
Reviewer
asomers
Differential Revision
D28981: copy_file_range(2): Fix for small values of input file offset and len
Parents
rG0e4ff0acbe80: AArch64: Don't set flush-subnormals-to-zero flag on startup
Branches
Unknown
Tags
Unknown