Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1247523rwd; Thu, 8 Jun 2023 14:54:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6R61fqCmFhS4TdcZ4qVz0qqkxYm5KrgJ6swKvFrFGP1n++ZFXszaSstQxy1jfyK1qo8Hru X-Received: by 2002:a05:6a21:2d84:b0:114:ec7e:a60a with SMTP id ty4-20020a056a212d8400b00114ec7ea60amr7488582pzb.38.1686261276524; Thu, 08 Jun 2023 14:54:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686261276; cv=pass; d=google.com; s=arc-20160816; b=HjUjvm3sdLiG62ZlOp0onWLLc8/A6Gh1HX+acL92CRQAg3SS9O5Bh3TVRXbRbsvSTs IKnHHXERc/ku7lUYx4t8wBntjDqoJ6N9uzNKqc+Pwd27Ch8J367s8yBLT/+bkL66iN4s h40GCGX6pSjpRmENhSuBTmD9YXzQt969zrhzoRT0lSnuSJAU4yy8UrnkPxyFNeedeLKV lgUUbN+S0NdV8MB2K3STmqWlLnv8hqV87LwlCDh+USBZ+OKJgdB63ALWz6By8M5uiijm /ozxbYswOCDQcZnkNWefgVrxfvReO9at6BlxDyyQv4QbBg6d3wus0oV/dO4/e0YcJhwH 8mWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=EGxDCnVTGU8lZ/QjJFg6Onc5fauiPo+ZrNSEJsW593A=; b=zcqKGZnmFqw8XWbzSxFARaOae0S+hqWTYt/6v/74fQqlytLoOzAvfQL03e+0I1Kuwd fk2f3USZhkYfPMnIcCfWvzsk+n02RjAp4pR1C8b/XPSz4aTbE2r8TmMPl8uPLlKoHN6J AnkTBy2/l6I6dmh4iLJXz+RpYREjA6i4+5j0eUq/RYVXzXARonHM0iZBZE5A/pIlxHCc hLD6HpaoYFZIv5pUV2rexWs43fNu7RCqKa1HRS5bp1TrVBeJH3bRDAZ4CRhR/9hWWnyD wFB6va8wYP3OcFULQLjVHkSdbqf+FfgXu1RlA2ZaXGE0AFaLrdKz8YZQwLS++N7AjI41 lABw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@iki.fi header.s=meesny header.b=bu8m+52d; arc=pass (i=1); spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv127-20020a632e85000000b005481915c0c3si1264814pgb.34.2023.06.08.14.54.23; Thu, 08 Jun 2023 14:54:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@iki.fi header.s=meesny header.b=bu8m+52d; arc=pass (i=1); spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236934AbjFHVGv (ORCPT + 99 others); Thu, 8 Jun 2023 17:06:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236972AbjFHVGu (ORCPT ); Thu, 8 Jun 2023 17:06:50 -0400 Received: from meesny.iki.fi (meesny.iki.fi [195.140.195.201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4D482D42 for ; Thu, 8 Jun 2023 14:06:49 -0700 (PDT) Received: from monolith.lan (91-152-120-101.elisa-laajakaista.fi [91.152.120.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pav) by meesny.iki.fi (Postfix) with ESMTPSA id 4QccGH3WCZzyW9; Fri, 9 Jun 2023 00:06:47 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1686258407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=EGxDCnVTGU8lZ/QjJFg6Onc5fauiPo+ZrNSEJsW593A=; b=bu8m+52doo3suhpUFckKVOnT558/ih/QXcXBz+7c1SY/HR9YWWVYEOH492buckbxzP15uY GcMEvGcrI9H/BsmSHnrTXjd37+fLbj5WPepBibaOo+Gwc5+ghqj1t1cZaQW7PsRwtPYk/U q4ktv1W1tILbqXWgBBSqNGKnLy/qmPk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1686258407; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=EGxDCnVTGU8lZ/QjJFg6Onc5fauiPo+ZrNSEJsW593A=; b=lQeXCfSGrGKlPI73UUSUQEaf20QZy1tZCJAi4NxJ6WP1FLYo3n8cagOyR6uWp9SC7YuzWn z6+sssAM4m6CTSDTH+rhk9kbf7G+GiKu3IsoMpjZLR2crMn3v9gh2u1ssLepPHKTmSZXMB usD9wSlx0z+zRvvE5IlYgEyR9SJZLfI= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=pav smtp.mailfrom=pav@iki.fi ARC-Seal: i=1; s=meesny; d=iki.fi; t=1686258407; a=rsa-sha256; cv=none; b=XkMttbhb1BgXDVClmqP6CmnqH/ryX6nSUwcEPgn5TiWY0pQ8bkx0GEF7F5nbHbpw6mgyDs c+mgURNowFHTIB4EjXop4C//6g8KTUgFcgB7XzCaGTLnMXWFvjwDCRfwr7X6tEPHF00TDy /rqjYmnFWf9w3r8eepf2oxbEo+mQiQM= From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH 0/3] Bluetooth: ISO-related concurrency fixes Date: Fri, 9 Jun 2023 00:06:41 +0300 Message-Id: X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This series addresses some concurrency issues (NULL / GPF) in ISO sockets or related. These were found while testing patches that make hci_le_set_cig_params check the validity of the configuration and return false if incorrect. This causes dropping of hci_conn just created, which apparently makes hitting race conditions easier. The test setup was primitive while true; do bluetoothctl power on; sleep 12; bluetoothctl power off; sleep 1.5; bluetoothctl power off; sleep 2.5; done; while true; do sudo systemctl restart bluetooth; sleep 110; done while true; do systemctl --user restart pipewire wireplumber pipewire-pulse; sleep 91; done while true; do paplay sample.flac & sleep 2; kill %1; sleep 0.7; done and equivalent operations manually, on VM + connect to TWS earbuds. This eventually hit the NULL / GFP errors here, but they are hard to reproduce aside from the first one that appears in iso-tester. This also produces a few other types of crashes / KASAN errors, but not addressed here. Pauli Virtanen (3): Bluetooth: hci_sync: iterate over hci_conn_params safely Bluetooth: hci_event: call ISO disconnect callback before deleting conn Bluetooth: ISO: fix iso_conn related locking and validity issues include/net/bluetooth/hci_core.h | 1 + net/bluetooth/hci_event.c | 6 +++ net/bluetooth/hci_sync.c | 81 ++++++++++++++++++++++++++++---- net/bluetooth/iso.c | 53 ++++++++++++--------- 4 files changed, 111 insertions(+), 30 deletions(-) -- 2.40.1