Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3566135ybb; Mon, 6 Apr 2020 11:08:51 -0700 (PDT) X-Google-Smtp-Source: APiQypLxKQCHvLDYgVCV714SWVI1sqIha05n/ba/TI0jY9J/koUgQ8fAO9knFld8Os0DR3s7+64Q X-Received: by 2002:aca:cd58:: with SMTP id d85mr349823oig.173.1586196531124; Mon, 06 Apr 2020 11:08:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586196531; cv=none; d=google.com; s=arc-20160816; b=h1DncnzRNM0JYNSMBLVhFxRUYlJmIPjV4q17+MT5eSuFRbQEG3ICse6kNFnMbU4rZg cDr0kmbAt5/21WVGWEeW+SwkECeC6cG4nz2uUmlktIPwD8gTftshE7nb3zT9ZCZjn1sA 1EhfcMIFWEBm5AbeV5+sQwwzpLvvDrYqcmX2M2Z4Dtkgn+2WzaQazJ9QIo/UroUasxA9 rHMLz19uGiV53BzHy4sC0hyCmBo2dxG01ISP2vO0acm+J35qxkq4k66YeABFJk2GNWzP b2hIx1jP0oVJ9J91mwH6ess65LMfVhYdMItE2nppatjiHZmeeej+mhHSc6V7dZfl0iXg dyQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=wK+1gIiyDKmLLcFpz7LAVfiP8BXFg0q5zYtqqUOuI38=; b=Pl24/35Isfm12s7ttUaXv3E0pRMEV+eulGeSHCuwuC3Fh9AXhZf1TuMj00JhuNluHE Wt9s55IoFuo2ggqnOZKgJjJhfUyBPptl/MZbP9va+bB+48OkblTfgBz85zl2S4vmOGtY RQpRpsquR0o/rELm1B4W793UVJqoA8pqK7uu3Qc88wQU3Ev8wBSq1Lshru9yG5z2aGSc xLlwGSyQBc19pg8916UWRsD7kynt/975t6UjGghiPqz+3yr6Kz55BMa1zPgERJkFlbgL P5ZdRhv7p4ShjQdBsBreY2/5Qta31CzjYA+sy9nmXYaXPwPMAulQm4YLcEhNyXuBb3T5 EFQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gkQOENVs; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t28si133158ooc.16.2020.04.06.11.08.37; Mon, 06 Apr 2020 11:08:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gkQOENVs; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726520AbgDFSH1 (ORCPT + 99 others); Mon, 6 Apr 2020 14:07:27 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:44870 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726475AbgDFSH1 (ORCPT ); Mon, 6 Apr 2020 14:07:27 -0400 Received: by mail-ot1-f68.google.com with SMTP id a49so257456otc.11 for ; Mon, 06 Apr 2020 11:07:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=wK+1gIiyDKmLLcFpz7LAVfiP8BXFg0q5zYtqqUOuI38=; b=gkQOENVsUzlEu9fKxGRp/wkVwNB/yBa4wvjmXm5EvyX2w1v3yBT7cOtc0XPQkXevZU 1jNceoE12iZXT7EUNnTpJgpZD7FF5CTI8zNN6jdkI3+KkHbORHmB+iH09kR866GDhoxs kdRGsRsPDwZr+AS1tWmLb4W7RHeNQsyfXluHw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=wK+1gIiyDKmLLcFpz7LAVfiP8BXFg0q5zYtqqUOuI38=; b=A/0ukTTJoD0OcAibrloQxk4yw7I/ExRX7MLKadNLlDsYPv19/RljPhdMy/2obWeUlN e8tL8xCI5wjR7aWyNSWtHzDF8Zl6RgT3vlX0nNfrurFX+QiSCAtEiTeKH+D4HP3SSf0w 0f2YaFexqIR2B0Bd7hb9lQAoeDo3MaMii7k0CS4wFaYn1saxz6/6lkBbW5c9cMogg4h0 u0IufaALRWq26ecyTNlCH9wqs13bz1vI1kM43EY7L3nqTMZO2FSvQjTEfedEF6tfO1zE OTRzs4KoCwe0ArILWNdHHhVL8V7Ob5MMMHulh4z8IbHZzGYgUkLFMo0EwWB4yATi33ED 5TKA== X-Gm-Message-State: AGi0PuYdY78En6shn6X2zpNAiqWG29saDDpvoAK77vbiUlrtkO68OBQy Y8RfubIlGwJQviRYMSX+0I+zaV48WNxfGuxgcsoqUPfS X-Received: by 2002:a4a:9813:: with SMTP id y19mr361820ooi.56.1586196445739; Mon, 06 Apr 2020 11:07:25 -0700 (PDT) MIME-Version: 1.0 References: <20200406180402.7782-1-sonnysasaka@chromium.org> In-Reply-To: <20200406180402.7782-1-sonnysasaka@chromium.org> From: Sonny Sasaka Date: Mon, 6 Apr 2020 11:07:14 -0700 Message-ID: Subject: Re: [PATCH v2] Bluetooth: Always request for user confirmation for Just Works (LE SC) To: BlueZ Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Marcel, Thanks for the suggestion. I have sent an updated patch based on your suggestion with a little modification. Let me know if this looks good. Thanks! On Mon, Apr 6, 2020 at 11:04 AM Sonny Sasaka wrote: > > To improve security, always give the user-space daemon a chance to > accept or reject a Just Works pairing (LE). The daemon may decide to > auto-accept based on the user's intent. > > This patch is similar to the previous patch but applies for LE Secure > Connections (SC). > > Signed-off-by: Sonny Sasaka > --- > net/bluetooth/smp.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c > index d0b695ee49f6..2f48518d120b 100644 > --- a/net/bluetooth/smp.c > +++ b/net/bluetooth/smp.c > @@ -2202,7 +2202,7 @@ static u8 smp_cmd_pairing_random(struct l2cap_conn *conn, struct sk_buff *skb) > if (err) > return SMP_UNSPECIFIED; > > - if (smp->method == JUST_WORKS || smp->method == REQ_OOB) { > + if (smp->method == REQ_OOB) { > if (hcon->out) { > sc_dhkey_check(smp); > SMP_ALLOW_CMD(smp, SMP_CMD_DHKEY_CHECK); > @@ -2217,6 +2217,9 @@ static u8 smp_cmd_pairing_random(struct l2cap_conn *conn, struct sk_buff *skb) > confirm_hint = 0; > > confirm: > + if (smp->method == JUST_WORKS) > + confirm_hint = 1; > + > err = mgmt_user_confirm_request(hcon->hdev, &hcon->dst, hcon->type, > hcon->dst_type, passkey, confirm_hint); > if (err) > -- > 2.17.1 >