Page MenuHomeFreeBSD

update __stack_chk_guard safely
AbandonedPublic

Authored by lffpires_ruabrasil.org on Apr 26 2018, 12:15 PM.

Details

Reviewers
kib
Summary

This is necessary to make sure that functions that can have stack protection are not used to update the stack guard.
In that case, the stack guard check would fail when it shouldn't.

This fixes in libexec the same issue that was fixed in libc in D15173.

Diff Detail

Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 16312
Build 16253: arc lint + arc unit

Event Timeline

I think this is more involved than just avoiding memcpy(). If you look at the libexec/rtld-elf/Makefile near the start, you would see MK_SSP=no. In other words, we know that rtld must be compiled without stack protector, but you effectively point out that libc_pic.a is compiled with it, and this causes more troubles.

I suggest to consider changing the build for libc_pic.a to also avoid -fstack-protector instead of fixing the single place.

In D15208#320453, @kib wrote:

I think this is more involved than just avoiding memcpy(). If you look at the libexec/rtld-elf/Makefile near the start, you would see MK_SSP=no. In other words, we know that rtld must be compiled without stack protector, but you effectively point out that libc_pic.a is compiled with it, and this causes more troubles.

I suggest to consider changing the build for libc_pic.a to also avoid -fstack-protector instead of fixing the single place.

@kib, I submitted another revision (D15283) to address this. Please let me know your comments.

This revision can be discarded.