From: Milan Broz <gmazyland@gmail.com>
To: "Robin H. Johnson" <robbat2@gentoo.org>,
linux-block@vger.kernel.org,
"dm-devel@lists.linux.dev" <dm-devel@lists.linux.dev>
Subject: Re: [PATCH] block/partitions: detect LUKS-formatted disks
Date: Mon, 7 Jul 2025 12:04:42 +0200 [thread overview]
Message-ID: <1be92258-a886-44de-a758-ad5ea15e506b@gmail.com> (raw)
In-Reply-To: <20250704182853.3857-1-robbat2@gentoo.org>
On 7/4/25 8:28 PM, Robin H. Johnson wrote:
> If an entire device is formatted as LUKS, there is a small chance it
> maybe be detected as an Atari/AHDI disk - causing the kernel to create
> partitions, and confusing other systems.
>
> Detect the LUKS header before the Atari partition table to prevent this
> from creating partitions on top of the LUKS volume.
Please, no. This is a horrible hack.
LUKS is not a partition. It is a completely userspace concept, detection should not be in the kernel at all.
Moreover, the detection below is oversimplified; the second header can be on multiple offsets.
The same problem can happen with Veracrypt or other systems that randomize data.
The Atari partition is known to use very weak detection, but I think blkid added some more hints to check validity in userspace - why is it not enough?
Is anything from this logic missing in the kernel?
If it is not solvable, you should turn off Atari partition detection as it is unreliable.
Milan
>
> Link: https://unix.stackexchange.com/questions/561745/what-are-the-md-partitions-under-a-mdadm-array
> Link: https://github.com/rook/rook/issues/7940
> Link: https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/1531404
> Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
prev parent reply other threads:[~2025-07-07 10:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-04 18:28 [PATCH] block/partitions: detect LUKS-formatted disks Robin H. Johnson
2025-07-07 5:58 ` Christoph Hellwig
2025-07-07 10:04 ` Milan Broz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1be92258-a886-44de-a758-ad5ea15e506b@gmail.com \
--to=gmazyland@gmail.com \
--cc=dm-devel@lists.linux.dev \
--cc=linux-block@vger.kernel.org \
--cc=robbat2@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.