[dm-devel] dm-crypt: support using encrypted keys

Dmitry Baryshkov dbaryshkov at gmail.com
Thu Apr 23 11:20:21 UTC 2020


Hello,

вт, 21 апр. 2020 г. в 21:59, Mike Snitzer <snitzer at redhat.com>:
>
> On Tue, Apr 21 2020 at  2:32P -0400,
> Dmitry Baryshkov <dbaryshkov at gmail.com> wrote:
>
> > вт, 21 апр. 2020 г. в 21:27, Mike Snitzer <snitzer at redhat.com>:
> > >
> > > On Mon, Apr 20 2020 at  9:46P -0400,
> > > Dmitry Baryshkov <dbaryshkov at gmail.com> wrote:
> > >
> > > > From: Dmitry Baryshkov <dmitry_baryshkov at mentor.com>
> > > >
> > > > Allow one to use encrypted in addition to user and login key types for
> > > > device encryption.
> > > >
> > > > Signed-off-by: Dmitry Baryshkov <dmitry_baryshkov at mentor.com>
> > >
> > > I fixed up some issues, please see the following incremental patch,
> > > I'll get this folded in and staged for 5.8.
> >
> > Thank you!
>
> Actually, I think this is needed too -- but please correct me if I'm wrong:

Yes, it looks like a correct change to me.

>
> diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
> index a4c4afc67a3d..ba4d15476862 100644
> --- a/drivers/md/dm-crypt.c
> +++ b/drivers/md/dm-crypt.c
> @@ -2235,8 +2235,9 @@ static int set_key_user(struct crypt_config *cc, struct key *key)
>
>  static int set_key_encrypted(struct crypt_config *cc, struct key *key)
>  {
> -       struct encrypted_key_payload *ekp = key->payload.data[0];
> +       const struct encrypted_key_payload *ekp;
>
> +       ekp = dereference_key_locked(key);
>         if (!ekp)
>                 return -EKEYREVOKED;
>


-- 
With best wishes
Dmitry





More information about the dm-devel mailing list