]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Mark AESNI files as not needing executable stacks
authorGreg Hudson <ghudson@mit.edu>
Fri, 3 Jan 2014 18:50:48 +0000 (13:50 -0500)
committerGreg Hudson <ghudson@mit.edu>
Fri, 3 Jan 2014 18:50:48 +0000 (13:50 -0500)
Some Linux systems now come with facilities to mark the stack as
non-executable, making it more difficult to exploit buffer overrun
bugs.  For this to work, object files built from assembly need a
section added to note whether they require an executable stack.

Patch from Dhiru Kholia with comments added.  More information at:
https://bugzilla.redhat.com/show_bug.cgi?id=1045699
https://wiki.gentoo.org/wiki/Hardened/GNU_stack_quickstart

ticket: 7813
target_version: 1.12.1
tags: pullup

src/lib/crypto/builtin/aes/iaesx64.s
src/lib/crypto/builtin/aes/iaesx86.s

index 1c091c130ff35ce5d2c67603e7236271bcbc2973..d03c859a5c3b81fbbf50cc1974ae3c0bf3408d48 100644 (file)
@@ -834,3 +834,14 @@ lp256encsingle_CBC:
        movdqu [r9],xmm1
        add rsp,16*16+8
        ret
+
+; Mark this file as not needing an executable stack.
+%ifidn __OUTPUT_FORMAT__,elf
+section .note.GNU-stack noalloc noexec nowrite progbits
+%endif
+%ifidn __OUTPUT_FORMAT__,elf32
+section .note.GNU-stack noalloc noexec nowrite progbits
+%endif
+%ifidn __OUTPUT_FORMAT__,elf64
+section .note.GNU-stack noalloc noexec nowrite progbits
+%endif
index b667acdd24d1ef316d657e46fa34d6192961c370..1aa12e6ef05922b2c4c88e5e2c7b75d6fda2c794 100644 (file)
@@ -871,3 +871,14 @@ lp256encsingle_CBC:
        movdqu  [ecx],xmm1 ; store last iv for chaining
 
        ret
+
+; Mark this file as not needing an executable stack.
+%ifidn __OUTPUT_FORMAT__,elf
+section .note.GNU-stack noalloc noexec nowrite progbits
+%endif
+%ifidn __OUTPUT_FORMAT__,elf32
+section .note.GNU-stack noalloc noexec nowrite progbits
+%endif
+%ifidn __OUTPUT_FORMAT__,elf64
+section .note.GNU-stack noalloc noexec nowrite progbits
+%endif