-
Notifications
You must be signed in to change notification settings - Fork 59
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
fails hot patching mysql_execute_command for debian mysql #132
Comments
Hi. Thanks for the report. We will be investigating this. It appears to be something specific to this distribution and version of MySQL. |
This is a problem specific to Debian's build of MySQL. We will be investigating how to work around / fix the issue for a future release of the plugin. You might want to try using the distribution for Debian from mysql.org instead of using Debian's build. Thanks again for the report. |
I downloaded a debian mysql package for i386 and checked instructions around
The instructions are same with IMO it will be fixed by this patch. |
Hi. Much thanks for this! We will try to test it over the next few days and let you know. Aharon Aharon (Arnold) Robbins From: Kubo Takehiro [mailto:notifications@github.com] I downloaded a debian mysql package for i386 and checked instructions around mysql_execute_command. 1660f0: 8b 1c 24 mov (%esp),%ebx 1660f3: c3 ret The instructions are same with __x86.get_pc_thunk.bx in http://ewontfix.com/18/. IMO it will be fixed by this patchhttps://gist.github.com/kubo/5a886f10d5a1879a12eed4ad9353c806. — |
FYI: It seems to be needed to reconstruct if-else-flow. |
Thanks for the note. We had to rearrange the source a little but got it to compile and are testing it now. We have not forgotten about it. Thanks! Aharon Aharon (Arnold) Robbins From: lurdan [mailto:notifications@github.com] FYI: It seems to be needed to reconstruct if-else-flow. — |
The following code should be added to the patch. if (memcmp(callee, "\x8b\x0c\x24\xc3", 4) == 0) {
// If the current instruction is "call callee"
// and the callee is "movl (%esp), %ecx; ret",
// use "movl pc + 5, %ecx" instead.
BYTE *dest = (BYTE *)trampolineFunction + uCurrentSize;
*dest = 0xb9;
*(DWORD*)(dest + 1) = (DWORD)(pc + 5);
uCurrentSize += 5; // size of "movl pc + 5, %ecx"
InstrSize += 5; // size of "call callee"
goto after_copy_instruction;
} I'm writing my own hot-patching library(here) since last weekend. |
Hi. We have just pushed code that integrates @kubo's code. It works for me. Thanks! |
I've confirmed that latest master can build and works on debian jessie i386. Thank you all! |
hi,
Like #72, audit plugin fails hot patching with debian mysql package (jessie i686, 5.5.46-0+deb8u1)
With either distributed audit-plugin-mysql-5.5-1.0.9-545-linux-i386.zip or self-compiled binary from master branch, errors are same.
I've also tried with extracted offsets from rebuilt binary, but no luck (same error).
Any clues?
The text was updated successfully, but these errors were encountered: