Trampoline (computing)

In computer programming, the word trampoline has a number of meanings, and is generally associated with jumps (i.e., moving to different code paths).

Low-level programming

Trampolines (sometimes referred to as indirect jump vectors) are memory locations holding addresses pointing to interrupt service routines, I/O routines, etc. Execution jumps into the trampoline and then immediately jumps out, or bounces, hence the term trampoline. They have many uses:

CPUs

High-level programming

No Execute Stacks

Some implementations of trampolines cause a loss of No Execute Stacks (NX Stack). In particular, GCC's nested function builds a trampoline on the stack at runtime, and then calls the nested function through the data on stack. The trampoline requires the stack to be executable.

No execute stacks and nested functions are mutually exclusive under GCC. If a nested function is used in the development of a program, then the NX Stack is silently lost. GCC offers the -Wtrampoline warning to alert of the condition.

Software engineered using Secure Development Lifecycle often do not allow the use of nested functions due to the loss of NX Stacks.[3]

References

  1. Baker, Henry G. (September 1995). "CONS Should Not CONS Its Arguments, Part II: Cheney on the M.T.A.". ACM SIGPLAN Notices. 30 (9): 1720. doi:10.1145/214448.214454.
  2. Muller, Hans (31 January 2005). "Asserting Control Over the GUI: Commands, Defaults, and Resource Bundles". today.java.net. Retrieved 6 November 2015. |section= ignored (help)
  3. Walton, Jeffrey. "C-Based Toolchain Hardening". The Open Web Application Security Project (OWASP). Retrieved 28 February 2017.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.