Nowadays, it's considered bad form to map anything at 0... you now know one of the reasons why! In the case that I know that has a 1:1 identity mapping of the address space, the physical address space doesn't actually have anything at 0 either, so it still doesn't need to be mapped.
Post author here. I wanted the code to be "as generic as possible", so I had to accept the possibility of some useful thing being at address 0.
I wrote an 'unlocking exploit' as a kernel module some years ago, and obfuscated it with a bit of self-modifying code.
It could not make it work reliable. No matter which barries I set, I could not understand why is it not reliable, and had to remove the modifying code in the end.
I guess I hit the issue you've described, and now I know. Thanks!