stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] PCI: hv: Avoid use of hv_pci_dev->pci_slot after freeing it" failed to apply to 4.19-stable tree
@ 2019-10-08 17:18 gregkh
  2019-10-08 23:17 ` Dexuan Cui
  2019-10-08 23:25 ` Sasha Levin
  0 siblings, 2 replies; 3+ messages in thread
From: gregkh @ 2019-10-08 17:18 UTC (permalink / raw)
  To: decui, lorenzo.pieralisi; +Cc: stable


The patch below does not apply to the 4.19-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 533ca1feed98b0bf024779a14760694c7cb4d431 Mon Sep 17 00:00:00 2001
From: Dexuan Cui <decui@microsoft.com>
Date: Fri, 2 Aug 2019 22:50:20 +0000
Subject: [PATCH] PCI: hv: Avoid use of hv_pci_dev->pci_slot after freeing it

The slot must be removed before the pci_dev is removed, otherwise a panic
can happen due to use-after-free.

Fixes: 15becc2b56c6 ("PCI: hv: Add hv_pci_remove_slots() when we unload the driver")
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: stable@vger.kernel.org

diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
index 40b625458afa..2b53976cd9f9 100644
--- a/drivers/pci/controller/pci-hyperv.c
+++ b/drivers/pci/controller/pci-hyperv.c
@@ -2701,8 +2701,8 @@ static int hv_pci_remove(struct hv_device *hdev)
 		/* Remove the bus from PCI's point of view. */
 		pci_lock_rescan_remove();
 		pci_stop_root_bus(hbus->pci_bus);
-		pci_remove_root_bus(hbus->pci_bus);
 		hv_pci_remove_slots(hbus);
+		pci_remove_root_bus(hbus->pci_bus);
 		pci_unlock_rescan_remove();
 		hbus->state = hv_pcibus_removed;
 	}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: FAILED: patch "[PATCH] PCI: hv: Avoid use of hv_pci_dev->pci_slot after freeing it" failed to apply to 4.19-stable tree
  2019-10-08 17:18 FAILED: patch "[PATCH] PCI: hv: Avoid use of hv_pci_dev->pci_slot after freeing it" failed to apply to 4.19-stable tree gregkh
@ 2019-10-08 23:17 ` Dexuan Cui
  2019-10-08 23:25 ` Sasha Levin
  1 sibling, 0 replies; 3+ messages in thread
From: Dexuan Cui @ 2019-10-08 23:17 UTC (permalink / raw)
  To: gregkh@linuxfoundation.org, lorenzo.pieralisi@arm.com
  Cc: stable@vger.kernel.org

> -----Original Message-----
> From: gregkh@linuxfoundation.org <gregkh@linuxfoundation.org>
> Sent: Tuesday, October 8, 2019 10:19 AM
> To: Dexuan Cui <decui@microsoft.com>; lorenzo.pieralisi@arm.com
> Cc: stable@vger.kernel.org
> Subject: FAILED: patch "[PATCH] PCI: hv: Avoid use of hv_pci_dev->pci_slot
> after freeing it" failed to apply to 4.19-stable tree
> 
> 
> The patch below does not apply to the 4.19-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.
> 
> thanks,
> 
> greg k-h
> 
> ------------------ original commit in Linus's tree ------------------
> 
> From 533ca1feed98b0bf024779a14760694c7cb4d431 Mon Sep 17 00:00:00
> 2001
> From: Dexuan Cui <decui@microsoft.com>
> Date: Fri, 2 Aug 2019 22:50:20 +0000
> Subject: [PATCH] PCI: hv: Avoid use of hv_pci_dev->pci_slot after freeing it
> 
> The slot must be removed before the pci_dev is removed, otherwise a panic
> can happen due to use-after-free.
> 
> Fixes: 15becc2b56c6 ("PCI: hv: Add hv_pci_remove_slots() when we unload the
> driver")
> Signed-off-by: Dexuan Cui <decui@microsoft.com>
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: stable@vger.kernel.org
> 
> diff --git a/drivers/pci/controller/pci-hyperv.c
> b/drivers/pci/controller/pci-hyperv.c
> index 40b625458afa..2b53976cd9f9 100644
> --- a/drivers/pci/controller/pci-hyperv.c
> +++ b/drivers/pci/controller/pci-hyperv.c
> @@ -2701,8 +2701,8 @@ static int hv_pci_remove(struct hv_device *hdev)
>  		/* Remove the bus from PCI's point of view. */
>  		pci_lock_rescan_remove();
>  		pci_stop_root_bus(hbus->pci_bus);
> -		pci_remove_root_bus(hbus->pci_bus);
>  		hv_pci_remove_slots(hbus);
> +		pci_remove_root_bus(hbus->pci_bus);
>  		pci_unlock_rescan_remove();
>  		hbus->state = hv_pcibus_removed;
>  	}

