Does LUKS encryption detect bit-rot / bit flips on HDD/SSD?

2

Suppose an underlying storage device has a undetected bit-flip without reporting an error.

  • How does LUKS react to this?
  • Does it detect as an error ? any kernel messages in dmesg/syslog?
  • Does it ignore and decrypt the invalid data?
  • Is there any kind of checksum validation in LUKS ?

I'm asking about the default cipher, aes-xts-plain64.

Sidias-Korrado

Posted 2017-08-01T06:52:12.023

Reputation: 186

1

Relevant: https://crypto.stackexchange.com/a/5593/4941

– user1686 – 2017-08-01T07:20:45.017

Answers

1

LUKS shouldn't be deciding what is or isn't a bit-flip. That should be detected at a lower level, such as the hard drive controller or a flash-based device's flash translation layer.

Mass storage devices have had issues with recoverable errors for as long as they've existed. Error correction codes have been used for decades to detect, and if possible correct, those errors. That is where minor "bit rot" needs to be detected and corrected.

In order for LUKS to perform error correction it would have to duplicate the error correction scheme that is (presumably) already in place. These schemes involve overhead -- for every X number of bytes of data, Y number of bytes of error detection and correction data must also be maintained. LUKS doesn't have space reserved for ECC overhead, so it isn't capable of correcting for errors.

Julie in Austin

Posted 2017-08-01T06:52:12.023

Reputation: 171