On 28.10.19 09:24, Herbert Xu wrote: > Harald Freudenberger <freude@xxxxxxxxxxxxx> wrote: >> @@ -165,18 +183,31 @@ static int ecb_paes_crypt(struct skcipher_request *req, unsigned long modifier) >> struct skcipher_walk walk; >> unsigned int nbytes, n, k; >> int ret; >> + struct { >> + u8 key[MAXPROTKEYSIZE]; >> + } param; >> >> ret = skcipher_walk_virt(&walk, req, false); >> + if (ret) >> + return ret; >> + >> + spin_lock(&ctx->pk_lock); >> + memcpy(param.key, ctx->pk.protkey, MAXPROTKEYSIZE); >> + spin_unlock(&ctx->pk_lock); > I think using a plain spin lock is unsafe as you may have callers > from both kernel thread context and BH context. So you need to > have at least a spin_lock_bh here. > > Cheers, Thanks, I'll change this.