I have achieved a magic trick!
My system has a series of function pointers in an arbitrary stack; but it needs to init the thread stack.
Instead of using a global variable, I write the address as a function pointer,
Preemptively extract it, and replace with an empty function.
Now the hard part.
In order to use the threads, I need to modify the %rsp and %rbp to point to the generated stack for the program image.
but this function is global, and I cannot simply pass a parameter into it.
Need a secure way to get my true address into this function.
Replying to @specialopsmag
This guy may be flipping the bird
Core session is always 0, and always comes first.
Containerized sessions are given an ID that's generated via session count and PID.
To actually interface, via signals, with the container, I also have a PidFD, which is more reliable than the PID itself.
Pretty happy with this!







