libblkid: Ignore secondary LUKS2 header in blkid_do_safeprobe()
The secondary LUKS2 header can match file data content on other
filesystems (e.g. an image file of a LUKS2 device stored on XFS whose
data blocks happen to land at device offsets where blkid looks for the
secondary LUKS2 header). This causes blkid to report a crypto_LUKS
superblock instead of the real filesystem.
Add a new flag BLKID_PROBE_FL_SAFEPROBE and skip scanning for the
secondary LUKS2 header in blkid_do_safeprobe(). The secondary LUKS2
header is only important for wipefs which uses a promiscuous probe.
Fixes: #4170 Fixes: 8bee1a2 Signed-off-by: Timo Sigurdsson <public_timo.s@silentcreek.de>
--
v2: Fix conflict with BLKID_FL_TINY_DEV flag
v3: Use pr->prob_flags instead of pr->flags
v4: Use original mask again as the use prob_flags resolves the conflict