Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp934555ybb; Wed, 8 Apr 2020 12:52:13 -0700 (PDT) X-Google-Smtp-Source: APiQypLN/nQHF6D4ofQgic/LNIO4p+Pjx4WS3SGGTdw+S9lDbrCBbhHZOprYQKHyKniRYe2NsBRE X-Received: by 2002:aca:c608:: with SMTP id w8mr3821229oif.163.1586375533011; Wed, 08 Apr 2020 12:52:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586375533; cv=none; d=google.com; s=arc-20160816; b=uw6h8YFZJYe/WAeEATz5DoCbprkdBLsOvGI88WoysubrCzlocxBZHPAWzblJN80rEw zsSZGAuboMALwfyUwgJd9nyGakFDtYnkuxpzOKpmqOesu0QYu+kpajatGJ8c0TQGwZ7K jG7qv8briEFjKdqaxZ6J6hNhH5fo4NJ90R2nIcHilSmUibj89cugSMO6nK5yPx4406TK EWPsQrJZBQvZ/KcNlbf4xVGWi5gcz8mWuOlN1BFVmX8HaD3afgcsb7JEARkKq/3s8A6R pQHyFl4rFrQVmMYgxPY3qReWk4L3oldq04iKCgHjgyxoYq1LanSTdtE9g2wPEa0/xyvA Djxw== 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=0J+Uc3K4QIzN8q8ABovJI3Th/Qfglwe5LIEnPdnRzcQ=; b=GIeppdLxF2GU+9C7/tYaqULivJ2/0lfoElkEeXK1ljvz4Y5PQXOzdVCJfml8x5pwMO nLkejNFSwVvEPRgzupdifV2E8f/dCKuameUkxxF3SL3P48+v9Fz9PU55iCYgKJHDB0eY pMBWYso3PMnVsq7TBENegmyYrYiGreQgQuAnCNhgcVAzqQnVto2gcYylw2yeTSowwibS cIAjsUMm2qSxKkLHFzbHVVof3iG0DNnAw1FP5orsEqkkq5WpqaUR6Ni4cusM9CGd4pMR VFE1KRMTJjQS3dDzpvR4OB31jcSKhurj6TKeFDN84nv8iqwBo7lMs7PtqHemO6GylWDv GASQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=fiil9+7k; 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 z6si2303820oia.219.2020.04.08.12.51.59; Wed, 08 Apr 2020 12:52:12 -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=fiil9+7k; 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 S1728964AbgDHRbw (ORCPT + 99 others); Wed, 8 Apr 2020 13:31:52 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:40090 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728771AbgDHRbw (ORCPT ); Wed, 8 Apr 2020 13:31:52 -0400 Received: by mail-ot1-f66.google.com with SMTP id q2so4824845otk.7 for ; Wed, 08 Apr 2020 10:31:50 -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=0J+Uc3K4QIzN8q8ABovJI3Th/Qfglwe5LIEnPdnRzcQ=; b=fiil9+7kofmUpICFlmtltyb4cut6qCnZwYtZc72cTnD7vDAByKSPC++cK/GcOaZFkM KxbY4nqfyt7TezCIAlA/b6ODZuRTwq6yc3AA5PyaWf6lXkRuiGIwgdB2m0YDOFT8h5K0 we6ef0ZgkWPNwQkkA8n3JI8jLcfkCum/FFQ/c= 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=0J+Uc3K4QIzN8q8ABovJI3Th/Qfglwe5LIEnPdnRzcQ=; b=U7E81ly8033L7Bd1W3N65hJZ4JbPapd5Sie+0YO+PW9mG547bQc9JwlWMsAWEfGBs4 N1obVQIAthtjaoXIxm55orz7oLHJrZLWHTtSMreA6wA4Uq7u4EIbtKi1TwHUuBT1HqcL aJLlpG01H5z5mPoF4r2fE3bhL5g14ZhM/jxxVOa0DR9Jm4FZNSb58P+B3Fb8NCkGb0iG m2XvfEWtbP27MqlJ03a1eX/XYGqS42eOw7XVeLxxS50HpRbfTuNUJJ4DlxThIC3qGZZN 1VnkwObxYxrzcpoimTGm/gL3KexE6OVFjEWpu1Uf8i0Xe1SgRUFT6dArhgIh27kZtZL9 mcjA== X-Gm-Message-State: AGi0PuZnEzkx6e9avAh/+ha2fX01wDG+yR670/2brDx+3ML3zCOPJPqv f0pufVhizm9gxw+Hf3TCi0vvi87PMJJSn4JE7j92imtU X-Received: by 2002:a9d:1b6d:: with SMTP id l100mr6188288otl.70.1586367109445; Wed, 08 Apr 2020 10:31:49 -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: Wed, 8 Apr 2020 10:31:38 -0700 Message-ID: Subject: Re: [PATCH v2] Bluetooth: Always request for user confirmation for Just Works (LE SC) To: BlueZ , Marcel Holtmann 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, Could you please take another look at this v2 patch based on your suggestions? 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 >