Crystal: Adding a flag to make available security hardening in compiled executables

Created on 12 Aug 2018  路  4Comments  路  Source: crystal-lang/crystal

Crystal 0.25.0 [7fb783f7a] (2018-06-11)

LLVM: 4.0.0
Default target: x86_64-unknown-linux-gnu

OS: Debian 9

Any generated executable is affected.

bash &> hardening-check ./executable
./executable:
 Position Independent Executable: yes
 Stack protected: no, not found!
 Fortify Source functions: no, only unprotected functions found!
 Read-only relocations: yes
 Immediate binding: no, not found!

Most of the flags are not enabled, this is te output of a --release build.

needs-more-info

Most helpful comment

Sorry, you probably know what you're talking about but we have no clue. Please add more details or at least documentation references. Thanks.

All 4 comments

Sorry, you probably know what you're talking about but we have no clue. Please add more details or at least documentation references. Thanks.

I am talking about protection from stack smashing and similar attacks as well as attacks on link-time behaviour of compiled softwares.

For stack protection, there is the class used in the C++ LLVM documentation:

link

The rest is about the relocations for dynamically linked libraries happening at the start of the executable and for the relocation tables to be marked as read only after that. This prevents modifications of the behaviour of an executable while it is running.

For stack protection, there is the class used in the C++ LLVM documentation:

You forgot to put the class...

You forgot to put the class

I was dumber, the link text was a space

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ArthurZ picture ArthurZ  路  3Comments

RX14 picture RX14  路  3Comments

cjgajard picture cjgajard  路  3Comments

asterite picture asterite  路  3Comments

will picture will  路  3Comments