Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3562381ybb; Mon, 6 Apr 2020 11:05:10 -0700 (PDT) X-Google-Smtp-Source: APiQypI20C0gI0m86bhGCblPfO9OaUldkUjeg2+ffY0e4Ln93yxJ3TwV0lISeddWvBodZyuja9r+ X-Received: by 2002:a05:6808:485:: with SMTP id z5mr477034oid.78.1586196310472; Mon, 06 Apr 2020 11:05:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586196310; cv=none; d=google.com; s=arc-20160816; b=F1xdZHz5A7qEZJm/gJEZr429unoQDKKIS5nO9NSfFZQY8LHlGd/eFJCPulzMG8Jh/9 IIhg1Wvw/aK+w6buLFWntw3VEpBCuvtqgTvdzHq/CK92mhVWt8yDarIzt4kb8zuQWhrK qQJPm/z/aoXaJuFX40G+uTakHuAEl7mlzVCywMwaWoONOPXR43Ub/8NTGsvOX6x0yEW1 Wqrmek9gWnC5J8BLkiEoIBz7H9tnYtGUE3m0fjeGDoK269TL6VOPnOuKDnqNe2axktE2 7hzIBFIbMsB24RlTPbmprslwWEhjoCDscB6fS3JVnoD20/3gTlIT6AeY+1DecOA0RHWk jvkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=qWvReOTUfVQj/eWaEQUQpECI5Xx6jBeqXDjtEeOsERE=; b=sJb+CIh/1O0ZbLeEZzeDq6I8bHyCzubbXV//new/GYSoEmBH8M9VLvqfqxn3ZK1tQk gQuQKtYnQGKayqCERzVuTqnNfl/ahzIpG0KWLdObdTX8ztwQ6DsoH+EskssoiDgMJokm S2AY0BV/uU3fRZ+DDfGD5k2udgqTsXFiDrQi00gp90C5Iv9FGFEvvBFp+CWzmiivsnVI M7ZmxGPKvKakFvtxoZEECh77sy9djHjw8wiTNjnTHZ/Fzs07i1sm19I4GcKQZuL9fXVY G09ZdGB/GlBKWzhpVFypqnkIHRIMGhJVEreF9wk9znAl9YtduzULmK2AcmX0noLMA/iZ h+tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=NAUJPupj; 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 l9si152402otf.51.2020.04.06.11.04.52; Mon, 06 Apr 2020 11:05:10 -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=NAUJPupj; 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 S1726574AbgDFSEv (ORCPT + 99 others); Mon, 6 Apr 2020 14:04:51 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:38058 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726436AbgDFSEu (ORCPT ); Mon, 6 Apr 2020 14:04:50 -0400 Received: by mail-pg1-f194.google.com with SMTP id m17so347766pgj.5 for ; Mon, 06 Apr 2020 11:04:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qWvReOTUfVQj/eWaEQUQpECI5Xx6jBeqXDjtEeOsERE=; b=NAUJPupjZj963s1Cr8fKU0Jy1k+DMM7aGyuj9Yd8vmUWe8ajf83rUMp+kyZVW3QJWZ nPn9BcchTp29ahM1MvN9OGajb8hGE6VJJ1ITy7lKCUQYPWVeLVL/ZgR4ONBzs/YUjwZS L0ji7zUT3oVrpPlYXOMqA/UXmgjD09RkfeD+k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qWvReOTUfVQj/eWaEQUQpECI5Xx6jBeqXDjtEeOsERE=; b=eznR+oV/GgTlJxiR0XNOTwH+TIulRcrP9w4e01bSwveH2/PJ3Er4rGEvJbVVQEhIqk LUAtp00gsMUDukrr2SYx65XRH9K4iDVbcc08ub83Ekbz8gr01+A9omIyquU+c3mkjMBf jaynR1GpN7aGzJbuol+Mi5hJldz36yat57+NKITkdrv7PTP5R3950uhGfzDPwtEVNAGh rEw2yGVWOXnFs5dgPA8enb7ZwAhN0TTSZqBVXRf0WBj5wEHFUorKBuBYLlhutqWrVION Gt4OuLvYAnuiv6AFdQ6cxTtSvrfPrZwOSrfpx5jO+mk+8HZRhaYGWcigZCGbV7GZ2w+f IeHA== X-Gm-Message-State: AGi0PubAdm85RsfSzO+OfJd66bywoAkHeapq2aTKe5sfkNxMNonSa5oY LDuTLd5vTe03YLlqZ2PH5Rv4Z+EGMf8= X-Received: by 2002:a62:5187:: with SMTP id f129mr708538pfb.144.1586196289866; Mon, 06 Apr 2020 11:04:49 -0700 (PDT) Received: from localhost.localdomain (c-73-231-41-185.hsd1.ca.comcast.net. [73.231.41.185]) by smtp.googlemail.com with ESMTPSA id l59sm909604pjb.2.2020.04.06.11.04.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Apr 2020 11:04:49 -0700 (PDT) From: Sonny Sasaka To: linux-bluetooth@vger.kernel.org Cc: Sonny Sasaka Subject: [PATCH v2] Bluetooth: Always request for user confirmation for Just Works (LE SC) Date: Mon, 6 Apr 2020 11:04:02 -0700 Message-Id: <20200406180402.7782-1-sonnysasaka@chromium.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org 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