Page MenuHomeFreeBSD

Pass the right size to memcpy() when copying the array of FP registers.
ClosedPublic

Authored by jhb on Jul 23 2020, 8:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 16, 12:03 AM
Unknown Object (File)
Tue, Nov 4, 12:33 AM
Unknown Object (File)
Sun, Oct 26, 9:48 AM
Unknown Object (File)
Tue, Oct 21, 6:17 PM
Unknown Object (File)
Tue, Oct 21, 5:54 PM
Unknown Object (File)
Tue, Oct 21, 5:48 PM
Unknown Object (File)
Tue, Oct 21, 5:58 AM
Unknown Object (File)
Oct 12 2025, 7:13 AM
Subscribers

Details

Summary

The size of the containint structure was passed instead of the size of
the array. This happened to be harmless as the extra word copied is
one we copy in the next line anyway.

Obtained from: CheriBSD

Test Plan
  • using CHERI in the kernel on RISC-V found this buffer overflow since the pointer passed to memcpy had bounds on the array, not the containing structure

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable