ExecutableStacks

Differences between revisions 26 and 27
Revision 26 as of 2009-08-06 09:32:57
Size: 2507
Editor: 89
Comment:
Revision 27 as of 2009-08-06 10:04:28
Size: 2619
Editor: 89
Comment:
Deletions are marked like this. Additions are marked like this.
Line 16: Line 16:
 * [[https://launchpad.net/bugs/375121|zip]]
 * [[http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=539775|bogl]]
 * [[https://launchpad.net/bugs/408499|mono]]
 * [[https://launchpad.net/bugs/375121|zip]] (umarked asm)
 * [[http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=539775|bogl]] (nested function)
 * [[https://launchpad.net/bugs/408499|mono]] (unmarked asm)
Line 25: Line 25:
 * mbr
 * icon
Line 40: Line 42:
 * john
Line 41: Line 44:
== Unclassified ==
 * icon
 * john
 * mbr
 * memtest86+
== No Stack Section ==
 * memtest86+ (is a boot-loaded ELF, not a big deal)
Line 47: Line 47:
= Fedora Patches = = Fedora Patches for universe packages =

There are still some programs that have executable stack regions, which results in their being vulnerable to exploitation via stack memory. There are only a few very rare situations where executable stacks are actually desired, the rest are usually the result of lacking flags in assembly code or using nested functions (which are generally avoidable).

  • Detection:

    • check an ELF binary: "readelf -lW $BIN | grep GNU_STACK" shows with "E" flag.
    • check a .o file: "scanelf -e $BIN | grep X".
  • Information: Gentoo write-up about exec stack handling: http://www.gentoo.org/proj/en/hardened/gnu-stack.xml

  • Potential Solutions:

    • fix assembly source by adding flags to assembler: .section        .note.GNU-stack, "", @progbits

    • fix compiler's default when encountering unmarked assembly: -Wl,-z,noexecstack will change the behavior of compiler's asm-without-stack-markings defaults.

    • rework code to avoid using nested functions.
    • force markings into a safe state via "execstack -c $BINARY" during package build.

Main/Restricted Packages

Originally generated from the ELF files with executable stacks in Karmic main.

Fixed

  • zip (umarked asm)

  • bogl (nested function)

  • mono (unmarked asm)

Nested Functions

Uses Nested Functions which compiler generates as trampolines on the stack.

Trampolines

  • klibc (setjmp implementation)
  • kexec-tools (statically linked against klibc)

Shipped Precompiled Binary

  • fglrx-installer

  • nvidia

    • nvidia-graphics-drivers-173
    • nvidia-graphics-drivers-180
    • nvidia-graphics-drivers-71
    • nvidia-graphics-drivers-96

Unmarked Assembler

No Stack Section

  • memtest86+ (is a boot-loaded ELF, not a big deal)

Fedora Patches for universe packages

SecurityTeam/Roadmap/ExecutableStacks (last edited 2017-08-22 14:25:31 by jdstrand)