Re: [PATCH v3 1/1] dm-inlinecrypt: add support for hardware-wrapped keys

Eric Biggers <[email protected]>
Newsgroups dev.linux.lists.dm-devel,org.kernel.vger.linux-kernel
Message-ID <20260620212713.GB1702@quark>
On Mon, May 25, 2026 at 05:13:48AM -0700, Linlin Zhang wrote:
> @@ -502,8 +520,9 @@ static void inlinecrypt_status(struct dm_target *ti, status_type_t type,
>  		 * the returned table.  Userspace is responsible for redacting
>  		 * the key when needed.
>  		 */
> -		DMEMIT("%s %*phN %llu %s %llu", ctx->cipher_string,
> -		       ctx->key.size, ctx->key.bytes, ctx->iv_offset,
> +		DMEMIT("%s %*phN %u %llu %s %llu", ctx->cipher_string,
> +		       ctx->key.size, ctx->key.bytes,
> +		       ctx->key_type, ctx->iv_offset,
>  		       ctx->dev->name, ctx->start);

I think you forgot to update this when adding support for keyring keys.
The point of the keyring keys (to the extent they have a point at all)
is that their contents can't be read back from userspace.  But this just
returns the contents.  Take a look at how dm-crypt.c handles this.

- Eric
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.