lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Wed, 6 Mar 2024 10:29:38 +0100
From: Borislav Petkov <bp@...en8.de>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: Yazen Ghannam <yazen.ghannam@....com>, Tony Luck <tony.luck@...el.com>,
	naveenkrishna.chatradhi@....com, muralidhara.mk@....com,
	linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org,
	kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] RAS/AMD/FMPM: Fix off by one in error handling

On Wed, Mar 06, 2024 at 08:30:46AM +0300, Dan Carpenter wrote:
> Decrement "i" before the first iteration.  Depending on where this fails
> it could free something from one element beyond the end of the
> fru_records[] array.
> 
> Fixes: 6f15e617cc99 ("RAS: Introduce a FRU memory poison manager")
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
> ---
>  drivers/ras/amd/fmpm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ras/amd/fmpm.c b/drivers/ras/amd/fmpm.c
> index 0963c9e7b853..2f4ac9591c8f 100644
> --- a/drivers/ras/amd/fmpm.c
> +++ b/drivers/ras/amd/fmpm.c
> @@ -817,7 +817,7 @@ static int allocate_records(void)
>  	return ret;
>  
>  out_free:
> -	for (; i >= 0; i--)
> +	while (--i >= 0)
>  		kfree(fru_records[i]);
>  
>  	kfree(fru_records);
> -- 

Applied, thanks.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