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 <[email protected]> Suggested-by: Junvyyang, Tencent Zhuque Lab <[email protected]> Signed-off-by: David Howells <[email protected]> cc: LePremierHomme <[email protected]> cc: Marc Dionne <[email protected]> cc: Willy Tarreau <[email protected]> cc: Simon Horman <[email protected]> cc: [email protected] Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
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)