[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <CUE1EZWZ2B1V.3RB2KB8Q2A52W@seitikki>
Date: Fri, 28 Jul 2023 19:03:55 +0000
From: "Jarkko Sakkinen" <jarkko@...nel.org>
To: "Jo Van Bulck" <jo.vanbulck@...kuleuven.be>,
<linux-sgx@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Cc: <dave.hansen@...ux.intel.com>
Subject: Re: [PATCH 1/5] selftests/sgx: Fix uninitialized pointer
dereference in error path.
On Mon Jul 24, 2023 at 4:58 PM UTC, Jo Van Bulck wrote:
> Ensure ctx is zero-initialized, such that the encl_measure function will
> not call EVP_MD_CTX_destroy with an uninitialized ctx pointer in case of an
> early error during key generation.
>
> Signed-off-by: Jo Van Bulck <jo.vanbulck@...kuleuven.be>
> ---
> tools/testing/selftests/sgx/sigstruct.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/sgx/sigstruct.c b/tools/testing/selftests/sgx/sigstruct.c
> index a07896a46364..dd1fdab90e26 100644
> --- a/tools/testing/selftests/sgx/sigstruct.c
> +++ b/tools/testing/selftests/sgx/sigstruct.c
> @@ -318,9 +318,9 @@ bool encl_measure(struct encl *encl)
> struct sgx_sigstruct *sigstruct = &encl->sigstruct;
> struct sgx_sigstruct_payload payload;
> uint8_t digest[SHA256_DIGEST_LENGTH];
> + EVP_MD_CTX *ctx = NULL;
> unsigned int siglen;
> RSA *key = NULL;
> - EVP_MD_CTX *ctx;
> int i;
>
> memset(sigstruct, 0, sizeof(*sigstruct));
> --
> 2.34.1
Add a fixes tag. In other words, find the commit ID that caused the issue
and add the output of the following to this patch before your sob:
git --no-pager log --format='Fixes: %h ("%s")' --abbrev=12 -1 <commit ID>;
BR, Jarkko
Powered by blists - more mailing lists