From: Eric Biggers <ebiggers@kernel.org>
To: Bart Van Assche <bvanassche@acm.org>
Cc: linux-block@vger.kernel.org, linux-fscrypt@vger.kernel.org,
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 1/3] block: add basic hardware-wrapped key support
Date: Fri, 4 Mar 2022 01:07:35 +0000 [thread overview]
Message-ID: <YiFmV+WXY+mKsM83@gmail.com> (raw)
In-Reply-To: <ac499ff9-eeb4-4f25-bb59-3f37477190ed@acm.org>
On Thu, Mar 03, 2022 at 04:53:56PM -0800, Bart Van Assche wrote:
> On 2/27/22 23:05, Eric Biggers wrote:
> > @@ -68,7 +71,10 @@ static int __init bio_crypt_ctx_init(void)
> > /* Sanity check that no algorithm exceeds the defined limits. */
> > for (i = 0; i < BLK_ENCRYPTION_MODE_MAX; i++) {
> > - BUG_ON(blk_crypto_modes[i].keysize > BLK_CRYPTO_MAX_KEY_SIZE);
> > + BUG_ON(blk_crypto_modes[i].keysize >
> > + BLK_CRYPTO_MAX_STANDARD_KEY_SIZE);
> > + BUG_ON(blk_crypto_modes[i].security_strength >
> > + blk_crypto_modes[i].keysize);
> > BUG_ON(blk_crypto_modes[i].ivsize > BLK_CRYPTO_MAX_IV_SIZE);
> > }
>
> Does the following advice from Linus Torvalds apply to the above code:
> "because there is NO EXCUSE to knowingly kill the kernel"? See also
> https://lkml.org/lkml/2016/10/4/1.
These are boot time checks, so the advice doesn't apply. If the code is buggy
here, then kernels with CONFIG_BLK_INLINE_ENCRYPTION enabled won't boot. I
would prefer compile-time checks, of course, but that isn't possible here. This
is the next best thing.
- Eric
next prev parent reply other threads:[~2022-03-04 1:07 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 [this message]
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
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=YiFmV+WXY+mKsM83@gmail.com \
--to=ebiggers@kernel.org \
--cc=bvanassche@acm.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.