public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Shunsuke Mie <mie@igel.co.jp>
Cc: kishon@ti.com, lorenzo.pieralisi@arm.com, bhelgaas@google.com,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] PCI: endpoint: Fix use after free in pci_epf_remove_cfs()
Date: Mon, 21 Jun 2021 10:39:48 +0200	[thread overview]
Message-ID: <YNBQVIT1yrzSng43@kroah.com> (raw)
In-Reply-To: <20210621070058.37682-1-mie@igel.co.jp>

On Mon, Jun 21, 2021 at 04:00:58PM +0900, Shunsuke Mie wrote:
> All of entries are freed in a loop, however, the freed entry is accessed
> by list_del() after the loop.
> 
> When epf driver that includes pci-epf-test unload, the pci_epf_remove_cfs()
> is called, and occurred the use after free. Therefore, kernel panics
> randomly after or while the module unloading.
> 
> I tested this patch with r8a77951-Salvator-xs boards.
> 
> Fixes: ef1433f ("PCI: endpoint: Create configfs entry for each pci_epf_device_id table entry")
> Signed-off-by: Shunsuke Mie <mie@igel.co.jp>
> ---
>  drivers/pci/endpoint/pci-epf-core.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree.  Please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>

  reply	other threads:[~2021-06-21  8:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-21  7:00 [PATCH] PCI: endpoint: Fix use after free in pci_epf_remove_cfs() Shunsuke Mie
2021-06-21  8:39 ` Greg KH [this message]
2021-12-06 11:45 ` Lorenzo Pieralisi
2021-12-07  7:26 ` Kishon Vijay Abraham I
2021-12-07  7:44   ` Shunsuke Mie
2021-12-10 11:09     ` Shunsuke Mie
  -- strict thread matches above, loose matches on Subject: below --
2021-06-11  3:50 Shunsuke Mie

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=YNBQVIT1yrzSng43@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=bhelgaas@google.com \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=mie@igel.co.jp \
    --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