[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y5OGr59A9wo86rYY@sol.localdomain>
Date: Fri, 9 Dec 2022 11:04:15 -0800
From: Eric Biggers <ebiggers@...nel.org>
To: Roberto Sassu <roberto.sassu@...weicloud.com>
Cc: dhowells@...hat.com, herbert@...dor.apana.org.au,
davem@...emloft.net, zohar@...ux.ibm.com,
dmitry.kasatkin@...il.com, paul@...l-moore.com, jmorris@...ei.org,
serge@...lyn.com, linux-integrity@...r.kernel.org,
linux-security-module@...r.kernel.org, keyrings@...r.kernel.org,
linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
Roberto Sassu <roberto.sassu@...wei.com>,
stable@...r.kernel.org
Subject: Re: [PATCH v2] KEYS: asymmetric: Copy sig and digest in
public_key_verify_signature()
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
Powered by blists - more mailing lists