The only way to be sure is to read all the source code. That includes the source code for the OS kernel and utilities, and also all the microcode in all the various bits of hardware.
Or, one can assess and manage risk in a way that balances cost and benefit.