Skip to content

Commit 880a88f

Browse files
dhowellskuba-moo
authored andcommitted
rxrpc: Fix oops due to non-existence of prealloc backlog struct
If an AF_RXRPC service socket is opened and bound, but calls are preallocated, then rxrpc_alloc_incoming_call() will oops because the rxrpc_backlog struct doesn't get allocated until the first preallocation is made. Fix this by returning NULL from rxrpc_alloc_incoming_call() if there is no backlog struct. This will cause the incoming call to be aborted. Reported-by: Junvyyang, Tencent Zhuque Lab <zhuque@tencent.com> Suggested-by: Junvyyang, Tencent Zhuque Lab <zhuque@tencent.com> Signed-off-by: David Howells <dhowells@redhat.com> cc: LePremierHomme <kwqcheii@proton.me> cc: Marc Dionne <marc.dionne@auristor.com> cc: Willy Tarreau <w@1wt.eu> cc: Simon Horman <horms@kernel.org> cc: linux-afs@lists.infradead.org Link: https://patch.msgid.link/20250708211506.2699012-3-dhowells@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 69e4186 commit 880a88f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/rxrpc/call_accept.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,9 @@ static struct rxrpc_call *rxrpc_alloc_incoming_call(struct rxrpc_sock *rx,
255255
unsigned short call_tail, conn_tail, peer_tail;
256256
unsigned short call_count, conn_count;
257257

258+
if (!b)
259+
return NULL;
260+
258261
/* #calls >= #conns >= #peers must hold true. */
259262
call_head = smp_load_acquire(&b->call_backlog_head);
260263
call_tail = b->call_backlog_tail;

0 commit comments

Comments
 (0)