forked from DynamoRIO/dynamorio
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
i#6662 public traces, part 7: regdeps invariants (DynamoRIO#6889)
OFFLINE_FILE_TYPE_ARCH_REGDEPS traces have specific properties. Instructions always have OP_UNDECODED as opcode, ISA mode is DR_ISA_REGDEPS, operands are only registers, there is no distinction between what specific arithmetic flags are read or written, and their size must be a multiple of 4, which is their required byte alignment. Some markers are not allowed and are removed in the filtering process. Specifically: TRACE_MARKER_TYPE_SYSCALL_IDX, TRACE_MARKER_TYPE_SYSCALL, TRACE_MARKER_TYPE_SYSCALL_TRACE_START, TRACE_MARKER_TYPE_SYSCALL_TRACE_END, TRACE_MARKER_TYPE_SYSCALL_FAILED are not allowed in OFFLINE_FILE_TYPE_ARCH_REGDEPS traces. Function related markers (i.e., TRACE_MARKER_TYPE_FUNC_[ID | ARG | RETVAL | RETADDR]) are allowed only if the associated value of TRACE_MARKER_TYPE_FUNC_ID is the ID of the SYS_futex system call. All other markers are allowed. We add checks (in a new separate function: `check_regdeps_invariants()`) in the invariant_checker tool to validate these properties. We add unit tests to check the firing of regdeps invariant errors related to markers. The `invariant_checker_on_regdeps_trace_kernel_xfer_app` and the newly added `invariant_checker_on_regdeps_trace_ci_shared_app`also test these regdeps invariants (for both markers and instructions) by running invariant_checker on an OFFLINE_FILE_TYPE_ARCH_REGDEPS trace. Issue DynamoRIO#6662
- Loading branch information
Showing
6 changed files
with
282 additions
and
4 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
clients/drcachesim/tests/invariant_checker_on_regdeps_trace_ci_shared_app.templatex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Hello, world! | ||
|
||
Trace invariant checks passed | ||
|
||
Output .* entries from .* entries. | ||
|
||
Trace invariant checks passed | ||
|
||
WARNING: invariant_checker is being run on an OFFLINE_FILE_TYPE_ARCH_REGDEPS trace. | ||
Some invariant checks have been disabled. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters