[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Zdk9V06gKW8EsH2k@gondor.apana.org.au>
Date: Sat, 24 Feb 2024 08:50:31 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: Damian Muszynski <damian.muszynski@...el.com>,
Giovanni Cabiddu <giovanni.cabiddu@...el.com>,
"David S. Miller" <davem@...emloft.net>,
Lucas Segarra Fernandez <lucas.segarra.fernandez@...el.com>,
Tero Kristo <tero.kristo@...ux.intel.com>,
Markas Rapoportas <markas.rapoportas@...el.com>,
qat-linux@...el.com, linux-crypto@...r.kernel.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] crypto: qat - uninitialized variable in
adf_hb_error_inject_write()
On Tue, Feb 13, 2024 at 09:09:41PM +0300, Dan Carpenter wrote:
> There are a few issues in this code. If *ppos is non-zero then the
> first part of the buffer is not initialized. We never initialize the
> last character of the buffer. The return is not checked so it's
> possible that none of the buffer is initialized.
>
> This is debugfs code which is root only and the impact of these bugs is
> very small. However, it's still worth fixing. To fix this:
> 1) Check that *ppos is zero.
> 2) Use copy_from_user() instead of simple_write_to_buffer().
> 3) Explicitly add a NUL terminator.
>
> Fixes: e2b67859ab6e ("crypto: qat - add heartbeat error simulator")
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
> ---
> .../crypto/intel/qat/qat_common/adf_heartbeat_dbgfs.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Powered by blists - more mailing lists