memcpy is leaking secret data through ZMM vector registers
Wilco Dijkstra <[email protected]>
| Newsgroups | gmane.comp.lib.glibc.alpha |
|---|---|
| Message-ID | <PAWPR08MB8982D000416E1A5F7D064E1483DC2@PAWPR08MB8982.eurprd08.prod.outlook.com> |
Hi Jan, Leaking register contents will always be true for all GLIBC functions that you might call with "secrets" - that's unavoidable since clearing registers is neither the default, nor something that assembly implementations support (and rebuilding everything with -fzero-call-used-regs would add a huge amount of overhead... The best solution is to not call library functions with "secrets" so you don't create that problem. Alternatively, you could call memcpy with some non-secret data so that it overwrites the vector registers. Quite easy as a solution without introducing new symbols or having to rewrite assembly code to clear registers etc. Cheers, Wilco