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)
Sat, Mar 8, 6:39 AM
Unknown Object (File)
Sat, Mar 8, 6:11 AM
Unknown Object (File)
Thu, Mar 6, 12:43 AM
Unknown Object (File)
Tue, Mar 4, 2:58 PM
Unknown Object (File)
Tue, Mar 4, 11:13 AM
Unknown Object (File)
Feb 20 2025, 4:45 AM
Unknown Object (File)
Feb 17 2025, 10:14 AM
Unknown Object (File)
Jan 24 2025, 5:20 PM
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 Passed
Unit
No Test Coverage
Build Status
Buildable 32517
Build 29989: arc lint + arc unit