[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YzaJKX686KiMteCe@gondor.apana.org.au>
Date: Fri, 30 Sep 2022 14:14:01 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: Boris Brezillon <bbrezillon@...nel.org>,
Arnaud Ebalard <arno@...isbad.org>,
Srujana Challa <schalla@...vell.com>,
"David S. Miller" <davem@...emloft.net>,
Wolfram Sang <wsa+renesas@...g-engineering.com>,
Giovanni Cabiddu <giovanni.cabiddu@...el.com>,
Lukasz Bartosik <lbartosik@...vell.com>,
linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH v2] crypto: marvell/octeontx - prevent integer overflows
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@...cle.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@...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