OpenCloudOS-Kernel/drivers
Jiri Pirko 04207a9c64 virtio: delete vq in vp_find_vqs_msix() when request_irq() fails
[ Upstream commit 89875151fccdd024d571aa884ea97a0128b968b6 ]

When request_irq() fails, error path calls vp_del_vqs(). There, as vq is
present in the list, free_irq() is called for the same vector. That
causes following splat:

[    0.414355] Trying to free already-free IRQ 27
[    0.414403] WARNING: CPU: 1 PID: 1 at kernel/irq/manage.c:1899 free_irq+0x1a1/0x2d0
[    0.414510] Modules linked in:
[    0.414540] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 6.9.0-rc4+ #27
[    0.414540] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-1.fc39 04/01/2014
[    0.414540] RIP: 0010:free_irq+0x1a1/0x2d0
[    0.414540] Code: 1e 00 48 83 c4 08 48 89 e8 5b 5d 41 5c 41 5d 41 5e 41 5f c3 cc cc cc cc 90 8b 74 24 04 48 c7 c7 98 80 6c b1 e8 00 c9 f7 ff 90 <0f> 0b 90 90 48 89 ee 4c 89 ef e8 e0 20 b8 00 49 8b 47 40 48 8b 40
[    0.414540] RSP: 0000:ffffb71480013ae0 EFLAGS: 00010086
[    0.414540] RAX: 0000000000000000 RBX: ffffa099c2722000 RCX: 0000000000000000
[    0.414540] RDX: 0000000000000000 RSI: ffffb71480013998 RDI: 0000000000000001
[    0.414540] RBP: 0000000000000246 R08: 00000000ffffdfff R09: 0000000000000001
[    0.414540] R10: 00000000ffffdfff R11: ffffffffb18729c0 R12: ffffa099c1c91760
[    0.414540] R13: ffffa099c1c916a4 R14: ffffa099c1d2f200 R15: ffffa099c1c91600
[    0.414540] FS:  0000000000000000(0000) GS:ffffa099fec40000(0000) knlGS:0000000000000000
[    0.414540] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    0.414540] CR2: 0000000000000000 CR3: 0000000008e3e001 CR4: 0000000000370ef0
[    0.414540] Call Trace:
[    0.414540]  <TASK>
[    0.414540]  ? __warn+0x80/0x120
[    0.414540]  ? free_irq+0x1a1/0x2d0
[    0.414540]  ? report_bug+0x164/0x190
[    0.414540]  ? handle_bug+0x3b/0x70
[    0.414540]  ? exc_invalid_op+0x17/0x70
[    0.414540]  ? asm_exc_invalid_op+0x1a/0x20
[    0.414540]  ? free_irq+0x1a1/0x2d0
[    0.414540]  vp_del_vqs+0xc1/0x220
[    0.414540]  vp_find_vqs_msix+0x305/0x470
[    0.414540]  vp_find_vqs+0x3e/0x1a0
[    0.414540]  vp_modern_find_vqs+0x1b/0x70
[    0.414540]  init_vqs+0x387/0x600
[    0.414540]  virtnet_probe+0x50a/0xc80
[    0.414540]  virtio_dev_probe+0x1e0/0x2b0
[    0.414540]  really_probe+0xc0/0x2c0
[    0.414540]  ? __pfx___driver_attach+0x10/0x10
[    0.414540]  __driver_probe_device+0x73/0x120
[    0.414540]  driver_probe_device+0x1f/0xe0
[    0.414540]  __driver_attach+0x88/0x180
[    0.414540]  bus_for_each_dev+0x85/0xd0
[    0.414540]  bus_add_driver+0xec/0x1f0
[    0.414540]  driver_register+0x59/0x100
[    0.414540]  ? __pfx_virtio_net_driver_init+0x10/0x10
[    0.414540]  virtio_net_driver_init+0x90/0xb0
[    0.414540]  do_one_initcall+0x58/0x230
[    0.414540]  kernel_init_freeable+0x1a3/0x2d0
[    0.414540]  ? __pfx_kernel_init+0x10/0x10
[    0.414540]  kernel_init+0x1a/0x1c0
[    0.414540]  ret_from_fork+0x31/0x50
[    0.414540]  ? __pfx_kernel_init+0x10/0x10
[    0.414540]  ret_from_fork_asm+0x1a/0x30
[    0.414540]  </TASK>

