From: Paolo Abeni <pabeni@redhat.com>
To: Jianglei Nie <niejianglei2021@163.com>,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: macsec: fix potential resource leak in macsec_add_rxsa() and macsec_add_txsa()
Date: Thu, 07 Jul 2022 09:38:05 +0200 [thread overview]
Message-ID: <4a66c4b6e6d5147b7545ff3e725f76d0169d96d1.camel@redhat.com> (raw)
In-Reply-To: <20220706074826.2254689-1-niejianglei2021@163.com>
hello,
On Wed, 2022-07-06 at 15:48 +0800, Jianglei Nie wrote:
> init_rx_sa() allocates relevant resource for rx_sa->stats and rx_sa->
> key.tfm with alloc_percpu() and macsec_alloc_tfm(). When some error
> occurs after init_rx_sa() is called in macsec_add_rxsa(), the function
> released rx_sa with kfree() without releasing rx_sa->stats and rx_sa->
> key.tfm, which will lead to a resource leak.
>
> We should call macsec_rxsa_put() instead of kfree() to decrease the ref
> count of rx_sa and release the relevant resource if the refcount is 0.
> The same bug exists in macsec_add_txsa() for tx_sa as well. This patch
> fixes the above two bugs.
>
> Signed-off-by: Jianglei Nie <niejianglei2021@163.com>
This looks exactly alike the previous version: it still lacks the
target tree and more importantly the Fixes tag.
Additionally, we new post a new revision of a previously posted patch,
you should include a version number into the subj line.
Please read carefully the documentation under Documentation/process/
(including maintainer-netdev.rst) before your next attempt,
Thanks!
Paolo
next prev parent reply other threads:[~2022-07-07 7:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-06 7:48 Jianglei Nie
2022-07-07 7:38 ` Paolo Abeni [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-07-22 9:29 Jianglei Nie
2022-07-25 11:00 ` patchwork-bot+netdevbpf
2022-07-04 12:33 Jianglei Nie
2022-07-05 13:03 ` Paolo Abeni
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=4a66c4b6e6d5147b7545ff3e725f76d0169d96d1.camel@redhat.com \
--to=pabeni@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=niejianglei2021@163.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®