You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like all we have to do is initialize __stack_chk_guard to a random number and provide a __stack_chk_fail function which exits the program. Linux provides 16 random bytes to every process via the auxiliary vector and lone already uses those to initialize its hash functions. It should be possible to use those random bytes to initialize the stack canary as well.
If the compiler's stack smashing protections are enabled,
references to the following symbols are emitted:
__stack_chk_guard
__stack_chk_fail
Since lone is freestanding and has no C library support,
those symbols are not defined and therefore the build
will be broken if stack smashing protection is enabled.
So ensure it is turned off in the makefile.
This is supposed to be a temporary solution.
The long term goal is to integrate lone with the
compiler's stack smashing protection machinery.
Progress towards this goal is tracked in issue #4.
Reported-by: Daniel Szmulewicz <[email protected]>
Tested-by: Daniel Szmulewicz <[email protected]>
Reviewed-by: Matheus Afonso Martins Moreira <[email protected]>
Signed-off-by: Matheus Afonso Martins Moreira <[email protected]>
GitHub-Pull-Request: #3
GitHub-Issue: #4
Possible implementation alternative: trapping stack smashing protector which eliminates the need to implement __stack_chk_fail. I've also requested the ability to rename these symbols.
GCC stack smashing protection references:
When stack smashing protection is turned on, the compiler generates some fairly simple code:
It looks like all we have to do is initialize
__stack_chk_guard
to a random number and provide a__stack_chk_fail
function which exits the program. Linux provides 16 random bytes to every process via the auxiliary vector and lone already uses those to initialize its hash functions. It should be possible to use those random bytes to initialize the stack canary as well.Originally posted by @matheusmoreira in #3 (comment)
The text was updated successfully, but these errors were encountered: