Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test set-permission: Improve the test case
This commit introduces 2 changes: 1) Change "info registers" to "info registers all". This will track more registers and make sure they are not changed due to syscall. 2. Change `gdb_start_silent_cmd` to `gdb_run_cmd`. We don't need to use `gdb_start_silent_cmd` because our `before` commands have already started the process. And we can't see the register before we do `set-permission` command if the process has not been started yet. Therefore, it makes sense not to append `"entry-break"` by calling `gdb_start_silent_cmd`. Before this commit the result in commands will be like this: before = [ # These two do the entry-break job! "starti", "si", "printf \"match_before\\n\"", "info registers all", "printf \"match_before\\n\"", "gef config context.clear_screen False", "gef config context.layout '-code -stack'", # This is unecessary, because we have `starti` and `si`. # We can't reorder it because it is appended inside the # `gdb_start_silent_cmd`. "entry-break" ] cmd = "set-permission $sp" after = [ "printf \"match_after\\n\"", "info registers all", "printf \"match_after\\n\"" ] After this commit: before = [ "gef config context.clear_screen False", "gef config context.layout '-code -stack'", "entry-break", "printf \"match_before\\n\"", "info registers all", "printf \"match_before\\n\"" ] cmd = "set-permission $sp" after = [ "printf \"match_after\\n\"", "info registers all", "printf \"match_after\\n\"" ] Fixes: 5eb3b24 ("x86-64: Preserve RCX and R11 when calling mprotect_asm (syscall)") Cc: Grazfather <grazfather@gmail.com> Signed-off-by: Ammar Faizi <ammarfaizi2@gmail.com>
- Loading branch information