Patch "rxrpc: serialize kernel accept preallocation with socket teardown" has been added to the 5.10-stable tree

gregkh at linuxfoundation.org gregkh at linuxfoundation.org
Thu Aug 20 06:36:28 PDT 2026


This is a note to let you know that I've just added the patch titled

    rxrpc: serialize kernel accept preallocation with socket teardown

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     rxrpc-serialize-kernel-accept-preallocation-with-socket-teardown.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable at vger.kernel.org> know about it.


>From stable+bounces-288005-greg=kroah.com at vger.kernel.org Wed Jul 22 19:34:44 2026
From: Sasha Levin <sashal at kernel.org>
Date: Wed, 22 Jul 2026 13:29:43 -0400
Subject: rxrpc: serialize kernel accept preallocation with socket teardown
To: stable at vger.kernel.org
Cc: Li Daming <d4n.for.sec at gmail.com>, Yuan Tan <yuantan098 at gmail.com>, Yifan Wu <yifanwucs at gmail.com>, Juefei Pu <tomapufckgml at gmail.com>, Xin Liu <bird at lzu.edu.cn>, Ren Wei <n05ec at lzu.edu.cn>, David Howells <dhowells at redhat.com>, Marc Dionne <marc.dionne at auristor.com>, Jeffrey Altman <jaltman at auristor.com>, Simon Horman <horms at kernel.org>, linux-afs at lists.infradead.org, stable at kernel.org, Jakub Kicinski <kuba at kernel.org>, Sasha Levin <sashal at kernel.org>
Message-ID: <20260722172943.2067905-1-sashal at kernel.org>

From: Li Daming <d4n.for.sec at gmail.com>

[ Upstream commit dc175389b18c29a5303ee83169ec653adfae3e17 ]

rxrpc_kernel_charge_accept() reads rx->backlog without any
socket/backlog synchronization and passes that raw pointer into
rxrpc_service_prealloc_one(). A concurrent rxrpc_discard_prealloc()
sets rx->backlog = NULL and frees the backlog rings, so a kernel
preallocation worker can keep using a freed struct rxrpc_backlog
while updating *_backlog_head/tail and array slots.

Serialize the state check and backlog lookup with the socket lock,
and reject kernel preallocation once teardown has disabled
listening or discarded the service backlog.

