From: "Krzysztof Wilczyński" <kw@linux.com>
To: Ma Ke <make24@iscas.ac.cn>
Cc: lpieralisi@kernel.org, mani@kernel.org, kishon@kernel.org,
bhelgaas@google.com, jpinto@synopsys.com,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] PCI: endpoint: Fix a double free in __pci_epc_create()
Date: Tue, 14 Jan 2025 09:57:37 +0900 [thread overview]
Message-ID: <20250114005737.GA2004845@rocinante> (raw)
In-Reply-To: <20250107074601.789649-1-make24@iscas.ac.cn>
Hello,
> 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.
>
> Found by code review.
>
> Cc: stable@vger.kernel.org
> Fixes: 5e8cb4033807 ("PCI: endpoint: Add EP core layer to enable EP controller and EP functions")
> Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Which kernel release did you review? I don't see this kfree() when looking
at the current code base per:
https://elixir.bootlin.com/linux/v6.13-rc1/source/drivers/pci/endpoint/pci-epc-core.c#L956-L1020
Krzysztof
next prev parent reply other threads:[~2025-01-14 0:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-07 7:46 [PATCH] PCI: endpoint: Fix a double free in __pci_epc_create() Ma Ke
2025-01-14 0:57 ` Krzysztof Wilczyński [this message]
2025-02-20 16:23 ` Krzysztof Wilczyński
-- strict thread matches above, loose matches on Subject: below --
2025-01-02 9:30 Ma Ke
2025-01-03 10:28 ` Markus Elfring
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=20250114005737.GA2004845@rocinante \
--to=kw@linux.com \
--cc=bhelgaas@google.com \
--cc=jpinto@synopsys.com \
--cc=kishon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=make24@iscas.ac.cn \
--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