Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 446be55

Browse files
dhowellsgregkh
authored andcommitted
rxrpc: Fix uninitialised variable in rxrpc_send_data()
[ Upstream commit 7a310f8 ] Fix the uninitialised txb variable in rxrpc_send_data() by moving the code that loads it above all the jumps to maybe_error, txb being stored back into call->tx_pending right before the normal return. Fixes: b0f571e ("rxrpc: Fix locking in rxrpc's sendmsg") Reported-by: Dan Carpenter <[email protected]> Closes: https://lists.infradead.org/pipermail/linux-afs/2024-October/008896.html Signed-off-by: David Howells <[email protected]> cc: Marc Dionne <[email protected]> cc: [email protected] Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 2daffbd commit 446be55

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

net/rxrpc/sendmsg.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,11 @@ static int rxrpc_send_data(struct rxrpc_sock *rx,
303303
sk_clear_bit(SOCKWQ_ASYNC_NOSPACE, sk);
304304

305305
reload:
306+
txb = call->tx_pending;
307+
call->tx_pending = NULL;
308+
if (txb)
309+
rxrpc_see_txbuf(txb, rxrpc_txbuf_see_send_more);
310+
306311
ret = -EPIPE;
307312
if (sk->sk_shutdown & SEND_SHUTDOWN)
308313
goto maybe_error;
@@ -329,11 +334,6 @@ static int rxrpc_send_data(struct rxrpc_sock *rx,
329334
goto maybe_error;
330335
}
331336

332-
txb = call->tx_pending;
333-
call->tx_pending = NULL;
334-
if (txb)
335-
rxrpc_see_txbuf(txb, rxrpc_txbuf_see_send_more);
336-
337337
do {
338338
if (!txb) {
339339
size_t remain, bufsize, chunk, offset;

0 commit comments

Comments
 (0)