Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp685052ybg; Wed, 3 Jun 2020 10:50:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzk4KPwNsC+HgOMQ+KHg0ZAwEcYPu/Yv/QXSAXc75EWBE7MlitEyXC+hDzSKN+YzOUKs9f4 X-Received: by 2002:a17:906:cc85:: with SMTP id oq5mr426161ejb.142.1591206659619; Wed, 03 Jun 2020 10:50:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591206659; cv=none; d=google.com; s=arc-20160816; b=uqyL9oSpCPw13Gp6h1mylSTQ5pYhUi2gNvkI/Y1y8L4ru9Ca37qpn8llfVdWkoVtgu X5nuTslzA2mX/op+QwiFyDShb36QEKTX4cwJF9M7veIpg8hE3vgG2Put8QMr/uhwpet+ aDtaNLObWN5a7JjoIiCyA2uvuRE7ignFmcvLxqeLjTCGmiEJ6MeDxhaEIE3uEHBkh0OT hzI8YKvKqQMXYcDfrGiunaV8XPHdd14dZ1KfiI9d3yBg2GWQl92lsZHo+I7ElRBQnGqs UqK5rc3dIJyEGiCcvK6N4XG0rqiZMlDUjJgWMkbGvduWZBfhty/eIz8USuh4NysCvTiV BasQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=4xHJzClumpyTZ0Q1cNJotKZYkI76mPN0Gv1L4OFutec=; b=fdcWZiUGyhYnaru/ssPFh5hCvu8OG5PC8RJmzrmw8LtD9pyvPSyXpb9e/Z/K5OYKAy fUkYRUJnyhjXABQTOvmkdvbTm/ivu8bZ3Y2fBzhdA/Xycu6JTRKucZgzYo5b5ptPpm1J nlzujRleFV5ozbq4/b92L6ZRwtVL66luElKLSVwnfWuO7KxnhF65flPdnV9qQwJhSfcm qFk19w0updUecnmhng4WXcuqM3doiTKtVhVo0LfQyMnDRF+2hiUanizH+S1GVB66Av0A IeMd1OajeRfqPQg5CxzGSGSgv/d2Zbw+hpyqbHbP9OQscHW74oUqc0oNNmOtkagXlohQ lHGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu16si150101edb.146.2020.06.03.10.50.33; Wed, 03 Jun 2020 10:50:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726061AbgFCRu3 convert rfc822-to-8bit (ORCPT + 99 others); Wed, 3 Jun 2020 13:50:29 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:47845 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725601AbgFCRu3 (ORCPT ); Wed, 3 Jun 2020 13:50:29 -0400 Received: from marcel-macbook.fritz.box (p5b3d2638.dip0.t-ipconnect.de [91.61.38.56]) by mail.holtmann.org (Postfix) with ESMTPSA id 09C1DCED2F; Wed, 3 Jun 2020 20:00:15 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: [PATCH] Bluetooth: Terminate the link if pairing is cancelled From: Marcel Holtmann In-Reply-To: Date: Wed, 3 Jun 2020 19:50:26 +0200 Cc: Luiz Augusto von Dentz , linux-bluetooth , ChromeOS Bluetooth Upstreaming , Alain Michaud , "David S. Miller" , Johan Hedberg , netdev , LKML , Jakub Kicinski Content-Transfer-Encoding: 8BIT Message-Id: <61400662-2434-4D7F-B9D1-19CC698645DC@holtmann.org> References: <20200414115512.1.I9dd050ead919f2cc3ef83d4e866de537c7799cf3@changeid> <96B8EB2A-BDFB-49F5-B168-F8FD2991FC33@holtmann.org> To: Manish Mandlik X-Mailer: Apple Mail (2.3608.80.23.2.2) Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Manish, > Based on your feedback, in the BlueZ kernel, if we plan to track whether the link was created because of Pair Device action or not, we'll need to add a flag in struch hci_conn and update related functions/APIs. I was wondering if this would look like a clean fix or not. > > Another option could be disconnecting from BlueZ daemon while handling 'cancel pairing' user request. But the problem with this approach is that there is no way to request the kernel to send SMP failure PDU with the existing implementation. > > Third option could be handling this in the chromium and requesting a disconnect when the user hits the cancel button. I believe Ubuntu/Android are taking a similar approach. However, on Android, if the 'cancel' button is selected on the pairing window, it shows 'pairing failed because of invalid passkey' message. > > Bluetooth specification doesn't have any mention about how to handle the pairing cancel case. Based on the statistics we have for ChromeOS, over 60% pairing attempts are cancelled by users. Since the link is not terminated, the bluetooth keyboard keeps on requesting to enter a new passkey even if the user selects to cancel the pairing and there is no way to cancel the pairing process. > > Can you please help me select the better approach to handle the pairing cancel case? Should we need to propose this to be addressed in the Bluetooth Specification as well? are we sending Cancel Pairing correctly? If so and we only care about the cancel case, then I would just track if the connection was triggered by a pairing and then only cancel pairing terminate the connection. Regards Marcel