]> git.ipfire.org Git - thirdparty/grub.git/commit
commands/tpm: Skip loopback image measurement
authorMichael Chang <mchang@suse.com>
Thu, 3 Oct 2024 07:23:22 +0000 (15:23 +0800)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 10 Oct 2024 11:04:37 +0000 (13:04 +0200)
commit86ec48882bd0b06268f93033bce9eea168188fae
treed306740d3289ebb2b8c62f2081f69e15a95a7d51
parent3808b1a9bd47cf783d4b8775fbc788a9ce5afdd4
commands/tpm: Skip loopback image measurement

The loopback image is configured to function as a disk by being mapped
as a block device. Instead of measuring the entire block device we
should focus on tracking the individual files accessed from it. For
example, we do not directly measure block devices like hd0 disk but the
files opened from it.

This method is important to avoid running out of memory since loopback
images can be very large. Trying to read and measure the whole image at
once could cause out of memory errors and disrupt the boot process.

Signed-off-by: Michael Chang <mchang@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/commands/tpm.c