Page MenuHomeFreeBSD

fasttrap: Avoid creating WX mappings
ClosedPublic

Authored by markj on Feb 16 2022, 4:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 7 2024, 7:00 PM
Unknown Object (File)
Feb 14 2024, 5:14 PM
Unknown Object (File)
Jan 19 2024, 10:01 PM
Unknown Object (File)
Dec 20 2023, 7:40 AM
Unknown Object (File)
Dec 15 2023, 8:03 PM
Unknown Object (File)
Dec 12 2023, 4:06 AM
Unknown Object (File)
Nov 25 2023, 4:19 AM
Unknown Object (File)
Nov 24 2023, 2:48 PM

Details

Summary

fasttrap instruments certain instructions by overwriting them and
copying the original instruction to some per-thread scratch space which
is executed after the probe fires. This trampoline jumps back to the
tracepoint after executing the original instruction.

The created mapping has both write and execute permissions, and so this
mechanism doesn't work when allow_wx is disabled. Work around the
restriction by using proc_rwmem() to write to the trampoline.

PR: 261965

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable