From: Herbert Xu <herbert@gondor.apana.org.au>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Boris Brezillon <bbrezillon@kernel.org>,
Arnaud Ebalard <arno@natisbad.org>,
Srujana Challa <schalla@marvell.com>,
"David S. Miller" <davem@davemloft.net>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Giovanni Cabiddu <giovanni.cabiddu@intel.com>,
Lukasz Bartosik <lbartosik@marvell.com>,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH v2] crypto: marvell/octeontx - prevent integer overflows
Date: Fri, 30 Sep 2022 14:14:01 +0800 [thread overview]
Message-ID: <YzaJKX686KiMteCe@gondor.apana.org.au> (raw)
In-Reply-To: <YygPh/RTMxucazLl@kili>
On Mon, Sep 19, 2022 at 09:43:19AM +0300, Dan Carpenter wrote:
> The "code_length" value comes from the firmware file. If your firmware
> is untrusted realistically there is probably very little you can do to
> protect yourself. Still we try to limit the damage as much as possible.
> Also Smatch marks any data read from the filesystem as untrusted and
> prints warnings if it not capped correctly.
>
> The "code_length * 2" can overflow. The round_up(ucode_size, 16) +
> sizeof() expression can overflow too. Prevent these overflows.
>
> Fixes: d9110b0b01ff ("crypto: marvell - add support for OCTEON TX CPT engine")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> v2: In the first commit, I accidentally added some unnecessary checks.
> Those were only drafts and I sent them uninitentionally. Sorry!
>
> .../crypto/marvell/octeontx/otx_cptpf_ucode.c | 18 ++++++++++++++++--
> 1 file changed, 16 insertions(+), 2 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:[~2022-09-30 6:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-19 6:43 [PATCH v2] crypto: marvell/octeontx - prevent integer overflows Dan Carpenter
2022-09-30 6:14 ` 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=YzaJKX686KiMteCe@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=arno@natisbad.org \
--cc=bbrezillon@kernel.org \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=giovanni.cabiddu@intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=lbartosik@marvell.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=schalla@marvell.com \
--cc=wsa+renesas@sang-engineering.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