linux-stable/drivers
Patrisious Haddad 04704c201b RDMA/mlx5: Return the firmware result upon destroying QP/RQ
[ Upstream commit 22664c06e9 ]

Previously when destroying a QP/RQ, the result of the firmware
destruction function was ignored and upper layers weren't informed
about the failure.
Which in turn could lead to various problems since when upper layer
isn't aware of the failure it continues its operation thinking that the
related QP/RQ was successfully destroyed while it actually wasn't,
which could lead to the below kernel WARN.

Currently, we return the correct firmware destruction status to upper
layers which in case of the RQ would be mlx5_ib_destroy_wq() which
was already capable of handling RQ destruction failure or in case of
a QP to destroy_qp_common(), which now would actually warn upon qp
destruction failure.

WARNING: CPU: 3 PID: 995 at drivers/infiniband/core/rdma_core.c:940 uverbs_destroy_ufile_hw+0xcb/0xe0 [ib_uverbs]
Modules linked in: xt_conntrack xt_MASQUERADE nf_conntrack_netlink nfnetlink xt_addrtype iptable_nat nf_nat br_netfilter rpcrdma rdma_ucm ib_iser libiscsi scsi_transport_iscsi rdma_cm ib_umad ib_ipoib iw_cm ib_cm mlx5_ib ib_uverbs ib_core overlay mlx5_core fuse
CPU: 3 PID: 995 Comm: python3 Not tainted 5.16.0-rc5+ #1
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
RIP: 0010:uverbs_destroy_ufile_hw+0xcb/0xe0 [ib_uverbs]
Code: 41 5c 41 5d 41 5e e9 44 34 f0 e0 48 89 df e8 4c 77 ff ff 49 8b 86 10 01 00 00 48 85 c0 74 a1 4c 89 e7 ff d0 eb 9a 0f 0b eb c1 <0f> 0b be 04 00 00 00 48 89 df e8 b6 f6 ff ff e9 75 ff ff ff 90 0f
RSP: 0018:ffff8881533e3e78 EFLAGS: 00010287
RAX: ffff88811b2cf3e0 RBX: ffff888106209700 RCX: 0000000000000000
RDX: ffff888106209780 RSI: ffff8881533e3d30 RDI: ffff888109b101a0
RBP: 0000000000000001 R08: ffff888127cb381c R09: 0de9890000000009
R10: ffff888127cb3800 R11: 0000000000000000 R12: ffff888106209780
R13: ffff888106209750 R14: ffff888100f20660 R15: 0000000000000000
FS:  00007f8be353b740(0000) GS:ffff88852c980000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f8bd5b117c0 CR3: 000000012cd8a004 CR4: 0000000000370ea0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 ib_uverbs_close+0x1a/0x90 [ib_uverbs]
 __fput+0x82/0x230
 task_work_run+0x59/0x90
 exit_to_user_mode_prepare+0x138/0x140
 syscall_exit_to_user_mode+0x1d/0x50
 ? __x64_sys_close+0xe/0x40
 do_syscall_64+0x4a/0x90
 entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f8be3ae0abb
Code: 03 00 00 00 0f 05 48 3d 00 f0 ff ff 77 41 c3 48 83 ec 18 89 7c 24 0c e8 83 43 f9 ff 8b 7c 24 0c 41 89 c0 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 44 89 c7 89 44 24 0c e8 c1 43 f9 ff 8b 44
RSP: 002b:00007ffdb51909c0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003
RAX: 0000000000000000 RBX: 0000557bb7f7c020 RCX: 00007f8be3ae0abb
RDX: 0000557bb7c74010 RSI: 0000557bb7f14ca0 RDI: 0000000000000005
RBP: 0000557bb7fbd598 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000293 R12: 0000557bb7fbd5b8
R13: 0000557bb7fbd5a8 R14: 0000000000001000 R15: 0000557bb7f7c020
 </TASK>

