Page MenuHomeFreeBSD

kern_exec: Add kern.stacktop sysctl.
Needs ReviewPublic

Authored by dgr_semihalf.com on Fri, Sep 10, 6:14 AM.

Details

Reviewers
mw
emaste
imp
kib
cy
Summary

With stack gap enabled top of the stack is moved down by a random
amount of bytes. Because of that some multithreaded applications
which use kern.usrstack sysctl to calculate address of stacks for
their threads can fail. Add kern.stacktop sysctl, which can be used
to retrieve address of the stack after stack gap is applied to it.
Returns value identical to kern.usrstack for processes which have
no stack gap.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped