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] [thread-next>] [day] [month] [year] [list]
Message-ID: <affb2f94fdcf3346174b27b525ea968001faa57c.camel@codeconstruct.com.au>
Date:   Tue, 08 Nov 2022 09:39:22 +0800
From:   Matt Johnston <matt@...econstruct.com.au>
To:     Wei Yongjun <weiyongjun@...weicloud.com>,
        Jeremy Kerr <jk@...econstruct.com.au>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>
Cc:     Wei Yongjun <weiyongjun1@...wei.com>, netdev@...r.kernel.org
Subject: Re: [PATCH net] mctp: Fix an error handling path in mctp_init()

On Mon, 2022-11-07 at 15:27 +0000, Wei Yongjun wrote:
> From: Wei Yongjun <weiyongjun1@...wei.com>
> 
> If mctp_neigh_init() return error, the routes resources should
> be released in the error handling path. Otherwise some resources
> leak.
> 
> Fixes: 4d8b9319282a ("mctp: Add neighbour implementation")
> Signed-off-by: Wei Yongjun <weiyongjun1@...wei.com>

Acked-by: Matt Johnston <matt@...econstruct.com.au>

Thanks for catching that.

Matt

> 
> diff --git a/net/mctp/af_mctp.c b/net/mctp/af_mctp.c
> index b6b5e496fa40..fc9e728b6333 100644
> --- a/net/mctp/af_mctp.c
> +++ b/net/mctp/af_mctp.c
> @@ -665,12 +665,14 @@ static __init int mctp_init(void)
>  
>  	rc = mctp_neigh_init();
>  	if (rc)
> -		goto err_unreg_proto;
> +		goto err_unreg_routes;
>  
>  	mctp_device_init();
>  
>  	return 0;
>  
> +err_unreg_routes:
> +	mctp_routes_exit();
>  err_unreg_proto:
>  	proto_unregister(&mctp_proto);
>  err_unreg_sock:

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