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)
Wed, Dec 11, 4:42 AM
Unknown Object (File)
Mon, Dec 9, 4:51 AM
Unknown Object (File)
Sat, Nov 30, 7:32 PM
Unknown Object (File)
Sat, Nov 23, 11:01 AM
Unknown Object (File)
Nov 17 2024, 10:29 PM
Unknown Object (File)
Nov 5 2024, 12:39 PM
Unknown Object (File)
Nov 4 2024, 7:53 PM
Unknown Object (File)
Oct 31 2024, 12:22 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 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.