All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Eric Biggers <ebiggers@kernel.org>,
	linux-block@vger.kernel.org, linux-fscrypt@vger.kernel.org
Cc: linux-arm-msm@vger.kernel.org, linux-scsi@vger.kernel.org,
	kernel-team@android.com,
	Gaurav Kashyap <quic_gaurkash@quicinc.com>,
	Israel Rukshin <israelr@nvidia.com>
Subject: Re: [PATCH v5 2/3] block: add ioctls to create and prepare hardware-wrapped keys
Date: Thu, 3 Mar 2022 16:57:27 -0800	[thread overview]
Message-ID: <3dfbff45-f69a-b916-cea6-d99a111ee592@acm.org> (raw)
In-Reply-To: <20220228070520.74082-3-ebiggers@kernel.org>

On 2/27/22 23:05, Eric Biggers wrote:
> +int blk_crypto_import_key(struct blk_crypto_profile *profile,
> +			  const u8 *raw_key, size_t raw_key_size,
> +			  u8 longterm_wrapped_key[BLK_CRYPTO_MAX_HW_WRAPPED_KEY_SIZE])
> +{
> +	int ret = -EOPNOTSUPP;
> +
> +	if (profile &&
> +	    (profile->key_types_supported & BLK_CRYPTO_KEY_TYPE_HW_WRAPPED) &&
> +	    profile->ll_ops.import_key) {
> +		blk_crypto_hw_enter(profile);
> +		ret = profile->ll_ops.import_key(profile, raw_key, raw_key_size,
> +						 longterm_wrapped_key);
> +		blk_crypto_hw_exit(profile);
> +	}
> +	return ret;
> +}

For the above and similar functions, please return early if the preconditions 
have not been met.

> +	}
> +	ret = 0;
> +out:
> +	memzero_explicit(raw_key, sizeof(raw_key));
> +	memzero_explicit(longterm_wrapped_key, sizeof(longterm_wrapped_key));
> +	return ret;
> +}

Please leave a blank line above goto labels

Thanks,

Bart.

  reply	other threads:[~2022-03-04  0:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-28  7:05 [PATCH v5 0/3] Support for hardware-wrapped inline encryption keys Eric Biggers
2022-02-28  7:05 ` [PATCH v5 1/3] block: add basic hardware-wrapped key support Eric Biggers
2022-03-04  0:53   ` Bart Van Assche
2022-03-04  1:07     ` Eric Biggers
2022-02-28  7:05 ` [PATCH v5 2/3] block: add ioctls to create and prepare hardware-wrapped keys Eric Biggers
2022-03-04  0:57   ` Bart Van Assche [this message]
2022-02-28  7:05 ` [PATCH v5 3/3] fscrypt: add support for " Eric Biggers
2022-03-04  1:03   ` Bart Van Assche
2022-03-11  5:18     ` Eric Biggers

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=3dfbff45-f69a-b916-cea6-d99a111ee592@acm.org \
    --to=bvanassche@acm.org \
    --cc=ebiggers@kernel.org \
    --cc=israelr@nvidia.com \
    --cc=kernel-team@android.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=quic_gaurkash@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.