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)
Dec 20 2023, 8:15 AM
Unknown Object (File)
Nov 29 2023, 4:11 PM
Unknown Object (File)
Nov 12 2023, 1:44 AM
Unknown Object (File)
Oct 11 2023, 12:45 AM
Unknown Object (File)
Sep 16 2023, 11:36 AM
Unknown Object (File)
Sep 10 2023, 5:32 AM
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