Open bblum opened 8 years ago
A bug in the student thread fork implementation is not mandatory to expose the landslide bug.
If instead of reading from 0x4(%esp), we loaded from esp into ebp or whatever before the int instruction, and from there loaded from some shared address (that was otherwise synchronized to be safe), a DR PP could be placed and esp would still mirror the parent thread's esp.
Right now I'm going to switch the attempt order of _end vs esp-8. But a real solution should never use esp-8, at least not when testing userspace. There should be a config.landslide option to specify the name of a designated safe global buffer that you can annotate (in my case, by hacking the p2 basecode). And _end would be used if that annotation is missing, and if _end is page aligned, it simply asserts instead of trying esp.
(couldn't get GUEST_IMG_END for kernel space delay instruction to work in pathos, don't know why)
For example, a particular P2 which will go unnamed had the following (ALSO buggy) thread fork implementation.
If you put a DR PP on either line marked XXX,
when we go to delay the instruction, delay_instruction will choose %esp-8 for its instruction buffer, BUT THAT ESP IS SHARED WITH THE PARENT THREAD, and the other thread's stack will get clobbered.