Re: Questions on the legacy loading process (MBR -> VBR ->)
Posted: Tue Feb 27, 2018 12:54 am
Hi,
If you're concerned about security, there is one thing you can do: use a third party. This is (part of) what the TPM chip was intended for. The idea is that the MBR asks the TPM chip to create a glorified checksum of the VBR before the VBR is executed; and later on something else can determine if the value in the TPM chip is the same as it should be (and if it's not the same as it should be, assume that the VBR was tampered with).
Of course in practice it's more complex - an attacker could tamper with the MBR so that the MBR modifies the VBR after the VBR's checksum was created but before the VBR is executed, so that the VBR's checksum is correct even though the VBR was modified. To guard against this you end up with a "chain of trust"; where you end up with a glorified checksum of each step in the chain (starting with the firmware itself) and where the checksums for later parts of the chain can only be trusted if all earlier parts of the chain can be trusted. It's not exactly pretty...
Cheers,
Brendan
I was going to say that it's a little bit like asking a person if they're a liar - an honest person will tell the truth and say "no" and a liar will lie and say "no".Solar wrote:Undefined behaviour is undefined, if your code is corrupted it is corrupted. You can't do jack about that.azblue wrote:What else can I do? If it's corrupted I can't trust it to output any sane message (I can't trust it to do anything).
Try to cover your bases as best you can, but don't fret about those parts you can't do "safely".
If you're concerned about security, there is one thing you can do: use a third party. This is (part of) what the TPM chip was intended for. The idea is that the MBR asks the TPM chip to create a glorified checksum of the VBR before the VBR is executed; and later on something else can determine if the value in the TPM chip is the same as it should be (and if it's not the same as it should be, assume that the VBR was tampered with).
Of course in practice it's more complex - an attacker could tamper with the MBR so that the MBR modifies the VBR after the VBR's checksum was created but before the VBR is executed, so that the VBR's checksum is correct even though the VBR was modified. To guard against this you end up with a "chain of trust"; where you end up with a glorified checksum of each step in the chain (starting with the firmware itself) and where the checksums for later parts of the chain can only be trusted if all earlier parts of the chain can be trusted. It's not exactly pretty...
Cheers,
Brendan