3 ms·
Does anybody know how this interacts (or is intended to interact) with nested functions? My understanding is that GCC enables executable stacks when nested func
by woodruffw 3y ago
Does anybody know how this interacts (or is intended to interact) with nested functions? My understanding is that GCC enables executable stacks when nested functions are used[1]; it'd be interesting to know whether they produce an error for this combination or continue to silently disable that mitigation.
[1]: https://gcc.gnu.org/onlinedocs/gccint/Trampolines.html#Support-for-Nested-Functions https://gcc.gnu.org/onlinedocs/gccint/Trampolines.html#Suppo...
- jcalvinowens 3y agoWhy would you ever want to do that? It's a weird GNU extension, I've personally never seen it used in real code. I'm really curious.
- woodruffw 3y agoI don't ever want to do it. I'm worried that code I rely on will do it, and I'll end up building (or running) binaries that are missing basic security mitigations.
- jcalvinowens 3y agoYou can always build with clang, it doesn't support this feature. A desire to support clang is ubiquitous enough nowadays that weird stuff like this is getting ripped out of most active open source projects.
- dooglius 3y agoAs indicated in that page, this is only an issue when one takes the address of a nested function, it doesn't happen merely by using nested functions.