From: Milan Broz <gmazyland@gmail.com>
To: Piergiorgio Sartor <piergiorgio.sartor@nexgo.de>
Cc: cryptsetup@lists.linux.dev
Subject: Re: luks2 + integrity + discard
Date: Mon, 20 Jul 2026 23:03:27 +0200 [thread overview]
Message-ID: <f69052dc-a990-4d16-8fee-2821a2c6c44e@gmail.com> (raw)
In-Reply-To: <al6GuqYni-QF3aEV@lazy.lzy>
On 7/20/26 10:36 PM, Piergiorgio Sartor wrote:
>> Discard (TRIM) is supported for dm-integrity
>> standalone mode. It is also supported for dm-crypt
>> standalone.
>>
>> It is not supported for stacked dm-crypt over dm-integrity
>> (In authenticated encryption mode where dm-integrity only provides
>> interleaved metadata sectors for dm-crypt.)
>
> Thanks for the answer.
>
> I was curious about the technical reason
> for this.
> Why the stacked mode should not made
> possible the discard.
> Is this because they're "interleaved"?
> Could explain or point out to some
> explanation of what is intended with
> "interleaved"?
That is the main reason, you basically cannot trim a continuous region
as sectors are interleaved.
The second reason security - discard in dm-integrity standalone
mode is not secure (you can trim a region to remove real data
and it will not report integrity errors).
The dm-integrity idea (as I initially planned) was to implement
temporary solution to emulate sector+metadata to allow authenticated
encryption.
Once hardware itself can provide such configuration, discard will
work natively (see inline mode).
Unfortunately, only a very few enterprise drives support it
(even if it is basically only about proper SSD firmware).
...
> I mean, SSD are more and more common,
> giving up discard seems a bit of a problem.
Then do not use authenticated encryption using dm-integrity.
Security is not for free.
Milan
prev parent reply other threads:[~2026-07-20 21:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 12:16 luks2 + integrity + discard Piergiorgio Sartor
2026-07-20 20:28 ` Milan Broz
2026-07-20 20:36 ` Piergiorgio Sartor
2026-07-20 21:03 ` 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=f69052dc-a990-4d16-8fee-2821a2c6c44e@gmail.com \
--to=gmazyland@gmail.com \
--cc=cryptsetup@lists.linux.dev \
--cc=piergiorgio.sartor@nexgo.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox