Skip to content

Commit 86eff31

Browse files
dhowellsgregkh
authored andcommitted
rxrpc: Fix leak of released call in recvmsg(MSG_PEEK)
commit 4bdb9e4 upstream. Fix rxrpc_recvmsg() to also drop the ref it holds on an already-released call if MSG_PEEK is in force (the function holds a ref on the call irrespective of whether MSG_PEEK is specified or not). Fixes: 962fb1f ("rxrpc: Fix recv-recv race of completed call") Link: https://sashiko.dev/#/patchset/20260616155749.2125907-1-dhowells%40redhat.com Signed-off-by: David Howells <dhowells@redhat.com> cc: Marc Dionne <marc.dionne@auristor.com> cc: Jeffrey Altman <jaltman@auristor.com> cc: Simon Horman <horms@kernel.org> cc: linux-afs@lists.infradead.org cc: stable@kernel.org Link: https://patch.msgid.link/20260624163819.3017002-11-dhowells@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 8bbede0 commit 86eff31

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

net/rxrpc/recvmsg.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,7 @@ int rxrpc_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
429429
if (test_bit(RXRPC_CALL_RELEASED, &call->flags)) {
430430
rxrpc_see_call(call, rxrpc_call_see_already_released);
431431
mutex_unlock(&call->user_mutex);
432-
if (!(flags & MSG_PEEK))
433-
rxrpc_put_call(call, rxrpc_call_put_recvmsg);
432+
rxrpc_put_call(call, rxrpc_call_put_recvmsg);
434433
goto try_again;
435434
}
436435

0 commit comments

Comments
 (0)