Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp285027rdb; Mon, 22 Jan 2024 04:18:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IFKNMNtUoVinv2nDT39lb2zUgnmPPLjdZ5EkZnD957vqZQrrbB9y2CzMyzWvqk7/IphEZeV X-Received: by 2002:a05:6214:2a4c:b0:680:c80b:7acf with SMTP id jf12-20020a0562142a4c00b00680c80b7acfmr5795614qvb.86.1705925900117; Mon, 22 Jan 2024 04:18:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705925900; cv=pass; d=google.com; s=arc-20160816; b=pLpn6rSVyVaXVQRJm1kZc6xqCRV2Cekpf2+9u9RWJf3tbz7jBgoP430E+HcYaiThFu LzaYYbON6CrnMx/v7/ZzSQilvoHz7iD0OAuglb4MFtWvXacevaDg/nTrvh+D8L0zkX4R Azri2O8oMXoQbsNoXJu183GFqZpDSsc8LuDfnoCF49S5+6ez0gAgRw4s84k6lrEupoo9 9DxdYUoik6HW5lBLnsKV7/hIyxJ/v6m+yynTFW1obHhhfAaQlqs7lPLRB7DN95Q1W13O WZjvqUKIzLMcmCyeeaPwYqBPScq1mvFExtKoHuregUy22z3Xq3mlQW2Pe4GUyQgo3ZYd jEwA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:organization:content-language:to:subject :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:from:dkim-signature; bh=IPXkskolG/PayeuRoN9pTvBCCUGNL6vsW3GPZSp74VQ=; fh=4lGQI6056MBa4/oovMyIYaKLn+Wz/24RGvUivMmQP8E=; b=MjGrIuSOZvRCvwh57tqsEPANg2QAOU/QntVJgYjTjTnwOqfqE3rRMUfD1642uJBmoH UkNhhwY8HFAKB5a6s8eCadjb+leTc7aWU5yHafQYtV4dXLOUIawwzZf7SFxxsivWvgWQ SQtpuAbtoxir0eQ4AUOGW+FIwW5kpxY9VToqoCLfGvpEuv9wSXRiV7qnpChE6/+F/6ft 24VYsJrXB9WkwZfAaKpMYD5tzltit6NkckpnDLJjgyY3BHrPoKxCfrRkxB+OUeq6pvzn NTV6OwiyiMzkCv9qGpfoVrtHUNKUvWWS2hf9+ooBkw9NIDGxTVGzng6ONWvEZ6Wn8dG6 //tQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mobile-devices.fr header.s=google header.b=jtaBdC5+; arc=pass (i=1 spf=pass spfdomain=mobile-devices.fr dkim=pass dkdomain=mobile-devices.fr); spf=pass (google.com: domain of linux-bluetooth+bounces-1218-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1218-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id dw12-20020a0562140a0c00b0068577dea6dfsi5037805qvb.537.2024.01.22.04.18.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 04:18:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-1218-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@mobile-devices.fr header.s=google header.b=jtaBdC5+; arc=pass (i=1 spf=pass spfdomain=mobile-devices.fr dkim=pass dkdomain=mobile-devices.fr); spf=pass (google.com: domain of linux-bluetooth+bounces-1218-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1218-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id DCE5D1C22923 for ; Mon, 22 Jan 2024 12:18:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8A98E3B780; Mon, 22 Jan 2024 12:18:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mobile-devices.fr header.i=@mobile-devices.fr header.b="jtaBdC5+" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 878163B290 for ; Mon, 22 Jan 2024 12:18:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705925893; cv=none; b=n4IVc1krV6oWJxFWMl0F2s0nPI9Ut97FqGBuckodpeTx6SNRP7HQSWO6/NtTTM6XThQelmfVS6ri5cRAJK1D78GedzmHDAyCu0yZ1yor+Smm5P37blHx5cotmQXzbt7VMwDwuUf+PI1DmMuMmy6VHxn5Orno/SCkeMo/5kKHtiU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705925893; c=relaxed/simple; bh=QTVIrXa/wNjcS5+ppP3vBMuA/0WXUE7/yQd0xY3ae8E=; h=From:Message-ID:Date:MIME-Version:Subject:To:Content-Type; b=aMHYOpfHXPrLo3jdx7j2AYB+PuoDfKzc7DHEg6COIpwAboRxWDmHXvM0g6lvdX+yIQjX8SAVQBCzvFRVPSfUfL5yRXe+oaUQN5WUjp3mhClaB3t8FwXYWdWj55dqBT3Vmj6gMHBmer6t53sTP8rHxudXVtQipKdBmYtFx38tFck= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mobile-devices.fr; spf=pass smtp.mailfrom=mobile-devices.fr; dkim=pass (1024-bit key) header.d=mobile-devices.fr header.i=@mobile-devices.fr header.b=jtaBdC5+; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mobile-devices.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mobile-devices.fr Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-40e880121efso34472365e9.3 for ; Mon, 22 Jan 2024 04:18:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mobile-devices.fr; s=google; t=1705925887; x=1706530687; darn=vger.kernel.org; h=content-transfer-encoding:organization:content-language:to:subject :user-agent:mime-version:date:message-id:from:from:to:cc:subject :date:message-id:reply-to; bh=IPXkskolG/PayeuRoN9pTvBCCUGNL6vsW3GPZSp74VQ=; b=jtaBdC5+Q2bVbxhRdVFNz6aLa8qLXPdeIot2f7mSpHKGmhq+FHmqi4P4E7YjJDQALu b+w+CZEq8UBPI/TDqDJWpzxLb3FkZ+fN9KgD3U+hCN9bLriw6nKcD80Tnr0niwGTzEOY fdd8AMFEqcm73X3xAc938xPNviet7aVbFMgXQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705925887; x=1706530687; h=content-transfer-encoding:organization:content-language:to:subject :user-agent:mime-version:date:message-id:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=IPXkskolG/PayeuRoN9pTvBCCUGNL6vsW3GPZSp74VQ=; b=r9r8JMdflI01JGBdaOUJF6f76k+7Jq5Jvrtl85hM/HlLQ9PoyTPPNqBM7NYM9TSh3D LJE0NH5KU/Vv/xbuYtrYZ3tzAlnZSYAUfxSPFKDft9/2LEwAbXzDlgV1/KdpIGA13VQn cLpSrqCVswefn22oLJuUz8iz2iwtU2awjP2ubi8vGHMALFb55yh1/dVsSmVoUKcvqVny nZyl/A/Fqbzgtam2gQALECoNIzWzgHr+kumhPePTtDB854+1FrOuScFhoDu6AkvZdtCW jIi6zBPrTmrUWmnLhstoHGDcbOGhfqu78M8uisvyQbOIgtQCmLndh3Iu6tMYmOZSLySa +Myw== X-Gm-Message-State: AOJu0YyiPNHsuVXON17zBSiFx4YX7zxN12jjOx4B8blqONbpjSNsZV1+ zkQOmSEpREIoMpbGrsmObyJDrp9nwEIZuADgPcUWW5E2dQH9+XqFemh/fOh4MU5fV0/kkScxzK8 Y6hKY/3nlBMPGmN78na1WUfyNIDCPSIdOY0xYGphjYJL8J9CAxkHwYd8CGTWdeWFt8KaIOvKWA2 OJisxyWfnQwm0VnleM8wohQGs67f/Txq+2QEUuc8ZDUOZWWdCGFmls0UpzvDjk0RQ= X-Received: by 2002:a05:600c:2349:b0:40e:5f64:934a with SMTP id 9-20020a05600c234900b0040e5f64934amr2365052wmq.165.1705925887054; Mon, 22 Jan 2024 04:18:07 -0800 (PST) Received: from [10.42.100.11] (static-qvn-qvs-183113.business.bouyguestelecom.com. [89.87.183.113]) by smtp.gmail.com with ESMTPSA id j14-20020a5d604e000000b003392cdeb3a2sm4675756wrt.103.2024.01.22.04.18.06 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 22 Jan 2024 04:18:06 -0800 (PST) From: Andrei Volkov X-Google-Original-From: Andrei Volkov Message-ID: Date: Mon, 22 Jan 2024 13:18:06 +0100 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: regression in c7f59461f5a78: Bluetooth: Fix a refcnt underflow problem for hci_conn To: linux-bluetooth@vger.kernel.org Content-Language: en-US, fr Organization: MUNIC Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hello, Lately we've bumped with regression introduced by commit:  c7f59461f5a78 ("Bluetooth: Fix a refcnt underflow problem for hci_conn", 2023-10-04) The regression related with adding "hci_conn_ssp_enabled()" check in "hci_io_capa_request_evt()" handler, and broke pairing process initiated by the external device. Precisely, some ext. devices, like any phone equipped with Android ver < 14 (we have not latest one, so we didn't check), always send "IO Capability Request" before "Read Remote Extended Features" command, as consequence the flag "HCI_CONN_SSP_ENABLED" not yet activated at the time of "hci_io_capa_request_evt()" execution  and "hci_conn_ssp_enabled()" always returns false in time of the pairing. As a result, pairing always fails. The quick and dirty fix is revert the ssp check introduced in the subj. commit, like below: --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -5329,7 +5329,7 @@ static void hci_io_capa_request_evt(struct hci_dev *hdev, void *data,         hci_dev_lock(hdev);         conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr); -       if (!conn || !hci_conn_ssp_enabled(conn)) +       if (!conn)                 goto unlock;         hci_conn_hold(conn); However, a more thorough and correct fix requires discussion and testing. Therefore, I would like to get any comments/suggestion from the community before doing this. Regards Andrey VOLKOV