From: Simon Horman <horms@kernel.org>
To: Hangbin Liu <liuhangbin@gmail.com>
Cc: netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
David Ahern <dsahern@kernel.org>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
David Lebrun <david.lebrun@uclouvain.be>,
Sabrina Dubroca <sd@queasysnail.net>
Subject: Re: [PATCH net] ipv6: sr: fix memleak in seg6_hmac_init_algo
Date: Fri, 17 May 2024 15:34:00 +0100 [thread overview]
Message-ID: <20240517143400.GF443576@kernel.org> (raw)
In-Reply-To: <20240517005435.2600277-1-liuhangbin@gmail.com>
On Fri, May 17, 2024 at 08:54:35AM +0800, Hangbin Liu wrote:
> seg6_hmac_init_algo returns without cleaning up the previous allocations
> if one fails, so it's going to leak all that memory and the crypto tfms.
>
> Update seg6_hmac_exit to only free the memory when allocated, so we can
> reuse the code directly.
>
> Fixes: bf355b8d2c30 ("ipv6: sr: add core files for SR HMAC support")
> Reported-by: Sabrina Dubroca <sd@queasysnail.net>
> Closes: https://lore.kernel.org/netdev/Zj3bh-gE7eT6V6aH@hog/
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Thanks,
I agree that this was leaking resources, and that after the updates to
seg6_hmac_exit included in this patch it can be used to unwind partial
initialisation in seg6_hmac_init_algo().
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2024-05-17 14:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-17 0:54 [PATCH net] ipv6: sr: fix memleak in seg6_hmac_init_algo Hangbin Liu
2024-05-17 14:34 ` Simon Horman [this message]
2024-05-17 16:52 ` Sabrina Dubroca
2024-05-21 11:20 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240517143400.GF443576@kernel.org \
--to=horms@kernel.org \
--cc=davem@davemloft.net \
--cc=david.lebrun@uclouvain.be \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=liuhangbin@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sd@queasysnail.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.