lkml.org 
[lkml]   [2022]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@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

\
 
 \ /
  Last update: 2022-09-30 08:16    [W:0.026 / U:1.780 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site