-
Notifications
You must be signed in to change notification settings - Fork 472
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
Syscalls 64-bit values passed as arguments on 32-bit architectures #1338
Comments
AndrewFasano
added a commit
that referenced
this issue
Aug 25, 2023
We use In x86 we see that our 64-bit value should be converted into 2 32-bit arguments.
On ARM, we can confirm what the documentation was telling us that 64-bit values need to be at even offsets.
On MIPS it appears that we simply need to increment the argument and follow a similar offset adding:
|
AndrewFasano
added a commit
that referenced
this issue
Aug 28, 2023
Fixed with #1342 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Several architectures are incorrectly handling passing of 64-bit values on 32-bit hosts.
In x86, it appears that we copy the same register to high and low bits:
panda/panda/plugins/syscalls2/syscalls2.cpp
Lines 748 to 751 in 7dbae2d
which even if corrected to be the next argument doesn't fix the issue of the next argument being on the wrong index.
In ARM, we get closer:
panda/panda/plugins/syscalls2/syscalls2.cpp
Lines 758 to 773 in 7dbae2d
However, we don't increment the argument and so are one off for any syscall following. Further, ARM requires these 64-bit extended values to be on even registers. See: https://man7.org/linux/man-pages/man2/syscall.2.html
In MIPS we make no real attempt at resolving this. This issue is connected to #1337, but there will be independent fixes required.
The text was updated successfully, but these errors were encountered: