Created
November 3, 2016 15:21
-
-
Save GBuella/ef74bc099a180e90ca65565ba59c5302 to your computer and use it in GitHub Desktop.
Trampoline tables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original case ( without intercepting ): | |
/------------------------------\ | |
| application | | |
\------------------------------/ | |
| | |
| | |
/------------------------------\ | |
| libc | | |
| | | |
| syscall syscall syscall | | |
| | | | | | |
\----|----------|---------|----/ | |
| | | | |
| | | user space/kernel boundary | |
#### | ######## | ####### | ####### | |
| | | | |
Linux | |
After hotpaching ( without a trampoline table ): | |
/------------------------------\ | |
| application | | |
\------------------------------/ | |
| | |
| | |
/------------------------------\ | |
| libc | | |
| | | |
| jmp jmp jmp | | |
| | | | | | |
| | | | | | | | | |
\----|---|------|--|------|--|-/ | |
| | | | | | | |
/----|---|------|--|------|--|-\ | |
| | | | | | | | | |
| open | read | write | | | |
| jmp jmp jmp | | |
| | | |
| intercepting library | | |
| | | |
| | | |
| syscall | | |
| | | | |
\----|-------------------------/ | |
| | |
| user space/kernel boundary | |
#### | ############################ | |
| | |
Linux | |
After hotpaching ( with a trampoline table ): | |
/------------------------------\ | |
| application | | |
\------------------------------/ | |
| | |
| | |
/------------------------------\ | |
| libc | | |
| | | |
| /------------------------------\ | |
| / | \ | |
| / /----------------------\ \ | |
| | | | \ \ | |
| jmp jmp jmp -----------\ \ \ | |
| | | | | \ \ \ | |
| | | | | \ \ \ | |
\--|--------|---------|--------/ \ \ \ | |
| | | \ \ \ | |
| | | | | | | |
/--|--------|---------|--------------\ | | | | |
| | | | trampoline | | | | | |
| jmp jmp jmp table | | | | | |
| | | | | | | | | |
| | | | | | | | | |
\----|--------|---------|------------/ | | | | |
| | | / / / | |
| | | / / / | |
/----|--------|---------|------\ / / / | |
| | | | | / / / | |
| open write read | / / / | |
| jmp jmp jmp------/ / / | |
| | | | / / | |
| \ \------------------/ / | |
| \ | / | |
| \-------------------------/ | |
| | | |
| intercepting library | | |
| | | |
| | | |
| syscall | | |
| | | | |
\----|-------------------------/ | |
| | |
| user space/kernel boundary | |
#### | ############################ | |
| | |
Linux |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment