From: Eric Biggers <ebiggers@kernel.org>
To: dm-devel@lists.linux.dev
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-fscrypt@vger.kernel.org, linux-ext4@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net,
Md Sadre Alam <quic_mdalam@quicinc.com>,
Israel Rukshin <israelr@nvidia.com>,
Milan Broz <gmazyland@gmail.com>,
Mikulas Patocka <mpatocka@redhat.com>,
Adrian Vovk <adrianvovk@gmail.com>
Subject: [RFC PATCH 1/4] block: export blk-crypto symbols required by dm-default-key
Date: Fri, 18 Oct 2024 11:43:36 -0700 [thread overview]
Message-ID: <20241018184339.66601-2-ebiggers@kernel.org> (raw)
In-Reply-To: <20241018184339.66601-1-ebiggers@kernel.org>
From: Eric Biggers <ebiggers@google.com>
bio_crypt_set_ctx(), blk_crypto_init_key(), and
blk_crypto_start_using_key() are needed to use inline encryption; see
Documentation/block/inline-encryption.rst. Export them so that
dm-default-key can use them. The only reason these weren't exported
before was that inline encryption was previously used only by fs/crypto/
which is built-in code.
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
block/blk-crypto.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/block/blk-crypto.c b/block/blk-crypto.c
index 4d760b092deb9..5a121b1292f9a 100644
--- a/block/blk-crypto.c
+++ b/block/blk-crypto.c
@@ -104,10 +104,11 @@ void bio_crypt_set_ctx(struct bio *bio, const struct blk_crypto_key *key,
bc->bc_key = key;
memcpy(bc->bc_dun, dun, sizeof(bc->bc_dun));
bio->bi_crypt_context = bc;
}
+EXPORT_SYMBOL_GPL(bio_crypt_set_ctx);
void __bio_crypt_free_ctx(struct bio *bio)
{
mempool_free(bio->bi_crypt_context, bio_crypt_ctx_pool);
bio->bi_crypt_context = NULL;
@@ -354,10 +355,11 @@ int blk_crypto_init_key(struct blk_crypto_key *blk_key, const u8 *raw_key,
blk_key->size = mode->keysize;
memcpy(blk_key->raw, raw_key, mode->keysize);
return 0;
}
+EXPORT_SYMBOL_GPL(blk_crypto_init_key);
bool blk_crypto_config_supported_natively(struct block_device *bdev,
const struct blk_crypto_config *cfg)
{
return __blk_crypto_cfg_supported(bdev_get_queue(bdev)->crypto_profile,
@@ -396,10 +398,11 @@ int blk_crypto_start_using_key(struct block_device *bdev,
{
if (blk_crypto_config_supported_natively(bdev, &key->crypto_cfg))
return 0;
return blk_crypto_fallback_start_using_mode(key->crypto_cfg.crypto_mode);
}
+EXPORT_SYMBOL_GPL(blk_crypto_start_using_key);
/**
* blk_crypto_evict_key() - Evict a blk_crypto_key from a block_device
* @bdev: a block_device on which I/O using the key may have been done
* @key: the key to evict
--
2.47.0
WARNING: multiple messages have this Message-ID (diff)
From: Eric Biggers via Linux-f2fs-devel <linux-f2fs-devel@lists.sourceforge.net>
To: dm-devel@lists.linux.dev
Cc: Israel Rukshin <israelr@nvidia.com>,
linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net,
linux-block@vger.kernel.org, linux-fscrypt@vger.kernel.org,
Mikulas Patocka <mpatocka@redhat.com>,
Adrian Vovk <adrianvovk@gmail.com>,
Md Sadre Alam <quic_mdalam@quicinc.com>,
linux-ext4@vger.kernel.org, Milan Broz <gmazyland@gmail.com>
Subject: [f2fs-dev] [RFC PATCH 1/4] block: export blk-crypto symbols required by dm-default-key
Date: Fri, 18 Oct 2024 11:43:36 -0700 [thread overview]
Message-ID: <20241018184339.66601-2-ebiggers@kernel.org> (raw)
In-Reply-To: <20241018184339.66601-1-ebiggers@kernel.org>
From: Eric Biggers <ebiggers@google.com>
bio_crypt_set_ctx(), blk_crypto_init_key(), and
blk_crypto_start_using_key() are needed to use inline encryption; see
Documentation/block/inline-encryption.rst. Export them so that
dm-default-key can use them. The only reason these weren't exported
before was that inline encryption was previously used only by fs/crypto/
which is built-in code.
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
block/blk-crypto.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/block/blk-crypto.c b/block/blk-crypto.c
index 4d760b092deb9..5a121b1292f9a 100644
--- a/block/blk-crypto.c
+++ b/block/blk-crypto.c
@@ -104,10 +104,11 @@ void bio_crypt_set_ctx(struct bio *bio, const struct blk_crypto_key *key,
bc->bc_key = key;
memcpy(bc->bc_dun, dun, sizeof(bc->bc_dun));
bio->bi_crypt_context = bc;
}
+EXPORT_SYMBOL_GPL(bio_crypt_set_ctx);
void __bio_crypt_free_ctx(struct bio *bio)
{
mempool_free(bio->bi_crypt_context, bio_crypt_ctx_pool);
bio->bi_crypt_context = NULL;
@@ -354,10 +355,11 @@ int blk_crypto_init_key(struct blk_crypto_key *blk_key, const u8 *raw_key,
blk_key->size = mode->keysize;
memcpy(blk_key->raw, raw_key, mode->keysize);
return 0;
}
+EXPORT_SYMBOL_GPL(blk_crypto_init_key);
bool blk_crypto_config_supported_natively(struct block_device *bdev,
const struct blk_crypto_config *cfg)
{
return __blk_crypto_cfg_supported(bdev_get_queue(bdev)->crypto_profile,
@@ -396,10 +398,11 @@ int blk_crypto_start_using_key(struct block_device *bdev,
{
if (blk_crypto_config_supported_natively(bdev, &key->crypto_cfg))
return 0;
return blk_crypto_fallback_start_using_mode(key->crypto_cfg.crypto_mode);
}
+EXPORT_SYMBOL_GPL(blk_crypto_start_using_key);
/**
* blk_crypto_evict_key() - Evict a blk_crypto_key from a block_device
* @bdev: a block_device on which I/O using the key may have been done
* @key: the key to evict
--
2.47.0
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
next prev parent reply other threads:[~2024-10-18 18:45 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-18 18:43 [RFC PATCH 0/4] dm-default-key: target for filesystem metadata encryption Eric Biggers
2024-10-18 18:43 ` [f2fs-dev] " Eric Biggers via Linux-f2fs-devel
2024-10-18 18:43 ` Eric Biggers [this message]
2024-10-18 18:43 ` [f2fs-dev] [RFC PATCH 1/4] block: export blk-crypto symbols required by dm-default-key Eric Biggers via Linux-f2fs-devel
2024-10-18 18:43 ` [RFC PATCH 2/4] block: add the bi_skip_dm_default_key flag Eric Biggers
2024-10-18 18:43 ` [f2fs-dev] " Eric Biggers via Linux-f2fs-devel
2024-10-21 11:11 ` Mikulas Patocka
2024-10-21 11:11 ` [f2fs-dev] " Mikulas Patocka
2024-10-21 19:02 ` Eric Biggers
2024-10-21 19:02 ` [f2fs-dev] " Eric Biggers via Linux-f2fs-devel
2024-10-18 18:43 ` [RFC PATCH 3/4] dm-default-key: add target for filesystem metadata encryption Eric Biggers
2024-10-18 18:43 ` [f2fs-dev] " Eric Biggers via Linux-f2fs-devel
2024-10-18 18:43 ` [RFC PATCH 4/4] ext4,f2fs: support metadata encryption via dm-default-key Eric Biggers
2024-10-18 18:43 ` [f2fs-dev] [RFC PATCH 4/4] ext4, f2fs: " Eric Biggers via Linux-f2fs-devel
2024-10-21 11:52 ` [RFC PATCH 0/4] dm-default-key: target for filesystem metadata encryption Mikulas Patocka
2024-10-21 11:52 ` [f2fs-dev] " Mikulas Patocka
2024-10-21 19:10 ` Eric Biggers
2024-10-21 19:10 ` [f2fs-dev] " Eric Biggers via Linux-f2fs-devel
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=20241018184339.66601-2-ebiggers@kernel.org \
--to=ebiggers@kernel.org \
--cc=adrianvovk@gmail.com \
--cc=dm-devel@lists.linux.dev \
--cc=gmazyland@gmail.com \
--cc=israelr@nvidia.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fscrypt@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpatocka@redhat.com \
--cc=quic_mdalam@quicinc.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 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.