I can't understand why the mail is generated, because v4.19.78 has already included 
the commit 533ca1feed98 ("PCI: hv: Avoid use of hv_pci_dev->pci_slot after freeing it")
by
commit 08fdaee2d97bdd55e03308b563783b2612670e8b
Author: Dexuan Cui <decui@microsoft.com>
Date:   Fri Aug 2 22:50:20 2019 +0000

    PCI: hv: Avoid use of hv_pci_dev->pci_slot after freeing it

    [ Upstream commit 533ca1feed98b0bf024779a14760694c7cb4d431 ]

    The slot must be removed before the pci_dev is removed, otherwise a panic
    can happen due to use-after-free.

    Fixes: 15becc2b56c6 ("PCI: hv: Add hv_pci_remove_slots() when we unload the driver")
    Signed-off-by: Dexuan Cui <decui@microsoft.com>
    Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: Sasha Levin <sashal@kernel.org>

Looks I can ignore the mail.

Thanks,
Dexuan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: FAILED: patch "[PATCH] PCI: hv: Avoid use of hv_pci_dev->pci_slot after freeing it" failed to apply to 4.19-stable tree
  2019-10-08 17:18 FAILED: patch "[PATCH] PCI: hv: Avoid use of hv_pci_dev->pci_slot after freeing it" failed to apply to 4.19-stable tree gregkh
  2019-10-08 23:17 ` Dexuan Cui
@ 2019-10-08 23:25 ` Sasha Levin
  1 sibling, 0 replies; 3+ messages in thread
From: Sasha Levin @ 2019-10-08 23:25 UTC (permalink / raw)
  To: gregkh; +Cc: decui, lorenzo.pieralisi, stable

On Tue, Oct 08, 2019 at 07:18:44PM +0200, gregkh@linuxfoundation.org wrote:
>
>The patch below does not apply to the 4.19-stable tree.
>If someone wants it applied there, or to any other stable or longterm
>tree, then please email the backport, including the original git commit
>id to <stable@vger.kernel.org>.
>
>thanks,
>
>greg k-h
>
>------------------ original commit in Linus's tree ------------------
>
>From 533ca1feed98b0bf024779a14760694c7cb4d431 Mon Sep 17 00:00:00 2001
>From: Dexuan Cui <decui@microsoft.com>
>Date: Fri, 2 Aug 2019 22:50:20 +0000
>Subject: [PATCH] PCI: hv: Avoid use of hv_pci_dev->pci_slot after freeing it
>
>The slot must be removed before the pci_dev is removed, otherwise a panic
>can happen due to use-after-free.
>
>Fixes: 15becc2b56c6 ("PCI: hv: Add hv_pci_remove_slots() when we unload the driver")
>Signed-off-by: Dexuan Cui <decui@microsoft.com>
>Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
>Cc: stable@vger.kernel.org

Doesn't look like it's relevant for <=4.19 .

-- 
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-08 23:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-08 17:18 FAILED: patch "[PATCH] PCI: hv: Avoid use of hv_pci_dev->pci_slot after freeing it" failed to apply to 4.19-stable tree gregkh
2019-10-08 23:17 ` Dexuan Cui
2019-10-08 23:25 ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).