Re: [PATCH] crypto: octeontx2 - Avoid stack variable overflow

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 15, 2021 at 02:55:58PM -0800, Kees Cook wrote:
>> @@ -1762,7 +1762,7 @@ void otx2_cpt_print_uc_dbg_info(struct otx2_cptpf_dev *cptpf)
>  	char engs_info[2 * OTX2_CPT_NAME_LENGTH];
>  	struct otx2_cpt_eng_grp_info *grp;
>  	struct otx2_cpt_engs_rsvd *engs;
> -	u32 mask[4];
> +	u32 mask[5];

Are you sure 144 bits will overflow u32[4]? If not then shouldn't
the fix be to remove the bogus print on mask[4]?

On another note, the debug code looks like crap if engs_num is
less than the maximum of 144 as it will print random data from
the kernel stack.

Thanks,
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux