You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove PSEUDORANDOM_NOP_INSERTION and associated code #54242
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIhelp wanted[up-for-grabs] Good issue for external contributorsin-prThere is an active PR which will close this issue when it is merged
While browsing the Jit's source, I noticed this comment:
// All code generated by this function must not contain the randomly-inserted NOPs
// that we insert to inhibit JIT spraying in partial trust scenarios.
// The PINVOKE_PROLOG op signals this to the code generator/emitter.
And the corresponding #define PSEUDORANDOM_NOP_INSERTION, which is now disabled:
/*****************************************************************************/
// The pseudorandom nop insertion is not necessary for current scenarios
// #define PSEUDORANDOM_NOP_INSERTION
/*****************************************************************************/
So the question is as in the header: do we foresee this being a useful mitigation to have in the future, and if not, should the code supporting it be removed?
changed the title [-]Should `PSEUDORANDOM_NOP_INSERTION` and associated code be kept?[/-][+]Remove `PSEUDORANDOM_NOP_INSERTION` and associated code[/+]on Jun 16, 2021
@ayousuf23 it is a bit tricky to quantify, because not all dead code is under the #ifdef, and I did not look too deeply into it. Does not look like there is that much though, quickly searching for the ifdef itself, GT_PINVOKE_PROLOG, GT_PINVOKE_EPILOG and GT_EMITNOP.
This doesn't look too difficult to do, as you stated, @SingleAccretion, it's a matter of searching and removing code that is no longer used. I can give this a go.
area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMIhelp wanted[up-for-grabs] Good issue for external contributorsin-prThere is an active PR which will close this issue when it is merged
Activity
jkotas commentedon Jun 15, 2021
It should be fine to clean this up. This mitigation was relevant for partial trust that we no longer care about and that is not comming back.
[-]Should `PSEUDORANDOM_NOP_INSERTION` and associated code be kept?[/-][+]Remove `PSEUDORANDOM_NOP_INSERTION` and associated code[/+]BruceForstall commentedon Jun 16, 2021
I went ahead and re-titled this from a question to something that can track actually doing the removal.
ayousuf23 commentedon Jun 22, 2021
@SingleAccretion How much code is there to remove?
SingleAccretion commentedon Jun 22, 2021
@ayousuf23 it is a bit tricky to quantify, because not all dead code is under the
#ifdef, and I did not look too deeply into it. Does not look like there is that much though, quickly searching for theifdefitself,GT_PINVOKE_PROLOG,GT_PINVOKE_EPILOGandGT_EMITNOP.DylanGTech commentedon Jul 29, 2021
This doesn't look too difficult to do, as you stated, @SingleAccretion, it's a matter of searching and removing code that is no longer used. I can give this a go.