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: Tue, 2 Jan 2024 10:13:17 +0800
From: Tony Lu <tonylu@...ux.alibaba.com>
To: Markus Elfring <Markus.Elfring@....de>
Cc: linux-s390@...r.kernel.org, netdev@...r.kernel.org,
	kernel-janitors@...r.kernel.org,
	"David S. Miller" <davem@...emloft.net>,
	"D. Wythe" <alibuda@...ux.alibaba.com>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Jan Karcher <jaka@...ux.ibm.com>,
	Paolo Abeni <pabeni@...hat.com>, Wen Gu <guwen@...ux.alibaba.com>,
	Wenjia Zhang <wenjia@...ux.ibm.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] net/smc: Return directly after a failed kzalloc() in
 smc_fill_gid_list()

On Sun, Dec 31, 2023 at 03:58:15PM +0100, Markus Elfring wrote:
> From: Markus Elfring <elfring@...rs.sourceforge.net>
> Date: Sun, 31 Dec 2023 15:15:19 +0100
> 
> The kfree() function was called in one case by
> the smc_fill_gid_list() function during error handling
> even if the passed variable contained a null pointer.
> This issue was detected by using the Coccinelle software.
> 
> Thus return directly after a call of the function "kzalloc" failed
> at the beginning.
> 
> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>

LGTM, thank you.

Also please add net tag in subject and fixes tag in commit body.

Reviewed-by: Tony Lu <tonylu@...ux.alibaba.com>

> ---
>  net/smc/af_smc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
> index 7fc2f3c6d248..a396a9977ba9 100644
> --- a/net/smc/af_smc.c
> +++ b/net/smc/af_smc.c
> @@ -1180,7 +1180,7 @@ void smc_fill_gid_list(struct smc_link_group *lgr,
> 
>  	alt_ini = kzalloc(sizeof(*alt_ini), GFP_KERNEL);
>  	if (!alt_ini)
> -		goto out;
> +		return;
> 
>  	alt_ini->vlan_id = lgr->vlan_id;
>  	alt_ini->check_smcrv2 = true;
> --
> 2.43.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