In Linux/Android, when a process is killed OS kernel de-allocates all the memory (like stack, heap, etc.) associated with a process & puts it back to the memory pool; but IT IS NOT CLEARED in the RAM (i.e. these values would still be visible when a RAM dump is taken ??).
Please can you let me know how to clear (set ZERO) all the memory associated with a process to be killed?
I know "mm_struct" structure (in "sched.h") holds all the memory related info of a process. Do I need to manually go & reset all the params of this struct to ensure that the process' memory is cleared? If so, please guide me where I should be calling this clearing function.
OR
Is there another simpler way to clearing all the memory? Please let me know....
[update from comment:]
I am trying to ensure no one can steal the data from the pages (or dump) after the process is killed. I am fine with user space or kernel space solution.