On 4/19/24 11:04, Mikulas Patocka wrote:
There's already "explicit_bzero", so maybe we could add "explicit_memcpy"
Where would this stop? Wouldn't we also need explicit_memcmp, explicit_memmove, explicit_mempcpy, etc.? Pretty much any function that looks at memory could have the problem. Even C source code that doesn't invoke any C library function could have the problem.
On the library side, shouldn't this sort of thing be handled by _FORTIFY_SOURCE or something similar? And don't we need a compiler option saying "don't cache anything in registers"?