From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Pan Bian <bianpan2016@163.com>
Cc: Jack Wang <jinpu.wang@profitbricks.com>,
lindar_liu@usish.com,
"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: scsi: pm8001: fix double free in pm8001_pci_probe
Date: Thu, 10 Aug 2017 20:05:37 -0400 [thread overview]
Message-ID: <yq1poc32cku.fsf@oracle.com> (raw)
In-Reply-To: <1502192430-12440-1-git-send-email-bianpan2016@163.com> (Pan Bian's message of "Tue, 8 Aug 2017 19:40:30 +0800")
Pan,
> In function pm8001_pci_probe(), on errors that the control flow jumps to
> label err_out_ha_free, function pm8001_free() is called. In pm8001_free(),
> scsi_host_put() is called to release shost, which keeps the return value
> of scsi_host_alloc(). After pm8001_free() returns, kfree() is called to
> free shost again, resulting in a double free bug. This patch removes
> scsi_host_put() from pm8001_free() and explicitly calls scsi_host_put()
> to release Scsi_Host in need.
Applied to 4.14/scsi-queue.
--
Martin K. Petersen Oracle Linux Engineering
prev parent reply other threads:[~2017-08-11 0:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-08 11:40 scsi: pm8001: fix double free in pm8001_pci_probe Pan Bian
2017-08-08 13:10 ` Jinpu Wang
2017-08-11 0:05 ` Martin K. Petersen [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=yq1poc32cku.fsf@oracle.com \
--to=martin.petersen@oracle.com \
--cc=bianpan2016@163.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=jinpu.wang@profitbricks.com \
--cc=lindar_liu@usish.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/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