From: Ameer Hamza <amhamza.mgc@gmail.com>
To: jmaloy@redhat.com, ying.xue@windriver.com, davem@davemloft.net,
kuba@kernel.org
Cc: tipc-discussion@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tipc: fixed possible memory leak issue
Date: Sat, 4 Dec 2021 16:20:32 +0500 [thread overview]
Message-ID: <20211204112032.GA16952@hamza-OptiPlex-7040> (raw)
In-Reply-To: <20211203174848.43879-1-amhamza.mgc@gmail.com>
On Fri, Dec 03, 2021 at 10:48:48PM +0500, Ameer Hamza wrote:
> Fixed coverity warning by freeing the memory before return
>
> Addresses-Coverity: 1494433 ("Resource leak")
>
> Signed-off-by: Ameer Hamza <amhamza.mgc@gmail.com>
> ---
> net/tipc/crypto.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/net/tipc/crypto.c b/net/tipc/crypto.c
> index b4d9419a015b..10e6d0e9ddbc 100644
> --- a/net/tipc/crypto.c
> +++ b/net/tipc/crypto.c
> @@ -599,6 +599,7 @@ static int tipc_aead_init(struct tipc_aead **aead, struct tipc_aead_key *ukey,
> tmp->key = kmemdup(ukey, tipc_aead_key_size(ukey), GFP_KERNEL);
> if (!tmp->key) {
> tipc_aead_free(&tmp->rcu);
> + kfree_sensitive(tmp);
> return -ENOMEM;
> }
> memcpy(&tmp->salt, ukey->key + keylen, TIPC_AES_GCM_SALT_SIZE);
> --
> 2.25.1
>
I reviewed this change again and coverity is generating a false
positive here. tipc_aead_free() is already releasing the allocated
memory for tmp. Please ignore this patch and sorry for the
inconvinience.
prev parent reply other threads:[~2021-12-04 11:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-03 17:48 Ameer Hamza
2021-12-04 11:20 ` Ameer Hamza [this message]
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=20211204112032.GA16952@hamza-OptiPlex-7040 \
--to=amhamza.mgc@gmail.com \
--cc=davem@davemloft.net \
--cc=jmaloy@redhat.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tipc-discussion@lists.sourceforge.net \
--cc=ying.xue@windriver.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®