[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231102042043.GD1498@sol.localdomain>
Date: Wed, 1 Nov 2023 21:20:43 -0700
From: Eric Biggers <ebiggers@...nel.org>
To: Yuran Pereira <yuran.pereira@...mail.com>
Cc: linux-crypto@...r.kernel.org, herbert@...dor.apana.org.au,
davem@...emloft.net, tglx@...utronix.de, mingo@...hat.com,
bp@...en8.de, dave.hansen@...ux.intel.com, x86@...nel.org,
hpa@...or.com, linux-kernel@...r.kernel.org,
linux-kernel-mentees@...ts.linuxfoundation.org
Subject: Re: [PATCH 0/7] crypto: Proper Initialization of `struct
skcipher_walk` in x86 Glue Files
Hi Yuran,
On Thu, Nov 02, 2023 at 09:34:08AM +0530, Yuran Pereira wrote:
> In multiple `*_encrypt`, `*_crypt`, `*_decrypt` functions within the x86/crypto
> glue files, the `skcipher_walk` structs being used are not properly initialized
> prior their usage which can lead to undefined behaviour if the `flags` field of
> this structure were to contain junk values at the time of its usage.
>
> This patch series ensures that instances of `struct skcipher_walk` are correctly
> initialized across different x86/crypto glue files.
>
> Yuran Pereira (7):
> crypto: Fixes uninitialized skcipher_walk use in sm4_aesni_avx_glue
> crypto: Fixes uninitialized skcipher_walk use in des3_ede_glue
> crypto: Fixes uninitialized skcipher_walk use in chacha_glue
> crypto: Fixes uninitialized skcipher_walk use in aesni-intel_glue
> crypto: Fixes uninitialized skcipher_walk use in aria_aesni_avx2_glue
> crypto: Fixes uninitialized skcipher_walk use in aria_aesni_avx_glue
> crypto: Fixes uninitialized skcipher_walk use in aria_gfni_avx512_glue
Updating all callers of skcipher_walk_virt() seems like the wrong approach.
Shouldn't skcipher_walk_virt() be fixed to initialize the flags to 0 instead?
Also, does this fix affect any behavior, or is it just to fix a KMSAN warning?
It needs to be fixed either way, but it's helpful to understand the effect of
the fix so that people can decide whether it needs to be backported or not.
- Eric
Powered by blists - more mailing lists