Fixes: 00e907127e6f ("rxrpc: Preallocate peers, conns and calls for incoming service requests")
Reported-by: Yuan Tan <yuantan098 at gmail.com>
Reported-by: Yifan Wu <yifanwucs at gmail.com>
Reported-by: Juefei Pu <tomapufckgml at gmail.com>
Reported-by: Xin Liu <bird at lzu.edu.cn>
Signed-off-by: Li Daming <d4n.for.sec at gmail.com>
Signed-off-by: Ren Wei <n05ec at lzu.edu.cn>
Signed-off-by: David Howells <dhowells at redhat.com>
cc: Marc Dionne <marc.dionne at auristor.com>
cc: Jeffrey Altman <jaltman at auristor.com>
cc: Simon Horman <horms at kernel.org>
cc: linux-afs at lists.infradead.org
cc: stable at kernel.org
Link: https://patch.msgid.link/20260609140911.838677-6-dhowells@redhat.com
Signed-off-by: Jakub Kicinski <kuba at kernel.org>
[ kept 6.1's extra user_attach_call argument in the rxrpc_service_prealloc_one() call ]
Signed-off-by: Sasha Levin <sashal at kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
---
 net/rxrpc/call_accept.c |   27 ++++++++++++++++++++-------
 1 file changed, 20 insertions(+), 7 deletions(-)

--- a/net/rxrpc/call_accept.c
+++ b/net/rxrpc/call_accept.c
@@ -481,14 +481,27 @@ int rxrpc_kernel_charge_accept(struct so
 			       unsigned long user_call_ID, gfp_t gfp,
 			       unsigned int debug_id)
 {
-	struct rxrpc_sock *rx = rxrpc_sk(sock->sk);
-	struct rxrpc_backlog *b = rx->backlog;
+	struct rxrpc_backlog *b;
+	struct rxrpc_sock *rx;
+	struct sock *sk;
+	int ret;
 
-	if (sock->sk->sk_state == RXRPC_CLOSE)
-		return -ESHUTDOWN;
+	sk = sock->sk;
+	rx = rxrpc_sk(sk);
 
-	return rxrpc_service_prealloc_one(rx, b, notify_rx,
-					  user_attach_call, user_call_ID,
-					  gfp, debug_id);
+	lock_sock(sk);
+	if (sk->sk_state != RXRPC_SERVER_LISTENING || !rx->backlog) {
+		ret = -ESHUTDOWN;
+		goto out;
+	}
+
+	b = rx->backlog;
+	ret = rxrpc_service_prealloc_one(rx, b, notify_rx,
+					 user_attach_call, user_call_ID,
+					 gfp, debug_id);
+
+out:
+	release_sock(sk);
+	return ret;
 }
 EXPORT_SYMBOL(rxrpc_kernel_charge_accept);


Patches currently in stable-queue which might be from sashal at kernel.org are

queue-5.10/udmabuf-do-not-create-malformed-scatterlists.patch
queue-5.10/rxrpc-fix-notification-vs-call-release-vs-recvmsg.patch
queue-5.10/dma-buf-udmabuf-skip-redundant-cpu-sync-to-fix-cacheline-eexist-warning.patch
queue-5.10/input-mms114-reject-an-oversized-device-packet-size.patch
queue-5.10/scsi-target-bound-pr-out-transportid-parsing-to-the-received-buffer.patch
queue-5.10/media-mediatek-vcodec-fix-a-resource-leak-related-to.patch
queue-5.10/fpga-dfl-afu-validate-dma-mapping-length-in-afu_dma_map_region.patch
queue-5.10/netfilter-nft_set_pipapo-move-cloning-of-match-info-to-insert-removal-path.patch
queue-5.10/jbd2-fix-integer-underflow-in-jbd2_journal_initialize_fast_commit.patch
queue-5.10/scsi-target-core-generate-correct-identifiers-for-pr-out-transport-ids.patch
queue-5.10/octeontx2-annotate-mmio-regions-as-__iomem.patch
queue-5.10/mlxsw-fix-refcount-leak-in-mlxsw_sp_port_lag_join.patch
queue-5.10/net-9p-fix-infinite-loop-in-p9_client_rpc-on-fatal-signal.patch
queue-5.10/ipvs-separate-destination-availability-state.patch
queue-5.10/taskstats-retain-dead-thread-stats-in-tgid-queries.patch
queue-5.10/octeontx2-pf-clear-stale-mailbox-irq-state-before-request_irq.patch
queue-5.10/scsi-target-core-pr-initialize-arrays-at-declaration-time.patch
queue-5.10/netfilter-nf_conntrack_sip-remove-net-variable-shadowing.patch
queue-5.10/smb-client-use-kvzalloc-for-megabyte-buffer-in-simple-fallocate.patch
queue-5.10/mtd-spi-nor-intel-remove-global-protection-flag.patch
queue-5.10/tipc-restrict-socket-queue-dumps-in-enqueue-tracepoints.patch
queue-5.10/rxrpc-fix-recv-recv-race-of-completed-call.patch
queue-5.10/mtd-maps-vmu-flash-fix-fault-in-unaligned-fixup.patch
queue-5.10/mtd-spi-nor-swp-improve-locking-user-experience.patch
queue-5.10/selinux-avoid-sk_socket-dereference-in-selinux_sctp_bind_connect.patch
queue-5.10/lsm-infrastructure-management-of-the-sock-security.patch
queue-5.10/audit-use-unsigned-int-instead-of-unsigned.patch
queue-5.10/media-mtk-vcodec-potential-null-pointer-deference-in.patch
queue-5.10/i2c-davinci-unregister-cpufreq-notifier-on-probe-failure.patch
queue-5.10/rxrpc-fix-socket-notification-race.patch
queue-5.10/i2c-imx-separate-atomic-dma-and-non-dma-use-case.patch
queue-5.10/netfilter-nft_set_pipapo-merge-deactivate-helper-into-caller.patch
queue-5.10/dm-integrity-don-t-increment-hash_offset-twice.patch
queue-5.10/vfs-audit-introduce-kern_path_parent-for-audit.patch
queue-5.10/audit-fix-recursive-locking-deadlock-in-audit_dupe_exe.patch
queue-5.10/thunderbolt-remove-xdomain-from-the-bus-without-holding-tb-lock.patch
queue-5.10/rxrpc-serialize-kernel-accept-preallocation-with-socket-teardown.patch
queue-5.10/rdma-rtrs-srv-bound-rdma-write-length-to-chunk-size-in-rdma_write_sg.patch
queue-5.10/9p-skip-nlink-update-in-cacheless-mode-to-fix-warn_on.patch
queue-5.10/dmaengine-dw-edma-add-spinlock-to-protect-done_int_mask-and-abort_int_mask.patch
queue-5.10/netfilter-nft_set_pipapo-use-gfp_kernel-for-insertions.patch
queue-5.10/mtd-spi-nor-fix-spi_nor_try_unlock_all.patch
queue-5.10/alsa-hda-fix-cached-processing-coefficient-verbs.patch
queue-5.10/dm-verity-make-error-counter-atomic.patch
queue-5.10/device-property-add-fwnode_irq_get_byname.patch
queue-5.10/jbd2-add-a-helper-to-find-out-number-of-fast-commit-blocks.patch
queue-5.10/i2c-imx-fix-locked-bus-on-smbus-block-read-of-0-atomic.patch
queue-5.10/wifi-libertas_tf-fix-use-after-free-in-lbtf_free_adapter.patch
queue-5.10/mlxsw-spectrum-apply-rif-configuration-when-joining-a-lag.patch
queue-5.10/netfilter-nft_set_pipapo-don-t-leak-bad-clone-into-future-transaction.patch
queue-5.10/mlxsw-spectrum-on-port-enslavement-to-a-lag-join-upper-s-bridges.patch
queue-5.10/scsi-lpfc-fix-memory-leak-in-lpfc_sli4_driver_resource_setup.patch
queue-5.10/netfilter-nf_conntrack_sip-validate-skb_dst-before-accessing-it.patch
queue-5.10/thunderbolt-keep-xdomain-reference-during-the-lifetime-of-a-service.patch
queue-5.10/asoc-mediatek-mt8183-check-runtime-resume-during-probe.patch
queue-5.10/octeontx2-vf-clear-stale-mailbox-irq-state-before-request_irq.patch
queue-5.10/input-ims-pcu-fix-race-condition-in-reset_device-sysfs-callback.patch
queue-5.10/net-thunderbolt-fix-frags-overflow-by-bounding-frame_count.patch
queue-5.10/netfilter-nft_set_pipapo-make-pipapo_clone-helper-return-null.patch
queue-5.10/mtd-spi-nor-sst-remove-global-protection-flag.patch
queue-5.10/tpm-tpm_tis_spi-use-wait_woken-in-wait_for_tmp_stat.patch
queue-5.10/pci-add-pci_find_vsec_capability-to-find-a-specific-vsec.patch
queue-5.10/serial-max310x-replace-bare-use-of-unsigned-with-unsigned-int-checkpatch.patch
queue-5.10/audit-widen-ino-fields-to-u64.patch
queue-5.10/lsm-use-default-hook-return-value-in-call_int_hook.patch
queue-5.10/bpf-reject-bpf_map_type_inode_storage-creation-if-bpf-lsm-is-uninitialized.patch
queue-5.10/ovl-use-linked-upper-dentry-in-copy-up-tmpfile.patch
queue-5.10/netfilter-nft_set_pipapo-prepare-pipapo_get-helper-for-on-demand-clone.patch
queue-5.10/netfilter-nft_set_pipapo-prepare-walk-function-for-on-demand-clone.patch
queue-5.10/taskstats-fill_stats_for_tgid-use-for_each_thread.patch
queue-5.10/thunderbolt-prevent-xdomain-delayed-work-use-after-free-on-disconnect.patch
queue-5.10/dmaengine-dw-edma-improve-the-linked-list-and-data-blocks-definition.patch
queue-5.10/dmaengine-dw-edma-remove-unused-irq-field-in-struct-dw_edma_chip.patch
queue-5.10/mtd-spi-nor-move-software-write-protection-logic-out-of-the-core.patch
queue-5.10/serial-max310x-implement-gpio_chip-get_direction.patch
queue-5.10/i2c-smbus-use-device_-functions-instead-of-of_.patch



More information about the linux-afs mailing list