From: Herbert Xu <herbert@gondor.apana.org.au>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Damian Muszynski <damian.muszynski@intel.com>,
Giovanni Cabiddu <giovanni.cabiddu@intel.com>,
"David S. Miller" <davem@davemloft.net>,
Lucas Segarra Fernandez <lucas.segarra.fernandez@intel.com>,
Tero Kristo <tero.kristo@linux.intel.com>,
Markas Rapoportas <markas.rapoportas@intel.com>,
qat-linux@intel.com, linux-crypto@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] crypto: qat - uninitialized variable in adf_hb_error_inject_write()
Date: Sat, 24 Feb 2024 08:50:31 +0800 [thread overview]
Message-ID: <Zdk9V06gKW8EsH2k@gondor.apana.org.au> (raw)
In-Reply-To: <193d36b0-961a-4b66-b945-37988f157ebe@moroto.mountain>
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@linaro.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@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
prev parent reply other threads:[~2024-02-24 0:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-13 18:09 Dan Carpenter
2024-02-16 17:22 ` Cabiddu, Giovanni
2024-02-19 5:45 ` Dan Carpenter
2024-02-24 0:50 ` Herbert Xu [this message]
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=Zdk9V06gKW8EsH2k@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=damian.muszynski@intel.com \
--cc=dan.carpenter@linaro.org \
--cc=davem@davemloft.net \
--cc=giovanni.cabiddu@intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lucas.segarra.fernandez@intel.com \
--cc=markas.rapoportas@intel.com \
--cc=qat-linux@intel.com \
--cc=tero.kristo@linux.intel.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
all inboxes | Powered by JetHome®