Linkers, Loaders & Executables

Which attack does W^X (never allowing a page to be both writable and executable) make harder?

  1. ATrying passwords by brute force
  2. BFlooding a server with traffic to bring it down
  3. CWriting attack machine code into a data area such as the stack and jumping to it
Show answer and explanation

Answer: C. Writing attack machine code into a data area such as the stack and jumping to it

A classic attack used a buffer overflow to write machine code onto the stack and redirect the return address to run it. CPU page tables have a no-execute bit (such as the NX bit), and if the OS makes the stack, heap and .data non-executable and .text non-writable, this method no longer works. Programs that generate code at run time, such as JIT compilers, switch between write and execute permissions.

  • A. Brute-forcing passwords is unrelated to memory permissions.
  • B. Traffic floods are not stopped by memory permissions.
  • C. Correct. Anything written there cannot be executed.
Practice this topic Back to topic

More Linkers, Loaders & Executables questions

  1. On Linux, when is the version number in a shared library's soname, such as the ".1" in libfoo.so.1, generally increased?
  2. What does running the ldd command on an executable on Linux show?
  3. Which pairs major operating systems with the executable formats they use correctly?
  4. When recursion goes so deep that it exceeds the stack limit, what generally happens on Linux and similar systems?
  5. In C, what is true of the starting values of a local variable and a global variable declared without initializers?