public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Winkler, Tomas" <tomas.winkler@intel.com>
To: 亿一 <teroincn@gmail.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [BUG]is there a refcount leak in function mei_me_cl_rm_by_uuid?
Date: Thu, 7 May 2020 18:50:50 +0000	[thread overview]
Message-ID: <06ef12d05af446e8bc8cc674c68cecf7@intel.com> (raw)
In-Reply-To: <CANTwqXAwbiGwd3-6ShQw-kvnwNPk6Ev2Sc1yMTVH4+1=mxRQsA@mail.gmail.com>



> -----Original Message-----
> From: 亿一 <teroincn@gmail.com>
> Sent: Wednesday, May 06, 2020 17:47
> To: Winkler, Tomas <tomas.winkler@intel.com>
> Cc: linux-kernel@vger.kernel.org
> Subject: [BUG]is there a refcount leak in function mei_me_cl_rm_by_uuid?

Unfortunately you are correct,  but currently it is very hard to hit the issue in real life.
The patch is coming. 
Thanks
Tomas


> 
> HI, all
> When reviewing function mei_me_cl_rm_by_uuid, I notice that function
> __mei_me_cl_by_uuid increases me_cl refcount and function _mei_me_cl_del
> delete a list node with decrement me_cl refcount , actually here cause a
> refcount leak as we haven't release the refcount by __mei_me_cl_by_uuid  ?
> similar issue happens in mei_me_cl_rm_by_uuid_id too.
> 
> void mei_me_cl_rm_by_uuid(struct mei_device *dev, const uuid_le *uuid) {
>     struct mei_me_client *me_cl;
> 
>     dev_dbg(dev->dev, "remove %pUl\n", uuid);
> 
>     down_write(&dev->me_clients_rwsem);
>     me_cl = __mei_me_cl_by_uuid(dev, uuid); /* increase a refcount */
>     __mei_me_cl_del(dev, me_cl); /* release the refcount with a list node deteled
> */
>     up_write(&dev->me_clients_rwsem);
> }
> 
> Best regards,
> 
> Lin Yi.

      reply	other threads:[~2020-05-07 18:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-06 14:46 [BUG]is there a refcount leak in function mei_me_cl_rm_by_uuid? 亿一
2020-05-07 18:50 ` Winkler, Tomas [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=06ef12d05af446e8bc8cc674c68cecf7@intel.com \
    --to=tomas.winkler@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=teroincn@gmail.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