From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 897CF4F7CBF; Wed, 30 Sep 2026 17:07:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790788056; cv=none; b=gwrqy5xdBih5mb00m4ibXToZB+7WVYNgW0H1YACAYydZBUbI9vyJqQ/nQTwMZNEbqA3flMvbrUNwOKxOKXfGB2Eq9r6BYT0s2Q5KFfctmLkykRMQJ4IHzC7QFoZn4UWK68CNvD837QZ1122zq0wU/H3/LyPpPlOuMCt+B3xIXCE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790788056; c=relaxed/simple; bh=AOoMY7Y5XMIQ4YvV/XKkEnOBnhwfPbwX3DOcclJRn/4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RYZzhtKJ6uCttErkl35sVuXW9BJMp+Zsuz0M1Pq/u9J34RsF1A2DsMfgClufyJzMI+onynC6ha3Zkey5/dxWjA76v5LYCm6t3lkWmFSJ8L2NF2JFepbwa3exnYYA5HuUJC89+DnDvwpEFS7anynO/gPCW0NA8qD67OgNFCCdrBE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jparjmQk; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="jparjmQk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B3CB51F000FF; Wed, 30 Sep 2026 17:07:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790788055; bh=wJwV+eVig+ka6reRxAl1gwOiW38UsBE/Ow2E2DteRBk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jparjmQkH+JlyNug5z+3sjCK3x2inZmGLP0xhS/c0doIlrMZu6+nMMxYAOmEI3DLk yWShgMcQqQbbJXdzV/5SJCqRwJOW5wHN7beKFxykj7P0GWLV1pdTYZ/apsOQhWi4+k l/KrkegM2ZxU23KQVxV/BqBw28THqhSBVFFRQquo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Aldo Ariel Panzardo , Luiz Augusto von Dentz Subject: [PATCH 7.2 403/457] Bluetooth: ISO: balance the parent hold in hci_bind_bis() Date: Wed, 30 Sep 2026 17:28:28 +0200 Message-ID: <20260930152354.690924073@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152346.024115587@linuxfoundation.org> References: <20260930152346.024115587@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Aldo Ariel Panzardo commit 4c94557dd02569efa6c1072a0439addaef9a5224 upstream. hci_conn_link() takes a lifetime reference to its parent with hci_conn_get(), but only takes an operational hold on the child. hci_conn_unlink() later balances both a hold and a reference on the parent. The SCO and CIS paths pass a parent acquired from a connect helper, so it already has a hold. For an additional BIS, hci_bind_bis() obtains the parent from hci_conn_hash_lookup_big(), which returns a bare pointer. Unlinking the child then drops the parent's existing hold and can schedule it for disconnection while its socket is still using it. Take a hold on the parent before linking it and drop that hold if linking fails. A successful link transfers the hold to hci_conn_unlink(). Fixes: fa224d0c094a ("Bluetooth: ISO: Reassociate a socket with an active BIS") Cc: stable@vger.kernel.org Signed-off-by: Aldo Ariel Panzardo Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Greg Kroah-Hartman --- net/bluetooth/hci_conn.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -2375,10 +2375,13 @@ struct hci_conn *hci_bind_bis(struct hci parent = hci_conn_hash_lookup_big(hdev, conn->iso_qos.bcast.big); if (parent && parent != conn) { + hci_conn_hold(parent); link = hci_conn_link(parent, conn); hci_conn_drop(conn); - if (!link) + if (!link) { + hci_conn_drop(parent); return ERR_PTR(-ENOLINK); + } } return conn;