Signed-off-by: Patrisious Haddad <phaddad@nvidia.com>
Link: https://lore.kernel.org/r/c6df677f931d18090bafbe7f7dbb9524047b7d9b.1685953497.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-08-23 17:32:28 +02:00
..
accel accel/habanalabs: fix mem leak in capture user mappings 2023-08-23 17:32:27 +02:00
accessibility
acpi ACPI: scan: Create platform device for CS35L56 2023-08-16 18:32:31 +02:00
amba
android binder: fix memory leak in binder_init() 2023-08-16 18:32:21 +02:00
ata ata: pata_ns87415: mark ns87560_tf_read static 2023-08-03 10:26:00 +02:00
atm
auxdisplay
base x86/srso: Add a Speculative RAS Overflow mitigation 2023-08-08 20:04:51 +02:00
bcma
block zram: take device and not only bvec offset into account 2023-08-16 18:32:17 +02:00
bluetooth Bluetooth: btusb: Fix bluetooth on Intel Macbook 2014 2023-07-27 08:57:03 +02:00
bus bus: ixp4xx: fix IXP4XX_EXP_T1_MASK 2023-07-23 13:54:08 +02:00
cdrom
cdx cdx: fix driver managed dma support 2023-07-19 16:36:37 +02:00
char tpm_tis: Opt-in interrupts 2023-08-16 18:32:19 +02:00
clk clk: mediatek: mt8183: Add back SSPM related clocks 2023-08-11 12:14:26 +02:00
clocksource clocksource/drivers/cadence-ttc: Fix memory leak in ttc_timer_probe 2023-07-19 16:35:14 +02:00
comedi
connector
counter
cpufreq cpufreq: amd-pstate: fix global sysfs attribute type 2023-08-16 18:32:20 +02:00
cpuidle cpuidle: psci: Move enabling OSI mode after power domains creation 2023-08-16 18:32:19 +02:00
crypto crypto: qat - unmap buffers before free for RSA 2023-07-19 16:36:19 +02:00
cxl cxl/acpi: Return 'rc' instead of '0' in cxl_parse_cfmws() 2023-08-03 10:25:57 +02:00
dax dax/kmem: Pass valid argument to memory_group_register_static 2023-07-19 16:36:20 +02:00
dca
devfreq
dio
dma dmaengine: owl-dma: Modify mismatched function name 2023-08-16 18:32:28 +02:00
dma-buf dma-buf: fix an error pointer vs NULL bug 2023-08-03 10:26:14 +02:00
edac EDAC/qcom: Get rid of hardcoded register offsets 2023-05-26 20:56:55 -07:00
eisa
extcon extcon: Fix kernel doc of property capability fields to avoid warnings 2023-07-19 16:36:31 +02:00
firewire
firmware firmware: arm_scmi: Drop OF node reference in the transport channel setup 2023-08-11 12:14:19 +02:00
fpga
fsi
gnss
gpio gpio: sim: mark the GPIO chip as a one that can sleep 2023-08-16 18:32:29 +02:00
gpu drm/amdgpu: unmap and remove csa_va properly 2023-08-23 17:32:28 +02:00
greybus
hid HID: logitech-hidpp: Add USB and Bluetooth IDs for the Logitech G915 TKL Keyboard 2023-08-23 17:32:27 +02:00
hsi
hte
hv x86/hyperv: Fix hyperv_pcpu_input_arg handling when CPUs go online/offline 2023-06-17 23:09:47 +00:00
hwmon hwmon: (aquacomputer_d5next) Add selective 200ms delay after sending ctrl report 2023-08-16 18:32:25 +02:00
hwspinlock
hwtracing hwtracing: hisi_ptt: Fix potential sleep in atomic context 2023-07-19 16:36:39 +02:00
i2c i2c: nomadik: Remove a useless call in the remove function 2023-08-03 10:25:44 +02:00
i3c i3c: master: svc: fix cpu schedule in spin lock 2023-07-19 16:36:33 +02:00
idle
iio iio: light: bu27034: Fix scale format 2023-08-16 18:32:23 +02:00
infiniband RDMA/mlx5: Return the firmware result upon destroying QP/RQ 2023-08-23 17:32:28 +02:00
input Input: ads7846 - fix pointer cast warning 2023-07-19 16:36:59 +02:00
interconnect interconnect: qcom: sm8550: add enable_mask for bcm nodes 2023-08-16 18:32:23 +02:00
iommu iommu/amd: Introduce Disable IRTE Caching Support 2023-08-23 17:32:27 +02:00
ipack
irqchip irqchip/gic-v4.1: Properly lock VPEs when doing a directLPI invalidation 2023-08-03 10:26:09 +02:00
isdn mISDN: Update parameter type of dsp_cmx_send() 2023-08-16 18:32:25 +02:00
leds leds: trigger: netdev: Recheck NETDEV_LED_MODE_LINKUP on dev rename 2023-07-19 16:36:58 +02:00
macintosh
mailbox mailbox: ti-msgmgr: Fill non-message tx data fields with 0x0 2023-07-19 16:36:45 +02:00
mcb
md dm cache policy smq: ensure IO doesn't prevent cleaner policy progress 2023-08-03 10:26:13 +02:00
media media: mtk_jpeg_core: avoid unused-variable warning 2023-08-03 10:25:49 +02:00
memory memory: brcmstb_dpfe: fix testing array offset after use 2023-07-19 16:35:53 +02:00
memstick memstick r592: make memstick_debug_get_tpc_name() static 2023-07-19 16:35:28 +02:00
message
mfd mfd: pm8008: Fix module autoloading 2023-07-23 13:54:01 +02:00
misc misc: rtsx: judge ASPM Mode to set PETXCFG Reg 2023-08-16 18:32:21 +02:00
mmc mmc: sdhci-f-sdh30: Replace with sdhci_pltfm 2023-08-16 18:32:16 +02:00
most
mtd mtd: rawnand: fsl_upm: Fix an off-by one test in fun_exec_op() 2023-08-11 12:14:27 +02:00
mux
net RDMA/mana_ib: Use v2 version of cfg_rx_steer_req to enable RX coalescing 2023-08-23 17:32:26 +02:00
nfc nfc: fdp: Add MODULE_FIRMWARE macros 2023-06-18 11:19:52 +01:00
ntb NTB: ntb_tool: Add check for devm_kcalloc 2023-07-23 13:53:43 +02:00
nubus nubus: Partially revert proc_create_single_data() conversion 2023-07-05 18:30:30 +01:00
nvdimm
nvme nvme-pci: add NVME_QUIRK_BOGUS_NID for Samsung PM9B1 256G and 512G 2023-08-16 18:32:18 +02:00
nvmem nvmem: rmem: Use NVMEM_DEVID_AUTO 2023-07-19 16:36:37 +02:00
of of: Preserve "of-display" device name for compatibility 2023-07-27 08:56:36 +02:00
opp opp: Fix use-after-free in lazy_opp_tables after probe deferral 2023-07-23 13:54:07 +02:00
parisc
parport
pci PCI: tegra194: Fix possible array out of bounds access 2023-08-23 17:32:25 +02:00
pcmcia
peci
perf perf: RISC-V: Remove PERF_HES_STOPPED flag checking in riscv_pmu_start() 2023-07-23 13:54:09 +02:00
phy phy: hisilicon: Fix an out of bounds check in hisi_inno_phy_probe() 2023-08-03 10:25:50 +02:00
pinctrl pinctrl: renesas: rzg2l: Handle non-unique subnode names 2023-07-27 08:56:53 +02:00
platform ACPI: scan: Create platform device for CS35L56 2023-08-16 18:32:31 +02:00
pnp
power power: supply: rt9467: Make charger-enable control as logic level 2023-07-19 16:36:33 +02:00
powercap powercap: RAPL: Fix CONFIG_IOSF_MBI dependency 2023-07-19 16:35:15 +02:00
pps
ps3
ptp
pwm pwm: meson: fix handling of period/duty if greater than UINT_MAX 2023-07-23 13:54:11 +02:00
rapidio
ras
regulator regulator: da9063: fix null pointer deref with partial DT config 2023-07-27 08:56:56 +02:00
remoteproc
reset
rpmsg
rtc rtc: st-lpc: Release some resources in st_rtc_probe() in case of error 2023-07-19 16:36:40 +02:00
s390 scsi: zfcp: Defer fc_rport blocking until after ADISC response 2023-08-11 12:14:19 +02:00
sbus
scsi scsi: qedf: Fix firmware halt over suspend and resume 2023-08-16 18:32:31 +02:00
sh
siox
slimbus
soc soc: imx: imx8mp-blk-ctrl: register HSIO PLL clock as bus_power_dev child 2023-08-11 12:14:07 +02:00
soundwire soundwire: fix enumeration completion 2023-08-03 10:26:10 +02:00
spi spi: dw: Remove misleading comment for Mount Evans SoC 2023-07-27 08:57:06 +02:00
spmi
ssb
staging staging: ks7010: potential buffer overflow in ks_wlan_set_encode_ext() 2023-08-03 10:26:05 +02:00
target scsi: target: core: Fix error path in target_setup_session() 2023-06-14 21:54:35 -04:00
tc
tee AMDTEE add return origin to load TA command 2023-06-07 12:58:22 +02:00
thermal thermal: of: fix double-free on unregistration 2023-08-03 10:26:13 +02:00
thunderbolt thunderbolt: Fix memory leak in tb_handle_dp_bandwidth_request() 2023-08-16 18:32:21 +02:00
tty tty: n_gsm: fix UAF in gsm_cleanup_mux 2023-08-03 10:26:05 +02:00
ufs scsi: ufs: renesas: Fix private allocation 2023-08-16 18:32:30 +02:00
uio
usb usb: typec: altmodes/displayport: Signal hpd when configuring pin assignment 2023-08-16 18:32:21 +02:00
vdpa vduse: fix NULL pointer dereference 2023-07-19 16:36:47 +02:00
vfio vfio/mdev: Move the compat_class initialization to module init 2023-07-19 16:36:18 +02:00
vhost vhost_vdpa: support PACKED when setting-getting vring_base 2023-06-09 12:08:04 -04:00
video fbdev: au1200fb: Fix missing IRQ check in au1200fb_drv_probe 2023-07-27 08:57:01 +02:00
virt virt: sevguest: Add CONFIG_CRYPTO dependency 2023-07-19 16:35:08 +02:00
virtio virtio-vdpa: Fix unchecked call to NULL set_vq_affinity 2023-07-19 16:36:41 +02:00
vlynq
w1 w1: fix loop in w1_fini() 2023-07-19 16:36:25 +02:00
watchdog
xen xen: speed up grant-table reclaim 2023-08-03 10:26:09 +02:00
zorro
Kconfig
Makefile