diff options
| author | David Howells <[email protected]> | 2025-07-08 21:15:03 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2025-07-10 02:41:44 +0000 |
| commit | 69e4186773c6445b258fb45b6e1df18df831ec45 (patch) | |
| tree | d4b516821758f3b1049078bab4a72a44f8d56ffe /net/unix/af_unix.c | |
| parent | MAINTAINERS: remove myself as netronome maintainer (diff) | |
| download | kernel-69e4186773c6445b258fb45b6e1df18df831ec45.tar.gz kernel-69e4186773c6445b258fb45b6e1df18df831ec45.zip | |
rxrpc: Fix bug due to prealloc collision
When userspace is using AF_RXRPC to provide a server, it has to preallocate
incoming calls and assign to them call IDs that will be used to thread
related recvmsg() and sendmsg() together. The preallocated call IDs will
automatically be attached to calls as they come in until the pool is empty.
To the kernel, the call IDs are just arbitrary numbers, but userspace can
use the call ID to hold a pointer to prepared structs. In any case, the
user isn't permitted to create two calls with the same call ID (call IDs
become available again when the call ends) and EBADSLT should result from
sendmsg() if an attempt is made to preallocate a call with an in-use call
ID.
However, the cleanup in the error handling will trigger both assertions in
rxrpc_cleanup_call() because the call isn't marked complete and isn't
marked as having been released.
Fix this by setting the call state in rxrpc_service_prealloc_one() and then
marking it as being released before calling the cleanup function.
Fixes: 00e907127e6f ("rxrpc: Preallocate peers, conns and calls for incoming service requests")
Reported-by: Junvyyang, Tencent Zhuque Lab <[email protected]>
Signed-off-by: David Howells <[email protected]>
cc: LePremierHomme <[email protected]>
cc: Marc Dionne <[email protected]>
cc: Simon Horman <[email protected]>
cc: [email protected]
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions
