Skip to content

Commit f3af4ad

Browse files
committed
rxrpc: Fix bundle counting for exclusive connections
Fix rxrpc_unbundle_conn() to not drop the bundle usage count when cleaning up an exclusive connection. Based on the suggested fix from Hillf Danton. Fixes: 245500d ("rxrpc: Rewrite the client connection manager") Reported-by: syzbot+d57aaf84dd8a550e6d91@syzkaller.appspotmail.com Signed-off-by: David Howells <dhowells@redhat.com> cc: Hillf Danton <hdanton@sina.com>
1 parent d25e2e9 commit f3af4ad

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

net/rxrpc/conn_client.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ static void rxrpc_unbundle_conn(struct rxrpc_connection *conn)
901901
struct rxrpc_bundle *bundle = conn->bundle;
902902
struct rxrpc_local *local = bundle->params.local;
903903
unsigned int bindex;
904-
bool need_drop = false;
904+
bool need_drop = false, need_put = false;
905905
int i;
906906

907907
_enter("C=%x", conn->debug_id);
@@ -928,10 +928,11 @@ static void rxrpc_unbundle_conn(struct rxrpc_connection *conn)
928928
if (i == ARRAY_SIZE(bundle->conns) && !bundle->params.exclusive) {
929929
_debug("erase bundle");
930930
rb_erase(&bundle->local_node, &local->client_bundles);
931+
need_put = true;
931932
}
932933

933934
spin_unlock(&local->client_bundles_lock);
934-
if (i == ARRAY_SIZE(bundle->conns))
935+
if (need_put)
935936
rxrpc_put_bundle(bundle);
936937
}
937938

0 commit comments

Comments
 (0)