Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1547076rda; Mon, 23 Oct 2023 16:38:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHzr8Gm3lb9g4OFfo8Llbbm1QeZfqsagS7M4vOUSxX7cngQ9+rgsPfna4UjHrinQvI1HDat X-Received: by 2002:a17:90b:4b02:b0:27d:5964:4ee6 with SMTP id lx2-20020a17090b4b0200b0027d59644ee6mr10118888pjb.2.1698104331722; Mon, 23 Oct 2023 16:38:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698104331; cv=none; d=google.com; s=arc-20160816; b=uhadjBshGOPm8G/6JqMTHhVEOoaa/mltW2FUrr9ud/F6j4tcJoI9DQZtO/O4AJNC9M CKmtLgcMfQ2llcQQS0KC5NuVt2efXy4nW/seRTygAdhKFq/o7rQphdPvZiQUDqx+JJaj Mw9BQHpEqDLKWQCZYQ+dTBq2XLOq1OFwoVDHtpJ7AGx061vowyjdwvPmiQ/+W+LnDX1a KRm3DtdoEauBXlGLCKphv3R/4WFpf5CZ/p8J5XvYw1tmBTHGgvg23wxAebiC6Gsr0vtS nEYTZb+cw0zRiO1qXufgnH36VwA+QoVkfYU47VnalclY+Gh4Nps/eLv04J0MAPGTCwBl T5AQ== ARC-Message-Signature: i=1; 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:to:from:dkim-signature; bh=Ndh89zcQFgKzWc/18mb7lQWoCl948jtv7vQuR09UCMU=; fh=4lGQI6056MBa4/oovMyIYaKLn+Wz/24RGvUivMmQP8E=; b=t06cjrizZIYtn+8j1W/sWUXJcqgJ2qO1XQAnnhs7FgcqmMJVVLGlbdQ49V/UDss8qQ hW8msMXKHAiKpHJ5KkHOiwpqJ0QiFM9Z/AitA4Z9ddTMjHqoytZ9Q3TWAqvO/PmA3COl KcPYbq7SdjqICly7KyTCtOva7Q4oCKrpIJG5fd3wiDsN0q/s0XB4ALQydiCKAB7L6eN8 7opZ0GiTf27CX1YUNut1+C6jXMhHJ04guVknghEz/wqah0tR4YB1knQyu67gbhB1qlJ9 Pwe60Obn3xMWC6chIaTuUW/pyxt9J2Ailx1Q35JZwzMf/07QMInHTkU58/lah0FUbmtN x9rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eNvpmHzd; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id nv16-20020a17090b1b5000b002741e78e66asi9999875pjb.153.2023.10.23.16.38.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 16:38:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eNvpmHzd; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id CFA548065EE2; Mon, 23 Oct 2023 16:38:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231336AbjJWXiq (ORCPT + 99 others); Mon, 23 Oct 2023 19:38:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbjJWXip (ORCPT ); Mon, 23 Oct 2023 19:38:45 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37B2FDE for ; Mon, 23 Oct 2023 16:38:43 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-6bd32d1a040so3861871b3a.3 for ; Mon, 23 Oct 2023 16:38:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698104321; x=1698709121; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=Ndh89zcQFgKzWc/18mb7lQWoCl948jtv7vQuR09UCMU=; b=eNvpmHzdKoHCvkorUSOIV5gopjACMTytam0Ja/j33Op5XilGH6M/vVbqK8mmbVwZvW ZSlgvqaozjRLC5RTwPXow4lFmQSuODHRd2rRazaZlUcDcPsfBEr7T3pXxyUi4tWByiK5 HVSL9p48il2JVLsJgqINYrN8ksi4u7CmvTq7LhfcJXdwyomiT+nWQLFdz2VD6zMA+h5O HWgdemPDJjGyhyOjc/VVPDTQvUrZ9y2U2zSwWxuAM0NqYVhOXpNZdEkQoD52jUyqmfAT SBi6oRC5286UT/tl97w+TY9dJppiUeQV2rtkvCHsRL+KA3SUZ+EbV/Q0oOPdLuXb8qCq t0Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698104321; x=1698709121; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ndh89zcQFgKzWc/18mb7lQWoCl948jtv7vQuR09UCMU=; b=tOqL5uiYCHPd6xaXWPDlqvnzqJTmw0WWHVJo15PFfC9xfSpEotNkZ6LxmlnE6t6vFv XWmt/yWzR05fwk50alf9Etjl6Jm91SzaJSmUNkBnuzHTapIfoERWY5tLqoQE68UFUO42 7Up5UeE1y71THE5f9IfDkPjVnr/IcsZqkVKimoGdtOdewAVA5vYmVCpec7/WtD3F3aK3 P24TFonA+DXi1C0cW3xduPOfvPtdnVTS+78o9PdPMJGGNMqFCJ9FF8UXYPL9VfXVxxEa VmZ6ESv7MVcoEQTYbznMEF3xlu6BsMrYtdtzr7i82StXwwXbGtTrMnzQA/d3pNEAUAxX hA3Q== X-Gm-Message-State: AOJu0YxkScggtf8KPV/eBvQJ49ii0SXMfM15hUlIs8DS/umpiFa+2sug Hbfp1j72Yt1JEDS1d03374Rj+XlGjboNfXtn9EQ= X-Received: by 2002:a05:6a20:da88:b0:17e:2afd:407f with SMTP id iy8-20020a056a20da8800b0017e2afd407fmr1478947pzb.9.1698104321512; Mon, 23 Oct 2023 16:38:41 -0700 (PDT) Received: from lvondent-mobl4.. (c-98-232-221-87.hsd1.or.comcast.net. [98.232.221.87]) by smtp.gmail.com with ESMTPSA id x4-20020a170902ea8400b001ca222edc16sm6441316plb.135.2023.10.23.16.38.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 16:38:40 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH v1] Bluetooth: Fix not notifying when connection encryption changes Date: Mon, 23 Oct 2023 16:38:39 -0700 Message-ID: <20231023233839.3700728-1-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 23 Oct 2023 16:38:47 -0700 (PDT) From: Luiz Augusto von Dentz Some layer such as SMP depend on getting notified about encryption changes immediately as they only allow certain PDU to be transmitted over an encrypted link which may cause SMP implementation to reject valid PDUs received thus causing pairing to fail when it shouldn't. Fixes: 7aca0ac4792e ("Bluetooth: Wait for HCI_OP_WRITE_AUTH_PAYLOAD_TO to complete") Signed-off-by: Luiz Augusto von Dentz --- net/bluetooth/hci_event.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 0849e0dafa95..5b6fd625fc09 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -820,8 +820,6 @@ static u8 hci_cc_write_auth_payload_timeout(struct hci_dev *hdev, void *data, if (!rp->status) conn->auth_payload_timeout = get_unaligned_le16(sent + 2); - hci_encrypt_cfm(conn, 0); - unlock: hci_dev_unlock(hdev); @@ -3683,12 +3681,8 @@ static void hci_encrypt_change_evt(struct hci_dev *hdev, void *data, cp.handle = cpu_to_le16(conn->handle); cp.timeout = cpu_to_le16(hdev->auth_payload_timeout); if (hci_send_cmd(conn->hdev, HCI_OP_WRITE_AUTH_PAYLOAD_TO, - sizeof(cp), &cp)) { + sizeof(cp), &cp)) bt_dev_err(hdev, "write auth payload timeout failed"); - goto notify; - } - - goto unlock; } notify: -- 2.41.0