Skip to content
Commit 118f31b4 authored by Thore Sommer's avatar Thore Sommer Committed by Mike Snitzer
Browse files

dm ima: fix wrong length calculation for no_data string



All entries measured by dm ima are prefixed by a version string
(dm_version=N.N.N). When there is no data to measure, the entire buffer is
overwritten with a string containing the version string again and the
length of that string is added to the length of the version string.
The new length is now wrong because it contains the version string twice.

This caused entries like this:
dm_version=4.45.0;name=test,uuid=test;table_clear=no_data; \
\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 \
current_device_capacity=204808;

Signed-off-by: default avatarThore Sommer <public@thson.de>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 302f0351
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment