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

Schrodinger ZHU Yifan via libc-commits libc-commits at lists.llvm.org
Mon Jan 22 11:53:38 PST 2024


================
@@ -19,6 +19,7 @@ set(TARGET_LIBC_ENTRYPOINTS
 
     # compiler entrypoints (no corresponding header)
     libc.src.compiler.__stack_chk_fail
+    libc.src.compiler.__stack_chk_guard
----------------
SchrodingerZhu wrote:

I don't think `__stack_chk_guard` is thread-wise. In MUSL, it is initialized only once with AT_RANDOM. If I don't remember it wrong, then burn threads are copying that value instead of creating new values. I think a function execution can be preempted and transfer to other threads.

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


More information about the libc-commits mailing list