lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231113030041.3655742-1-Meng.Li@windriver.com>
Date:   Mon, 13 Nov 2023 11:00:41 +0800
From:   Meng Li <Meng.Li@...driver.com>
To:     gregkh@...uxfoundation.org, mathias.nyman@...ux.intel.com,
        stern@...land.harvard.edu, Basavaraj.Natikar@....com,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     meng.li@...driver.com
Subject: [PATCH] usb: hcd-pci: replace usb_hcd_irq() with generic_handle_irq_safe() to avoid calltrace

When running below to command to remove a PCIe-USB device,
there is below caltrace reported in RT kernel.
Call trace:
 ......
 __might_resched+0x160/0x1c0
 rt_spin_lock+0x38/0xb0
 xhci_irq+0x44/0x16d0
 usb_hcd_irq+0x38/0x5c
 usb_hcd_pci_remove+0x84/0x14c
 xhci_pci_remove+0x78/0xc0
 pci_device_remove+0x44/0xcc
 device_remove+0x54/0x8c
 device_release_driver_internal+0x1ec/0x260
 device_release_driver+0x20/0x30
 pci_stop_bus_device+0x8c/0xcc
 pci_stop_and_remove_bus_device_locked+0x28/0x44
 ......
 el0t_64_sync_handler+0xf4/0x120
 el0t_64_sync+0x18c/0x190
This issue is introduced by commit c548795abe0d("USB: add
check to detect host controller hardware removal"). Because
in RT-kernel, spinlock that may cause sleep is invoked under irq
disabled status. Therefore, replace usb_hcd_irq() function with
generic_handle_irq_safe() to avoid calltrace

Fixes: c548795abe0d ("USB: add check to detect host controller hardware removal")
Cc: stable@...r.kernel.org
Signed-off-by: Meng Li <Meng.Li@...driver.com>
---
 drivers/usb/core/hcd-pci.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
index ee3156f49533..3b5f7dccbe6a 100644
--- a/drivers/usb/core/hcd-pci.c
+++ b/drivers/usb/core/hcd-pci.c
@@ -325,9 +325,7 @@ void usb_hcd_pci_remove(struct pci_dev *dev)
 	 * to test whether the controller hardware has been removed (e.g.,
 	 * cardbus physical eject).
 	 */
-	local_irq_disable();
-	usb_hcd_irq(0, hcd);
-	local_irq_enable();
+	generic_handle_irq_safe(dev->irq);
 
 	/* Note: dev_set_drvdata must be called while holding the rwsem */
 	if (dev->class == CL_EHCI) {
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