mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
rxrpc: Fix uninitialised variable in rxrpc_send_data()
[ Upstream commit 7a310f8d7dfe2d92a1f31ddb5357bfdd97eed273 ]
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: b0f571ecd7
("rxrpc: Fix locking in rxrpc's sendmsg")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lists.infradead.org/pipermail/linux-afs/2024-October/008896.html
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Link: https://patch.msgid.link/20241001132702.3122709-3-dhowells@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
2daffbd861
commit
446be5505e
1 changed files with 5 additions and 5 deletions
|
@ -303,6 +303,11 @@ static int rxrpc_send_data(struct rxrpc_sock *rx,
|
||||||
sk_clear_bit(SOCKWQ_ASYNC_NOSPACE, sk);
|
sk_clear_bit(SOCKWQ_ASYNC_NOSPACE, sk);
|
||||||
|
|
||||||
reload:
|
reload:
|
||||||
|
txb = call->tx_pending;
|
||||||
|
call->tx_pending = NULL;
|
||||||
|
if (txb)
|
||||||
|
rxrpc_see_txbuf(txb, rxrpc_txbuf_see_send_more);
|
||||||
|
|
||||||
ret = -EPIPE;
|
ret = -EPIPE;
|
||||||
if (sk->sk_shutdown & SEND_SHUTDOWN)
|
if (sk->sk_shutdown & SEND_SHUTDOWN)
|
||||||
goto maybe_error;
|
goto maybe_error;
|
||||||
|
@ -329,11 +334,6 @@ reload:
|
||||||
goto maybe_error;
|
goto maybe_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
txb = call->tx_pending;
|
|
||||||
call->tx_pending = NULL;
|
|
||||||
if (txb)
|
|
||||||
rxrpc_see_txbuf(txb, rxrpc_txbuf_see_send_more);
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (!txb) {
|
if (!txb) {
|
||||||
size_t remain, bufsize, chunk, offset;
|
size_t remain, bufsize, chunk, offset;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue