From: Eric Biggers <ebiggers@kernel.org>
To: Paul Moore <paul@paul-moore.com>
Cc: Roberto Sassu <roberto.sassu@huaweicloud.com>,
dhowells@redhat.com, herbert@gondor.apana.org.au,
davem@davemloft.net, zohar@linux.ibm.com,
dmitry.kasatkin@gmail.com, jmorris@namei.org, serge@hallyn.com,
keyrings@vger.kernel.org, linux-crypto@vger.kernel.org,
linux-integrity@vger.kernel.org,
linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org,
Roberto Sassu <roberto.sassu@huawei.com>
Subject: Re: [PATCH] public_key: Add a comment to public_key_signature struct definition
Date: Fri, 20 Jan 2023 11:43:15 -0800 [thread overview]
Message-ID: <Y8ru09KeMwwaU/IS@sol.localdomain> (raw)
In-Reply-To: <CAHC9VhRSLh9y7KBCOhpvK2cwPmhyMr2dudhjcsEZ-Qmovi86Nw@mail.gmail.com>
On Fri, Jan 20, 2023 at 02:21:04PM -0500, Paul Moore wrote:
> On Wed, Dec 7, 2022 at 5:55 AM Roberto Sassu
> <roberto.sassu@huaweicloud.com> wrote:
> >
> > From: Roberto Sassu <roberto.sassu@huawei.com>
> >
> > public_key_verify_signature() calls sg_set_buf() to set the signature and
> > digest for the signature verification.
> >
> > As sg_set_buf() requires the buffer to be in physically contiguous memory,
> > see commit ac4e97abce9b8 ("scatterlist: sg_set_buf() argument must be in
> > linear mapping"), mention that in a comment for the signature and digest
> > fields of the public_key_signature structure.
> >
> > Link: https://lore.kernel.org/linux-integrity/Y4pIpxbjBdajymBJ@sol.localdomain/
> > Suggested-by: Eric Biggers <ebiggers@kernel.org>
> > Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
> > ---
> > include/crypto/public_key.h | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
>
> This seems especially important considering the BUG_ON that could be triggered.
>
> David, are you going to pick this up?
>
> Reviewed-by: Paul Moore <paul@paul-moore.com>
>
> > diff --git a/include/crypto/public_key.h b/include/crypto/public_key.h
> > index 68f7aa2a7e55..6d623e063034 100644
> > --- a/include/crypto/public_key.h
> > +++ b/include/crypto/public_key.h
> > @@ -37,8 +37,8 @@ extern void public_key_free(struct public_key *key);
> > */
> > struct public_key_signature {
> > struct asymmetric_key_id *auth_ids[3];
> > - u8 *s; /* Signature */
> > - u8 *digest;
> > + u8 *s; /* Signature (in physically contiguous mem) */
> > + u8 *digest; /* Digest (in physically contiguous mem) */
> > u32 s_size; /* Number of bytes in signature */
> > u32 digest_size; /* Number of bytes in digest */
> > const char *pkey_algo;
> > --
> > 2.25.1
This patch has been superseded by
"KEYS: asymmetric: Copy sig and digest in public_key_verify_signature()"
(https://lore.kernel.org/r/20221227142740.2807136-1-roberto.sassu@huaweicloud.com).
- Eric
next prev parent reply other threads:[~2023-01-20 19:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-07 10:54 [PATCH] public_key: Add a comment to public_key_signature struct definition Roberto Sassu
2023-01-20 19:21 ` Paul Moore
2023-01-20 19:43 ` Eric Biggers [this message]
2023-01-20 20:16 ` Paul Moore
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=Y8ru09KeMwwaU/IS@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=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