On Tue, Apr 21 2020 at  2:32P -0400,
Dmitry Baryshkov <[email protected]> wrote:

> вт, 21 апр. 2020 г. в 21:27, Mike Snitzer <[email protected]>:
> >
> > On Mon, Apr 20 2020 at  9:46P -0400,
> > Dmitry Baryshkov <[email protected]> wrote:
> >
> > > From: Dmitry Baryshkov <[email protected]>
> > >
> > > Allow one to use encrypted in addition to user and login key types for
> > > device encryption.
> > >
> > > Signed-off-by: Dmitry Baryshkov <[email protected]>
> >
> > 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:

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;
 


--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

Reply via email to