Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syscalls2: add multi-abi support #1541

Merged
merged 3 commits into from
Oct 22, 2024
Merged

syscalls2: add multi-abi support #1541

merged 3 commits into from
Oct 22, 2024

Conversation

lacraig2
Copy link
Member

This PR addresses #1525 by adding the capacity for AARCH64 and X86_64 to call into the code paths for their 32-bit compatible code to parse and handle ABIs other than the original default ABI.

It does so by associating a specific profile that accompanies every syscall. That profile can change either at translate or runtime.

For example, at translate time we can know if an instruction on the X86_64 ISA is actually a backwards compatible int 0x80 instruction and transfer from a PROFILE_LINUX_X64 to a PROFILE_LINUX_X86. In this case we actually call the x86 codepath instead of the x64 codepath.

Worth knowing:

  • In the case that multiple ABIs define the same syscall (common) we take the function definition from the 64-bit version.
  • I have not attempted to adjust the logic for changing profiles for anything other than Linux.

@lacraig2 lacraig2 merged commit 9f71f45 into dev Oct 22, 2024
8 checks passed
@lacraig2 lacraig2 deleted the syscalls2_multi_abi branch October 22, 2024 17:10
@@ -1324,7 +1378,8 @@ bool init_plugin(void *self) {

// load system call info
if (panda_parse_bool_opt(plugin_args, "load-info", "Load systemcall information for the selected os.")) {
if (load_syscall_info() < 0) return false;
printf("load_info\n");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be removed or at least wrapped in a call to the standard loggers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants