ASLR and posibility of non-page aligned stack

0 投票
最新提问 用户: (120 分)

To understand the ASLR and its impact on application address space I modified the NetBSD kern_pax.c code as below. My line of thought is to increase entropy by bringing in lower bytes into play. Original PAX code causes stack to be page aligned and jumps from page to page under different invocations. I just added that we move on to specific word aligned memory. Since in most applications the first few frames will be used less as compared to the ones on top, the performance should not be too much of an issue (it is just an assumption).

#define PAX_ASLR_DELTA_STACK_LSB    PGSHIFT
#define PAX_ASLR_DELTA(delta, lsb, len) \

    (((delta) & ((1UL << (len)) - 1)) << (lsb))

I modified it as

#define PAX_ASLR_DELTA_STACK_LSB     2

Variable delta is output from arc4random() function. Variable len is number of bits we wants to randomize.

The randomized value we get as above is added to address where stack was allocated initially by kernel.

I wanted to take expert opinion on if doing this actually brings any benefit about randomization, also if the performance penalty is prohibitive.

When I tried this applications did not crash so it seems to be okay.

发表于 用户: (100 分)
You would be best served by asking this question on the NetBSD tech-kern mailing list (tech-kern@netbsd.org) Or current-users@netbsd.org. That's where most of the NetBSD kernel folk are going to hang out.

登录 或者 注册 后回答这个问题。

欢迎来到 Security Q&A ,有什么不懂的可以尽管在这里提问,你将会收到社区其他成员的回答。
...