Page MenuHomeFreeBSD

arm64: validate breakpoint registers
ClosedPublic

Authored by mhorne on Feb 9 2021, 8:39 PM.
Tags
None
Referenced Files
F165029092: D28560.id84090.diff
Wed, Aug 5, 9:32 AM
F164993337: D28560.id83643.diff
Wed, Aug 5, 6:25 AM
F164989552: D28560.id83608.diff
Wed, Aug 5, 6:04 AM
Unknown Object (File)
Tue, Aug 4, 8:54 AM
Unknown Object (File)
Fri, Jul 31, 6:08 PM
Unknown Object (File)
Wed, Jul 29, 1:40 AM
Unknown Object (File)
Sun, Jul 26, 10:10 PM
Unknown Object (File)
Fri, Jul 24, 4:08 PM
Subscribers

Details

Summary

In particular, we want to disallow setting breakpoints on kernel
addresses from userspace. The control register fields are validated or
ignored as appropriate.

For reference: https://developer.arm.com/documentation/ddi0595/2020-12/AArch64-Registers/DBGBCR-n--EL1--Debug-Breakpoint-Control-Registers

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 36862
Build 33751: arc lint + arc unit

Event Timeline

mhorne requested review of this revision.Feb 9 2021, 8:39 PM
sys/arm64/arm64/machdep.c
374

I think this should be a >=. Contrary to the name, VM_MAXUSER_ADDRESS is not a valid user address.

I guess it's ok to silently round down the address to the nearest half word boundary?

396–400

The dbg_enable_count value is left non-zero in error paths. I guess that's ok so long as we don't set DBGMON_ENABLED.

Fix VM_MAXUSER_ADDRESS conditional. Round down address.

This revision is now accepted and ready to land.Feb 12 2021, 3:25 PM
This revision was automatically updated to reflect the committed changes.