public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: make_ruc2021@163.com, linux-pci@vger.kernel.org,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Joao Pinto" <jpinto@synopsys.com>,
	"Kishon Vijay Abraham I" <kishon@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Manivannan Sadhasivam" <mani@kernel.org>
Cc: stable@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] PCI: endpoint: Fix a double free in __pci_epc_create()
Date: Fri, 3 Jan 2025 11:28:33 +0100	[thread overview]
Message-ID: <bc5eeafc-b6e1-4e71-8f7a-0f63c6130239@web.de> (raw)
In-Reply-To: <20250102093058.177866-1-make_ruc2021@163.com>

> The put_device(&epc->dev) call will trigger pci_epc_release() which
> frees "epc" so the kfree(epc) on the next line is a double free.

See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.13-rc5#n94


> Found by code review.

Would you become interested to check how many similar control flows
can still be detected by the means of automated advanced source code analyses?

Regards,
Markus

  reply	other threads:[~2025-01-03 10:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-02  9:30 [PATCH] PCI: endpoint: Fix a double free in __pci_epc_create() Ma Ke
2025-01-03 10:28 ` Markus Elfring [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-01-07  7:46 Ma Ke
2025-01-14  0:57 ` Krzysztof Wilczyński
2025-02-20 16:23   ` Krzysztof Wilczyński

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=bc5eeafc-b6e1-4e71-8f7a-0f63c6130239@web.de \
    --to=markus.elfring@web.de \
    --cc=bhelgaas@google.com \
    --cc=jpinto@synopsys.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kishon@kernel.org \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=make_ruc2021@163.com \
    --cc=mani@kernel.org \
    --cc=stable@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