[libc-commits] [libc] [libc] Simple __stack_chk_guard implementation (PR #78804)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Tue Jan 23 10:57:03 PST 2024


nickdesaulniers wrote:

> When pointer width is > 8

oh, sorry, I misread your post and missed the `=` in `>=`.

> https://github.com/bminor/musl/blob/f314e133929b6379eccc632bef32eaebb66a7335/src/env/__stack_chk_fail.c#L18

Oh, that's a neat idea.

>  is it possible that some platforms' client applications/libs can be either compiled with a global guard or TLS guards?

I don't think so. I expect the platform ABI defines one or the other, with no need to support both (for one configuration of the libc).

> I am okay with the change if initialization order is for now out of concern for this approach.

I think the platform specific startup files need to be aware of this requirement from the rest of the library that the app startup needs to initialize these canaries early.

https://github.com/llvm/llvm-project/pull/78804


More information about the libc-commits mailing list