Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp346252ybh; Thu, 12 Mar 2020 03:09:47 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt0Nuc0yU3w9KuH+6hg+E1JlbX8k0jlqqAvenHrnM3XQ+j0ab++4F4sqyeVqQnxoMzCIuev X-Received: by 2002:aca:dac5:: with SMTP id r188mr2021636oig.176.1584007787413; Thu, 12 Mar 2020 03:09:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584007787; cv=none; d=google.com; s=arc-20160816; b=dBVegSEdE+AiBW2YwhBXqPpHjEpOEd+/mapkOt06hLA8fXe8BcSCr0b2NjfI4soR44 0EujqwB/KFSpRNwv3/8YPRwKxYf2669VU4AkKyF/2vU2hAUSRW5qWubVTJxiEqxttPSU Q5lTTq3y0Dg4y9+HaAi3T8kT+9PUc31le/p7XO6/H6h9NZiCUu7B0AvsXrO8mSWWVtX3 nmGGVYkVSXwaCpLmGt3OONvDE88LpE6MHshHLFmhQSpRcugjplMUB3owUHxU4SWKoQDn bvLyNPp6MKg+SRA5+uiy405A0vQtbp7D+bE5R5lLSZ+XU5EnqKf/LwBamx84VtG2MixT MpZg== 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=WEssHPdmc+CHUX/J9svOx4jP0pCE2+tppJ8olfTleQM=; b=QRt9whjrRgTsWHmgC9KPowiY8sEexKeogtXFPZEOr+JK80Gr/mfwofgJfekJPO+Nx2 UZQUgxbejXMmcTlvaiCbr69/9A55/lA7YZoo8cutVvr836snfqdWPa++RCt1wjyANPez LTVjMRa6T5/mOWqT+VHqelY6KZDuSHXkDKWdNTWdepgzxNr4zleGCF8XSTG3Vo24zm6V ePiQ6EB91Ehg5hDRT2mkAFm5G40ilDLVmicKm5bYcH4UZIKfdktnJ6/EL43x8XYiuimG UywJSA07VAoRNp4zyj9bfRlWXc3bgC8cZyaUqWKeqobiiy2q8CP7JUA6NxNohLd57dYM NO+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qpoWLV81; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t132si2457715oih.173.2020.03.12.03.09.34; Thu, 12 Mar 2020 03:09:47 -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=@gmail.com header.s=20161025 header.b=qpoWLV81; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726784AbgCLKHS (ORCPT + 99 others); Thu, 12 Mar 2020 06:07:18 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:41737 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726028AbgCLKHS (ORCPT ); Thu, 12 Mar 2020 06:07:18 -0400 Received: by mail-pf1-f194.google.com with SMTP id z65so3023146pfz.8 for ; Thu, 12 Mar 2020 03:07:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WEssHPdmc+CHUX/J9svOx4jP0pCE2+tppJ8olfTleQM=; b=qpoWLV81qW2rMTAtb/JdQk5gDvpAAFkaURhKCNhCgEhSq6rDaf/0BYz5U9PB4XG9Rc TKITRI8R0Yj4w3td0YabE7JrZMSLdyE2S+Sh3dpKTmSWXNuv7IEVkyZeAVY4Qi6cAVKY tStB8dvV5sz2vtdX7QNcPLdnZH7aBrtA/I+nAX91jedSkxv1CWu4M5m1XUpkkDtbNKac K0XsU6zBsDd6MBT7MUiZ2vnCOASH+XLUE87DfFvV6444cZOjMrrYhK1qgEs8ElX4B5hm N5NgEOxBJ++iY1Jdbnq/5mnvMuj97EN/Un+NtPPcS6wJkesJkt4tgzxDgNST/LJnraHR ooXQ== 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=WEssHPdmc+CHUX/J9svOx4jP0pCE2+tppJ8olfTleQM=; b=Nd+ucwx+v4eyD+l7GYV1pGINZKmvEXrgVsohSohluqFDfFfcssXfX8ixa0KQ3G/umS pYeVxC5VNrI3g749p+3Iw0VSlOhHBgDDETQKGN6YOorDAUQfPl7+xT1rDQuG9wZVQmkD W2NHu6fp7ej1Bwn9evkT8XYftzjypjqA7H9lPAWkuANE+rashwsrVBRaxACO6HcgoYyj FDOG3qEOZe3w174LZ53VxB7osI9eEJkA7Q1QyIk3vK4HkTDQg77IEwrU+bGytA0P5HEV 0SbPKXBmV1Lr+F0tWJG7k8BkaelfkL/E++CUnwMywu7rMuHl9AnPNLetJNjO4HGuKXM0 n58g== X-Gm-Message-State: ANhLgQ26foEnmROzn3Y2fSE/Kyaa15vRgmF4pGWxaZYdR/V6Gu671BjW VLgbgComD1AP8gUGv38e3z15oHXu1vL1ZA== X-Received: by 2002:a63:e007:: with SMTP id e7mr6982851pgh.414.1584007636397; Thu, 12 Mar 2020 03:07:16 -0700 (PDT) Received: from nsathish-Latitude-7480.iind.intel.com ([192.55.55.45]) by smtp.gmail.com with ESMTPSA id e9sm10578295pfl.179.2020.03.12.03.07.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2020 03:07:15 -0700 (PDT) From: Sathish Narsimman X-Google-Original-From: Sathish Narsimman To: linux-bluetooth@vger.kernel.org, nsathish41@gmail.com Cc: chethan.tumkur.narayan@intel.com, Sathish Narsimman Subject: [PATCH 7/7] Bluetooth LL Privacy update White list Date: Thu, 12 Mar 2020 15:37:54 +0530 Message-Id: <20200312100754.3445-8-sathish.narasimman@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200312100754.3445-1-sathish.narasimman@intel.com> References: <20200312100754.3445-1-sathish.narasimman@intel.com> Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Update white list filter policy of if LL Privacy is enabled When Address Resolution is enabled and device is already in the white list then follow the filter policy Signed-off-by: Sathish Narsimman --- net/bluetooth/hci_request.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c index 12868caf50ea..47cb2602713a 100644 --- a/net/bluetooth/hci_request.c +++ b/net/bluetooth/hci_request.c @@ -711,7 +711,16 @@ static int add_to_white_list(struct hci_request *req, /* White list can not be used with RPAs */ if (!allow_rpa && hci_find_irk_by_addr(hdev, ¶ms->addr, params->addr_type)) { - return -1; + /* White list can not be used with RPAs if address + * resolution is disabled in the controller + */ + if (!hci_dev_test_flag(hdev, HCI_LL_RPA_RESOLUTION)) + return -1; + + /* if the peer device is not present in the resolving list */ + if (!hci_bdaddr_list_lookup_with_irk(&hdev->le_resolv_list, &b->bdaddr, + b->bdaddr_type)) + return -1; } /* During suspend, only wakeable devices can be in whitelist */ @@ -768,7 +777,16 @@ static u8 update_white_list(struct hci_request *req) /* White list can not be used with RPAs */ if (!allow_rpa && hci_find_irk_by_addr(hdev, &b->bdaddr, b->bdaddr_type)) { - return 0x00; + /* White list can not be used with RPAs if address + * resolution is disabled in the controller + */ + if (!hci_dev_test_flag(hdev, HCI_LL_RPA_RESOLUTION)) + return 0x00; + + /* if the peer device is not present in the resolving list */ + if (!hci_bdaddr_list_lookup_with_irk(&hdev->le_resolv_list, &b->bdaddr, + b->bdaddr_type)) + return 0x00; } num_entries++; -- 2.17.1