[dm-devel] [dm-verity driver]: suggestion needed for dm-verity data block corrupted issue

Krishan Baveja kkbaveja1 at gmail.com
Thu Dec 10 13:48:50 UTC 2015


Hi,

This is regarding the behavior of dm-verity on Android. Could you please
provide your valuable suggestions?

[Issue]:
During development on android device after some usage of device , I could
see the following logs from dm-verity driver
https://android.googlesource.com/kernel/msm/+/android-6.0.1_r0.9/drivers/md/dm-verity.c#379

[dmesg]:
dm-verity: data block 77897 is corrupted

I think this indicates that data block 77897 in partition on which
dm-verity is enabled is corrupted. Means some hash mismatch occurred with
the predefined hash.

[Debugging]:
The /dev/block/dm-0 is mounted successfully on ext4 partition.

So I thought it could be a filesystem corruption issue, but it does not
seems to be.
I compared the system partition of the device in which the log is observed
and compared it with the same S/W in which the issue is not observed.

There seems to be no difference.

I am suspecting that it can be due to OS corruption or some bug in
dm-verity module.

Could you please suggest how to proceed further?

P.S.:
In my understanding correct about dm-verity in above case. At runtime,
dm-verity calculates the hash of each block when its read and verifies it
by traversing the precalculated hash tree. As dm-verity depends on a
precalculated hash tree over all blocks of a device, the underlying device
must be mounted read-only in order for verification to be possible. In
system partition dm-verity is enabled that hold system files, so system
files can be changed during OS updates through OTA. Any other change
indicates either OS(RAM) or disk(eMMC) corruption, or that a malicious
program is trying to modify the OS or masquerade as a system file.

Thanks in advance !

Best Regards
KK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20151210/4dac0ce7/attachment.htm>


More information about the dm-devel mailing list