If the "another" process here is the browser this is a security bug and a violation of our design principles.
The reason why shared memory is not encouraged as a first line solution is precisely this. It is very difficult to get right.
AFAIK the subsystems that today make user of shared memory (e.g., gpu transfer buffers, discardable) went through security review and are designed assuming that the renderer can be compromised at any time, and whatever random data is put in the shared memory is not supposed to trigger undefined behavior in the browser.
Likewise, you shouldn't have shared memory between renderers if that could lead to data leaks
AFAIK the general guideline is: don't use shared memory until you can prove you really really need to, and in that case work with security to make sure you have a secure design.