Fix this by calling deleting the current vq when request_irq() fails.

Fixes: 0b0f9dc52e ("Revert "virtio_pci: use shared interrupts for virtqueues"")
Signed-off-by: Jiri Pirko <jiri@nvidia.com>
Message-Id: <20240426150845.3999481-1-jiri@resnulli.us>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-12 11:12:49 +02:00
..
accel accel/ivpu: Fix deadlock in context_xa 2024-04-17 11:19:34 +02:00
accessibility speakup: Fix sizeof() vs ARRAY_SIZE() bug 2024-06-12 11:11:18 +02:00
acpi x86/numa: Fix SRAT lookup of CFMWS ranges with numa_fill_memblks() 2024-06-12 11:11:50 +02:00
amba
android binder: fix max_thread type inconsistency 2024-05-25 16:22:54 +02:00
ata ata: sata_gemini: Check clk_enable() result 2024-05-17 12:02:13 +02:00
atm atm: idt77252: fix a memleak in open_card_ubr0 2024-02-16 19:10:49 +01:00
auxdisplay
base module: don't ignore sysfs_create_link() failures 2024-06-12 11:12:17 +02:00
bcma
block null_blk: Fix the WARNING: modpost: missing MODULE_DESCRIPTION() 2024-06-12 11:12:44 +02:00
bluetooth Bluetooth: HCI: Remove HCI_AMP support 2024-06-12 11:11:55 +02:00
bus bus: mhi: host: Add MHI_PM_SYS_ERR_FAIL state 2024-04-13 13:07:38 +02:00
cache cache: ax45mp_cache: Align end size to cache boundary in ax45mp_dma_cache_wback() 2024-03-01 13:35:08 +01:00
cdrom
cdx
char ppdev: Add an error check in register_device 2024-06-12 11:12:26 +02:00
clk clk: qcom: mmcc-msm8998: fix venus clock issue 2024-06-12 11:12:08 +02:00
clocksource clocksource/drivers/arm_global_timer: Fix maximum prescaler value 2024-04-03 15:28:50 +02:00
comedi comedi: vmk80xx: fix incomplete endpoint checking 2024-04-27 17:11:39 +02:00
connector connector/cn_proc: revert "connector: Fix proc_event_num_listeners count not cleared" 2024-02-23 09:25:01 +01:00
counter
cpufreq cpufreq: brcmstb-avs-cpufreq: ISO C90 forbids mixed declarations 2024-06-12 11:11:45 +02:00
cpuidle cpuidle: Avoid potential overflow in integer multiplication 2024-04-13 13:07:29 +02:00
crypto crypto: qat - specify firmware files for 402xx 2024-06-12 11:11:34 +02:00
cxl cxl/region: Fix cxlr_pmem leaks 2024-06-12 11:12:42 +02:00
dax
dca
devfreq PM / devfreq: Synchronize devfreq_monitor_[start/stop] 2024-02-05 20:14:15 +00:00
dio
dma dmaengine: idxd: Avoid unnecessary destruction of file_ida 2024-06-12 11:12:25 +02:00
dma-buf dma-buf: Fix NULL pointer dereference in sanitycheck() 2024-04-10 16:35:40 +02:00
edac EDAC/thunderx: Fix possible out-of-bounds string access 2024-01-25 15:35:12 -08:00
eisa
extcon extcon: max8997: select IRQ_DOMAIN instead of depending on it 2024-06-12 11:12:27 +02:00
firewire firewire: ohci: fulfill timestamp for some local asynchronous transaction 2024-05-17 12:02:30 +02:00
firmware firmware: dmi-id: add a release callback function 2024-06-12 11:12:15 +02:00
fpga fpga: region: add owner module and take its refcount 2024-06-12 11:12:23 +02:00
fsi
gnss
gpio gpiolib: acpi: Fix failed in acpi_gpiochip_find() by adding parent node match 2024-06-12 11:12:34 +02:00
gpu drm/nouveau: use tile_mode and pte_kind for VM_BIND bo allocations 2024-06-12 11:12:45 +02:00
greybus
hid HID: amd_sfh: Handle "no sensors" in PM operations 2024-06-12 11:11:50 +02:00
hsi
hte
hv Drivers: hv: vmbus: Don't free ring buffers that couldn't be re-encrypted 2024-05-17 12:02:17 +02:00
hwmon pwm: Rename pwm_apply_state() to pwm_apply_might_sleep() 2024-06-12 11:12:24 +02:00
hwspinlock
hwtracing stm class: Fix a double free in stm_register_device() 2024-06-12 11:12:26 +02:00
i2c i2c: synquacer: Fix an error handling path in synquacer_i2c_probe() 2024-06-12 11:12:26 +02:00
i3c i3c: dw: Disable IBI IRQ depends on hot-join and SIR enabling 2024-03-26 18:20:01 -04:00
idle x86: Fix CPUIDLE_FLAG_IRQ_ENABLE leaking timer reprogram 2024-01-25 15:35:12 -08:00
iio iio: accel: mxc4005: Reset chip on probe() and resume() 2024-06-12 11:12:34 +02:00
infiniband RDMA/cma: Fix kmemleak in rdma_core observed during blktests nvme/rdma use siw 2024-06-12 11:12:11 +02:00
input Input: cyapa - add missing input core locking to suspend/resume functions 2024-06-12 11:12:40 +02:00
interconnect interconnect: qcom: qcm2290: Fix mas_snoc_bimc QoS port assignment 2024-06-12 11:12:18 +02:00
iommu iommu: Undo pasid attachment only for the devices that have succeeded 2024-06-12 11:12:06 +02:00
ipack
irqchip irqchip/loongson-pch-msi: Fix off-by-one on allocation error path 2024-06-12 11:11:40 +02:00
isdn
leds leds: pwm: Disable PWM when going to suspend 2024-06-12 11:12:24 +02:00
macintosh macintosh/via-macii: Fix "BUG: sleeping function called from invalid context" 2024-06-12 11:11:47 +02:00
mailbox mailbox: arm_mhuv2: Fix a bug for mhuv2_sender_interrupt 2024-02-05 20:14:31 +00:00
mcb
md md: fix resync softlockup when bitmap size is less than array size 2024-06-12 11:11:34 +02:00
media media: cec: core: avoid confusing "transmit timed out" message 2024-06-12 11:12:43 +02:00
memory memory: tegra: Correct DLA client names 2024-03-26 18:19:32 -04:00
memstick
message
mfd mfd: cs42l43: Fix wrong GPIO_FN_SEL and SPI_CLK_CONFIG1 defaults 2024-03-26 18:19:55 -04:00
misc misc/pvpanic-pci: register attributes via pci_driver 2024-06-12 11:12:35 +02:00
mmc mmc: sdhci_am654: Fix ITAPDLY for HS400 timing 2024-06-12 11:12:37 +02:00
most
mtd mtd: rawnand: hynix: fixed typo 2024-06-12 11:11:58 +02:00
mux
net net: lan966x: Remove ptp traps in case the ptp is not enabled. 2024-06-12 11:12:49 +02:00
nfc NFC: trf7970a: disable all regulators on removal 2024-05-02 16:32:36 +02:00
ntb NTB: fix possible name leak in ntb_register_device() 2024-03-26 18:19:48 -04:00
nubus
nvdimm
nvme nvmet: prevent sprintf() overflow in nvmet_subsys_nsid_exists() 2024-06-12 11:11:30 +02:00
nvmem nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
of of: module: add buffer overflow check in of_modalias() 2024-06-12 11:12:10 +02:00
opp OPP: debugfs: Fix warning around icc_get_name() 2024-03-26 18:19:40 -04:00
parisc parisc/power: Fix power soft-off button emulation on qemu 2024-01-31 16:18:52 -08:00
parport parport: parport_serial: Add Brainboxes device IDs and geometry 2024-01-20 11:51:48 +01:00
pci PCI/EDR: Align EDR_PORT_LOCATE_DSM with PCI Firmware r3.3 2024-06-12 11:12:27 +02:00
pcmcia
peci
perf perf/arm-dmc620: Fix lockdep assert in ->event_init() 2024-06-12 11:12:46 +02:00
phy phy: qcom: qmp-combo: fix duplicate return in qmp_v4_configure_dp_phy 2024-06-12 11:12:14 +02:00
pinctrl pinctrl: qcom: pinctrl-sm7150: Fix sdc1 and ufs special pins regs 2024-06-12 11:12:24 +02:00
platform platform/x86: thinkpad_acpi: Take hotkey_mutex during hotkey_exit() 2024-06-12 11:12:41 +02:00
pmdomain pmdomain: imx8mp-blk-ctrl: imx8mp_blk: Add fdcc clock to hdmimix domain 2024-04-13 13:07:30 +02:00
pnp PNP: ACPI: fix fortify warning 2024-02-05 20:14:15 +00:00
power power: supply: mt6360_charger: Fix of_match for usb-otg-vbus regulator 2024-05-17 12:01:58 +02:00
powercap powercap: intel_rapl_tpmi: Fix System Domain probing 2024-04-03 15:28:19 +02:00
pps
ps3
ptp
pwm pwm: Rename pwm_apply_state() to pwm_apply_might_sleep() 2024-06-12 11:12:24 +02:00
rapidio
ras
regulator regulator: tps6594-regulator: Correct multi-phase configuration 2024-06-12 11:12:48 +02:00
remoteproc remoteproc: mediatek: Make sure IPI buffer fits in L2TCM 2024-05-25 16:22:55 +02:00
reset reset: hisilicon: hi6220: fix Wvoid-pointer-to-enum-cast warning 2024-01-20 11:51:44 +01:00
rpmsg rpmsg: virtio: Free driver_override when rpmsg_remove() 2024-01-31 16:18:50 -08:00
rtc nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
s390 s390/cio: fix tracepoint subchannel type field 2024-06-12 11:11:32 +02:00
sbus
scsi scsi: qla2xxx: Fix debugfs output for fw_resource_count 2024-06-12 11:11:50 +02:00
sh
siox
slimbus slimbus: qcom-ngd-ctrl: Add timeout for wait operation 2024-05-17 12:02:33 +02:00
soc soc: qcom: pmic_glink: Make client-lock non-sleeping 2024-06-12 11:11:34 +02:00
soundwire soundwire: cadence: fix invalid PDI offset 2024-06-12 11:12:15 +02:00
spi spi: microchip-core-qspi: fix setting spi bus clock rate 2024-05-17 12:02:36 +02:00
spmi spmi: mediatek: Fix UAF on device remove 2024-02-05 20:14:32 +00:00
ssb
staging greybus: arche-ctrl: move device table to its right location 2024-06-12 11:12:17 +02:00
target scsi: target: Fix SELinux error when systemd-modules loads the target module 2024-05-17 12:02:15 +02:00
tc
tee tee: optee: Fix kernel panic caused by incorrect error handling 2024-04-03 15:28:44 +02:00
thermal thermal/drivers/tsens: Fix null pointer dereference 2024-06-12 11:11:43 +02:00
thunderbolt thunderbolt: Reset only non-USB4 host routers in resume 2024-04-27 17:11:44 +02:00
tty serial: sc16is7xx: fix bug in sc16is7xx_set_baud() when using prescaler 2024-06-12 11:12:35 +02:00
ufs scsi: ufs: core: mcq: Fix ufshcd_mcq_sqe_search() 2024-06-12 11:11:45 +02:00
uio uio_hv_generic: Don't free decrypted memory 2024-05-17 12:02:17 +02:00
usb usb: fotg210: Add missing kernel doc description 2024-06-12 11:12:31 +02:00
vdpa vdpa/mlx5: Allow CVQ size changes 2024-03-26 18:20:10 -04:00
vfio vfio/pci: fix potential memory leak in vfio_intx_enable() 2024-06-12 11:12:22 +02:00
vhost vhost: Add smp_rmb() in vhost_enable_notify() 2024-04-17 11:19:35 +02:00
video pwm: Rename pwm_apply_state() to pwm_apply_might_sleep() 2024-06-12 11:12:24 +02:00
virt drivers/virt/acrn: fix PFNMAP PTE checks in acrn_vm_ram_map() 2024-06-12 11:12:09 +02:00
virtio virtio: delete vq in vp_find_vqs_msix() when request_irq() fails 2024-06-12 11:12:49 +02:00
vlynq
w1 nvmem: add explicit config option to read old syntax fixed OF cells 2024-05-17 12:01:55 +02:00
watchdog watchdog: sa1100: Fix PTR_ERR_OR_ZERO() vs NULL check in sa1100dog_probe() 2024-06-12 11:12:25 +02:00
xen x86/xen: attempt to inflate the memory balloon on PVH 2024-04-13 13:07:39 +02:00
zorro
Kconfig
Makefile