Re: [PATCH] s390/crypto: Rework on paes implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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,
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux