linux/include
Chuck Lever 3674f780f4 SUNRPC: close backchannel before destroying callback service
A backchannel receive can complete a request while the NFS callback
service is being torn down.  xprt_complete_bc_request() removes the
request from bc_pa_list, drops bc_alloc_count, marks the request in use,
and then asks xprt_enqueue_bc_request() to hand it to the callback
service.

If teardown has already cleared xprt->bc_serv, xprt_enqueue_bc_request()
currently returns without enqueueing or freeing the committed request.
The xprt_get() taken on entry is leaked as well.  If the producer wins
the race before bc_serv is cleared, it can also enqueue onto sv_cb_list
after nfs_callback_down() has stopped the callback threads, leaving the
request linked to a svc_serv that is about to be freed.

Close the producer side before callback threads are stopped.  Add
xprt_svc_shutdown_bc() to clear xprt->bc_serv under bc_pa_lock, and call
it on callback shutdown and callback-start failure before stopping the
service threads.  Requests that lose the NULL transition in
xprt_enqueue_bc_request() are released through the normal backchannel
free path after balancing bc_slot_count.  Finally, drain any remaining
sv_cb_list requests after the callback threads have stopped and before
svc_destroy() frees the service.

Fixes: 441244d427 ("SUNRPC: cleanup common code in backchannel request")
Fixes: 9e9fdd0ad0 ("NFSv4.1: protect destroying and nullifying bc_serv structure")
Cc: stable@vger.kernel.org
Signed-off-by: Chris Mason <clm@meta.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20260528-tier2-v1-6-d026a1415e0b@oracle.com
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
2026-08-10 09:54:35 -04:00
..
acpi ACPI: CPPC: Check all controls for fast switching 2026-07-22 15:09:14 +02:00
asm-generic mm.git review status for mm-hotfixes-stable..mm-nonmm-stable 2026-06-21 13:20:19 -07:00
clocksource
crypto Networking changes for 7.2. 2026-06-17 08:17:00 +01:00
cxl cxl/region: Introduce devm_cxl_probe_mem() 2026-06-12 13:47:30 -07:00
drm drm-misc-fixes for v7.2-rc5: 2026-07-24 18:30:29 +10:00
dt-bindings SoC fixes for 7.2 2026-07-17 08:52:09 -07:00
hyperv mshv: fix hv_input_get_system_property struct 2026-07-22 21:58:21 +00:00
keys keys: Pin request_key_auth payload in instantiate paths 2026-06-15 15:19:13 +03:00
kunit linux_kselftest-kunit-7.2-rc1 2026-06-16 16:33:57 +05:30
kvm KVM: arm64: vgic: Fix race between LPI release and re-registration 2026-07-23 09:56:57 +01:00
linux SUNRPC: close backchannel before destroying callback service 2026-08-10 09:54:35 -04:00
math-emu
media media: v4l2-fwnode: Fix subdev owner overwritten in v4l2_async_register_subdev_sensor() 2026-06-05 10:28:03 +03:00
memory
misc
net Bluetooth: ISO: fix race of kfree vs kref_get_unless_zero 2026-07-28 16:13:12 -04:00
pcmcia Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (headers) 2026-07-03 07:38:16 +02:00
ras
rdma RDMA v7.2 merge window 2026-06-18 08:16:21 -07:00
rv rv: Prevent task migration while handling per-CPU events 2026-06-03 12:33:25 +02:00
scsi SCSI fixes on 20260802 2026-08-02 09:32:07 -07:00
soc soc/tegra: pmc: Fixes for v7.2 2026-07-10 14:40:52 +02:00
sound ASoC: SDCA: Move kcontrol search out of IRQ 2026-07-27 18:47:09 +01:00
target
trace mm/memory-failure: trace: change memory_failure_event to ras subsystem 2026-07-09 15:48:56 -07:00
uapi io_uring-7.2-20260724 2026-07-24 19:58:03 -07:00
ufs Merge branch 7.1/scsi-fixes into 7.2/scsi-staging 2026-06-15 21:01:30 -04:00
vdso futex: Provide infrastructure to plug the non contended robust futex unlock race 2026-06-03 11:38:52 +02:00
video
xen xen: Replace __ASSEMBLY__ with __ASSEMBLER__ in header files 2026-07-01 09:49:52 +02:00
Kbuild