-
Notifications
You must be signed in to change notification settings - Fork 571
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
Error: unsupported instruction `sysenter' #4066
Comments
I had a quick look in x86.asm
I haven't studied much of this code yet but maybe syscall should be used instead? |
Yes, switching this to syscall compiles. Not sure it then works like it should but basic functionality testing - its fine For fixing this it needs more information why its not working, ifits a glibc version thing, kernel version thing ... or something else |
Are you on AMD64 or intel? |
5.4.0-kali3-amd64 |
There are separate routines for separate system call gateway methods. global_do_syscall_sysenter is for executing SYSENTER, global_do_syscall_syscall is for executing SYSCALL, etc. DR observes what the app does, and then picks which method to use for syscalls that should look like the app. I believe that back when DR was ported to amd64 we were not 100% sure that no 64-bit OS would use SYSENTER and so we had to keep the code for it available in a 64-bit build of DR -- yet you can see that for Windows it was hacked to get it to compile. At this point we can say with reasonable certainty that SYSENTER is not going to be used in 64-bit apps, even for mixed-mode like in WOW64 (though there IIRC the WOW64 ntdll does have code for SYSENTER in one of its gateways -- maybe why we were worried about -- but AFAIK it is never executed), and so probably it can be ifdef-ed out. Or, just put in the raw bytes instead of the opcode to get it to assemble. |
Like I said, if DR is going to use SYSCALL it would use global_do_syscall_syscall. global_do_syscall_sysenter is for SYSENTER. It would likely be used only for something like WOW64 where it would be 32-bit mode at the time but it would be a 64-bit DR build (i.e., mixed mode). |
Yea, I had got it.. hence deletion of the comment. |
Thanks @derekbruening for the info. @vanhauser-thc do you want to make a PR to fix the issue? I do not mind doing it myself if you prefer. |
I would not mind doing a PR, however I cant do anything serious the next 7 days :-( |
@vanhauser-thc okay, I'll do it then. Thanks for your report! |
thanks for fixing it! I am really surprise this did not bite anyone else and I was the first ... |
Fixes problems with 64-bit assemblers not wanting to emit sysenter by using raw bytes. Fixes #4066
You must have an unusual version of the assembler. No other toolchain in Travis or various users has hit this now or in the past. It is not clear how to reproduce it. Fortunately fixing it was easy. |
I am running Debian Testing --- gcc version 9.2.1 20200123 (Debian 9.2.1-25) |
Describe the bug
when I try to compile dynamorio it aborts with an error:
I thought this is make due a change in the code and reverted to an old version of dynamorio that previously compiled fine for me (dynamorio-cronbuild-7.90.18005 from April 2019) - but same issue there.
I also tried gcc-7 and gcc-9, same outcome.
My guess its about the kernel/libc/headers? I am running Linux 5.4.0-amd64 and using libc 2.29
To Reproduce
Versions
github checkout, but same for older versions e.g. 7.0 and 7.1 releases.
The text was updated successfully, but these errors were encountered: