From: Eric Biggers <ebiggers@kernel.org>
To: Roberto Sassu <roberto.sassu@huaweicloud.com>
Cc: dhowells@redhat.com, herbert@gondor.apana.org.au,
davem@davemloft.net, zohar@linux.ibm.com,
dmitry.kasatkin@gmail.com, paul@paul-moore.com,
jmorris@namei.org, serge@hallyn.com,
linux-integrity@vger.kernel.org,
linux-security-module@vger.kernel.org, keyrings@vger.kernel.org,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
Roberto Sassu <roberto.sassu@huawei.com>,
stable@vger.kernel.org
Subject: Re: [PATCH v2] KEYS: asymmetric: Copy sig and digest in public_key_verify_signature()
Date: Fri, 9 Dec 2022 11:04:15 -0800 [thread overview]
Message-ID: <Y5OGr59A9wo86rYY@sol.localdomain> (raw)
In-Reply-To: <20221209150633.1033556-1-roberto.sassu@huaweicloud.com>
On Fri, Dec 09, 2022 at 04:06:33PM +0100, Roberto Sassu wrote:
> + /* key is used to store the sig and digest too. */
> + key = kmalloc(key_max_len, GFP_KERNEL);
> if (!key)
> goto error_free_req;
Maybe just call this 'buf', as the key is just one of the purposes the buffer is
used for now.
> + /* Cannot use one scatterlist. The first needs to be s->s_size long. */
> + sg_set_buf(&src_sg[0], key, sig->s_size);
> + sg_set_buf(&src_sg[1], key + sig->s_size, sig->digest_size);
> akcipher_request_set_crypt(req, src_sg, NULL, sig->s_size,
> sig->digest_size);
AFAIK, none of the crypto APIs that operate on 'scatterlist' are supposed to
care how the data is divided up into scatterlist elements. So it sounds like
there is another bug that needs to be fixed. It should be fixed, not worked
around.
- Eric
next prev parent reply other threads:[~2022-12-09 19:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-09 15:06 [PATCH v2] KEYS: asymmetric: Copy sig and digest in public_key_verify_signature() Roberto Sassu
2022-12-09 19:04 ` Eric Biggers [this message]
2022-12-12 9:07 ` Roberto Sassu
2022-12-12 9:15 ` Herbert Xu
2022-12-19 8:49 ` Roberto Sassu
2022-12-20 7:24 ` [PATCH] lib/mpi: Fix buffer overrun when SG is too long Herbert Xu
2022-12-20 10:36 ` Roberto Sassu
2022-12-20 20:30 ` Eric Biggers
2022-12-21 6:53 ` [v2 PATCH] " Herbert Xu
2022-12-21 20:53 ` Eric Biggers
2022-12-23 6:25 ` Herbert Xu
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=Y5OGr59A9wo86rYY@sol.localdomain \
--to=ebiggers@kernel.org \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=dmitry.kasatkin@gmail.com \
--cc=herbert@gondor.apana.org.au \
--cc=jmorris@namei.org \
--cc=keyrings@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=roberto.sassu@huawei.com \
--cc=roberto.sassu@huaweicloud.com \
--cc=serge@hallyn.com \
--cc=stable@vger.kernel.org \
--cc=zohar@linux.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