From: Eric Biggers <ebiggers@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Md Sadre Alam <quic_mdalam@quicinc.com>,
axboe@kernel.dk, song@kernel.org, yukuai3@huawei.com,
agk@redhat.com, snitzer@kernel.org, mpatocka@redhat.com,
adrian.hunter@intel.com, quic_asutoshd@quicinc.com,
ritesh.list@gmail.com, ulf.hansson@linaro.org,
andersson@kernel.org, konradybcio@kernel.org, kees@kernel.org,
gustavoars@kernel.org, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org,
dm-devel@lists.linux.dev, linux-mmc@vger.kernel.org,
linux-arm-msm@vger.kernel.org, linux-hardening@vger.kernel.org,
quic_srichara@quicinc.com, quic_varada@quicinc.com
Subject: Re: [PATCH v2 1/3] dm-inlinecrypt: Add inline encryption support
Date: Tue, 24 Sep 2024 15:04:34 -0700 [thread overview]
Message-ID: <20240924220434.GB1585@sol.localdomain> (raw)
In-Reply-To: <ZvJt9ceeL18XKrTc@infradead.org>
On Tue, Sep 24, 2024 at 12:44:53AM -0700, Christoph Hellwig wrote:
> On Sat, Sep 21, 2024 at 11:55:19AM -0700, Eric Biggers wrote:
> > (https://android.googlesource.com/kernel/common/+/refs/heads/android-mainline/drivers/md/dm-default-key.c),
> > and I've been looking for the best way to get the functionality upstream. The
> > main challenge is that dm-default-key is integrated with fscrypt, such that if
> > fscrypt encrypts the data, then the data isn't also encrypted with the block
> > device key. There are also cases such as f2fs garbage collection in which
> > filesystems read/write raw data without en/decryption by any key. So
> > essentially a passthrough mode is supported on individual I/O requests.
>
> Adding a default key is not the job of a block remapping driver. You'll
> need to fit that into the file system and/or file system level helpers.
What about a block device ioctl, as was previously proposed
(https://lore.kernel.org/linux-block/1658316391-13472-1-git-send-email-israelr@nvidia.com/T/#u)?
> > It looks like this patch not only does not support that, but it ignores the
> > existence of fscrypt (or any other use of inline encryption by filesystems)
> > entirely, and overrides any filesystem-provided key with the block device's. At
> > the very least, this case would need to be explicitly not supported initially,
> > i.e. dm-inlinecrypt would error out if the upper layer already provided a key.
>
> I agree that we have an incompatibility here, but simply erroring out
> feels like the wrong way to approach the stacking. If a stacking driver
> consumes the inline encryption capability it must not advertise it to
> the upper layers.
Right, I missed that's actually already how it works. The crypto capabilities
are only passed through if the target sets DM_TARGET_PASSES_CRYPTO.
- Eric
next prev parent reply other threads:[~2024-09-24 22:04 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-16 8:57 [PATCH v2 0/3] Add inline encryption support Md Sadre Alam
2024-09-16 8:57 ` [PATCH v2 1/3] dm-inlinecrypt: " Md Sadre Alam
2024-09-17 5:05 ` kernel test robot
2024-09-17 6:38 ` kernel test robot
2024-09-18 5:08 ` kernel test robot
2024-09-21 18:55 ` Eric Biggers
2024-09-24 7:44 ` Christoph Hellwig
2024-09-24 22:04 ` Eric Biggers [this message]
2024-10-01 8:37 ` Christoph Hellwig
2024-10-18 3:26 ` Adrian Vovk
2024-10-18 5:22 ` Christoph Hellwig
[not found] ` <CAAdYy_mVy3uXPqWbjPzK_i8w7Okq73wKBQyc95TbnonE36rPgQ@mail.gmail.com>
2024-10-18 5:56 ` Christoph Hellwig
2024-10-18 15:03 ` Adrian Vovk
2024-10-23 6:57 ` Christoph Hellwig
2024-10-24 2:52 ` Adrian Vovk
2024-10-24 3:17 ` Adrian Vovk
2024-10-24 6:14 ` Christoph Hellwig
2024-10-24 7:52 ` Adrian Vovk
2024-10-24 9:04 ` Christoph Hellwig
2024-10-24 15:32 ` Adrian Vovk
2024-10-24 15:59 ` Christoph Hellwig
2024-10-24 16:23 ` Adrian Vovk
2024-10-29 11:08 ` Mikulas Patocka
2024-10-24 8:11 ` Geoff Back
2024-10-24 15:28 ` Adrian Vovk
2024-10-24 19:21 ` John Stoffel
2024-10-24 20:45 ` Adrian Vovk
2024-10-15 10:59 ` Mikulas Patocka
2024-09-16 8:57 ` [PATCH v2 2/3] mmc: cqhci: Add additional algo mode for inline encryption Md Sadre Alam
2024-09-16 8:57 ` [PATCH v2 3/3] mmc: sdhci-msm: " Md Sadre Alam
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=20240924220434.GB1585@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=agk@redhat.com \
--cc=andersson@kernel.org \
--cc=axboe@kernel.dk \
--cc=dm-devel@lists.linux.dev \
--cc=gustavoars@kernel.org \
--cc=hch@infradead.org \
--cc=kees@kernel.org \
--cc=konradybcio@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=mpatocka@redhat.com \
--cc=quic_asutoshd@quicinc.com \
--cc=quic_mdalam@quicinc.com \
--cc=quic_srichara@quicinc.com \
--cc=quic_varada@quicinc.com \
--cc=ritesh.list@gmail.com \
--cc=snitzer@kernel.org \
--cc=song@kernel.org \
--cc=ulf.hansson@linaro.org \
--cc=yukuai3@huawei.com \
/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;
as well as URLs for NNTP newsgroup(s).