From: Herbert Xu <herbert@gondor.apana.org.au>
To: Harald Freudenberger <freude@linux.ibm.com>
Cc: linux390-list@tuxmaker.boeblingen.de.ibm.com,
linux-crypto@vger.kernel.org, ifranzki@linux.ibm.com,
ebiggers@kernel.org, freude@linux.ibm.com
Subject: Re: [PATCH] s390/crypto: Rework on paes implementation
Date: Mon, 28 Oct 2019 16:24:33 +0800 [thread overview]
Message-ID: <20191028082433.qdaabj2imf34ikam@gondor.apana.org.au> (raw)
In-Reply-To: <20191028073731.11778-1-freude@linux.ibm.com>
Harald Freudenberger <freude@linux.ibm.com> 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@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
next prev parent reply other threads:[~2019-10-28 8:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-28 7:37 [PATCH] s390/crypto: Rework on paes implementation Harald Freudenberger
2019-10-28 8:24 ` Herbert Xu [this message]
2019-10-28 10:07 ` Harald Freudenberger
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=20191028082433.qdaabj2imf34ikam@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=ebiggers@kernel.org \
--cc=freude@linux.ibm.com \
--cc=ifranzki@linux.ibm.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux390-list@tuxmaker.boeblingen.de.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).