#915124 xfsprogs: frequent misdetection of atari partition type

Package:
xfsprogs
Source:
xfsprogs
Description:
Utilities for managing the XFS filesystem
Submitter:
Marc Lehmann
Date:
2021-02-04 22:33:05 UTC
Severity:
minor
Tags:
#915124#5
Date:
2018-11-30 18:38:32 UTC
From:
To:
Dear Maintainer,

I am currently in the process of changing the underlying encryption
on many devices. This involves copying data off, changing encryption
parameters, copying data back.

Changing the underlying encryption (e.g. from aes-cbc-essiv:sha256 to
aes-xts-plain64) should pretty much randomly scramble the existing data,
and looking at the first blocks, this seems to be the case. However,
mkfs.xfs has roughly a 30% chance here of misdetecting random data as
"atari partition table format" (this seems to increase with the size of
the device, the smallest device I used was 8TB):

   mkfs.xfs: /dev/mapper/nls112-11 appears to contain a partition table (atari).

Which of course is somewhat unsettling :)

Looking at http://drac030.krap.pl/APT_spec.pdf, the block doesn't resemble
an atari partition at all (no APT magic string and so on).

Given the high chance of msidetecting random data for a valid partition, I
think the atari partition table detection code should either be improved
or disabled by default, as it surely generates many more false positives
and true detections.

I haven't investigated this in more detail, but it is possible that the
code only checks wether a partition fits into the disk, and this would be
100% the case with devices >2TB.

Indeed, I can easily reproduce this by running this multiple times:

   lvcreate -n tempbig -L 4.5t vg_nlsb112 # once only of course :)
   dd if=/dev/urandom of=/dev/vg_nlsb112/tempbig bs=4096 count=512
   mkfs.xfs /dev/vg_nlsb112/tempbig

I get a roughly one in seven chance of getting an atari partition table.