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

Schrodinger ZHU Yifan via libc-commits libc-commits at lists.llvm.org
Tue Jan 23 08:55:02 PST 2024


SchrodingerZhu wrote:

> When pointer width is >= 8

Sorry for not makeing it clear. It should also includes 64-bit platforms.
https://github.com/bminor/musl/blob/f314e133929b6379eccc632bef32eaebb66a7335/src/env/__stack_chk_fail.c#L18

> If we have TLS canary, then we don't need a single global, right?

Ideally yes. Although it should be rare, is it possible that some platforms' client applications/libs can be either compiled with a global guard or TLS guards? (such that when these objects are linked against libc together, the libc needs to initialize both guards). Maybe we don't need to worry about this yet.




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


More information about the libc-commits mailing list