HomeFreeBSD

Compute the correct size of the string to move forward.

Description

Compute the correct size of the string to move forward.

Previously this was counting the amount of spare room at the start of
the buffer that the string needed to move forward and passing that as
the number of bytes to copy to memmove rather than the length of the
string to be copied.

In the strfmon test in the test suite this caused the memmove to
overflow the allocated buffer by one byte which CHERI caught.

Reported by: CHERI
Reviewed by: kevans
Obtained from: CheriBSD
MFC after: 1 week
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26280

Details

Provenance
jhbAuthored on Sep 2 2020, 8:04 PM
Parents
rGa2d704d19f28: Avoid unnecessary object locking in vm_page_grab_pages_unlocked().
Branches
Unknown
Tags
Unknown

Event Timeline