Page MenuHomeFreeBSD

update __stack_chk_guard safely
AbandonedPublic

Authored by lffpires_ruabrasil.org on Apr 26 2018, 12:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 12, 6:42 AM
Unknown Object (File)
Mar 17 2024, 10:04 AM
Unknown Object (File)
Dec 28 2023, 1:52 AM
Unknown Object (File)
Dec 26 2023, 8:51 AM
Unknown Object (File)
Dec 26 2023, 4:24 AM
Unknown Object (File)
Dec 20 2023, 4:01 AM
Unknown Object (File)
Dec 10 2023, 7:46 PM
Unknown Object (File)
Dec 9 2023, 6:46 AM

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 Passed
Unit
No 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.