logoalt Hacker News

Indirect Calling of Nested Functions on GCC Without Executable Stack

71 pointsby ueckeryesterday at 2:20 PM49 commentsview on HN

Comments

BobbyTables2yesterday at 11:07 PM

Have always wondered, why can’t nested functions just be normal functions inside a namespace?

It seems silly to expose a tiny helper to the entire compilation unit when it is only meant to be used inside one function…

show 1 reply
inigyouyesterday at 3:34 PM

Self-modifying code is cool. It's a shame we had to disable it for security.

show 3 replies
mananaysiempreyesterday at 3:39 PM

Related: previous article in the series, https://news.ycombinator.com/item?id=49308685 (103 points, 47 comments)

gue5tyesterday at 3:47 PM

At first, I was annoyed by having to read AT&T syntax. Then I was disoriented by realizing the next snippet was in AT&T syntax without the '%' sigil for registers. But the technique is cool.

show 1 reply
Dwedityesterday at 3:56 PM

What do you need the executable stack for? You call using a function pointer, there's no executable read/write memory involved in using a function pointer.

show 4 replies