mirror of
https://git.FreeBSD.org/src.git
synced 2024-11-27 08:00:11 +00:00
52bb6100e9
r343275 introduced a performance optimisation to the copyin/copyout routines by attempting to copy word-per-word rather than byte-per-byte where possible. This optimisation failed to account for cases where the buffer is longer than XLEN_BYTES, but due to misalignment does not not allow for any word-sized copies. E.g. a 9 byte buffer (with XLEN_BYTES == 8) which is misaligned by 2 bytes. The code nevertheless did a single full-word copy, which meant we copied too much data. This potentially clobbered other data. This is most easily demonstrated by a simple `sysctl -a`. Fix it by not assuming that we'll always have at least one full-word copy to do, but instead checking the remaining length first. Reviewed by: markj@, mhorne@, br@ (previous version) MFC after: 1 week Sponsored by: Axiado Differential Revision: https://reviews.freebsd.org/D21100 |
||
---|---|---|
.. | ||
conf | ||
include | ||
riscv |