Zig: Buffer Overflow / Stack Canary

Created on 24 Feb 2020  路  3Comments  路  Source: ziglang/zig

https://en.wikipedia.org/wiki/Buffer_overflow_protection#Canaries

Just curious what is the current status / future plans?

question

Most helpful comment

We have stack probes on x86/x64 for both libc and stand-alone builds. Stack protection for libc-less targets is tracked in #276, enabling it requires a few lines of code and a decision on whether the TLS should always be allocated or not.

All 3 comments

I know LLVM has SafeStack. No idea if it's enabled.

We have stack probes on x86/x64 for both libc and stand-alone builds. Stack protection for libc-less targets is tracked in #276, enabling it requires a few lines of code and a decision on whether the TLS should always be allocated or not.

Stack overflow detection is enabled by default in safe build modes.

It's also planned for zig to have safe recursion (#1006) and in general to have a compile-time known stack upper bound (#157).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bheads picture bheads  路  3Comments

zimmi picture zimmi  路  3Comments

komuw picture komuw  路  3Comments

andrewrk picture andrewrk  路  3Comments

DavidYKay picture DavidYKay  路  3Comments