lkml.org 
[lkml]   [2022]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] net: macsec: fix potential resource leak in macsec_add_rxsa() and macsec_add_txsa()
From
Date
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

\
 
 \ /
  Last update: 2022-07-07 09:39    [W:0.026 / U:0.692 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site