Page MenuHomeFreeBSD

Don't overflow the trap frame when accessing lr or xzr
AbandonedPublic

Authored by andrew on Jul 8 2020, 9:42 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 27, 3:32 AM
Unknown Object (File)
Sat, Oct 25, 12:11 AM
Unknown Object (File)
Sat, Oct 25, 12:11 AM
Unknown Object (File)
Fri, Oct 24, 6:03 PM
Unknown Object (File)
Fri, Oct 10, 3:16 PM
Unknown Object (File)
Aug 22 2025, 10:17 PM
Unknown Object (File)
Apr 24 2025, 6:03 PM
Unknown Object (File)
Mar 5 2025, 4:16 PM
Subscribers

Details

Reviewers
None
Group Reviewers
arm64
Summary

When emulating a load pair or store pair in dtrace on arm64 we need to
copy the data between the stack and trap frame. When the registers are
either the link register or the zero register we will access memory
past the end of the trap frame as these are encoded as registers 30 and
31 respectively while the array they access only has 30 entries.

Fix this by creating 2 helper functions to perform the operation with
special cases for these registers.

Test Plan

Can run the following without a kernel panic:
dtrace -n 'fbt::kmem*:entry { @[probefunc] = count(); }'

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 32194
Build 29691: arc lint + arc unit