Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp2878582ybn; Thu, 26 Sep 2019 19:50:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzt4jA4FvDI+0u6Zt9GvXaSx378o8jtO4qyqOF8sgcZGHtLYpBIw0UGG+Vm/ityyPZJQDFG X-Received: by 2002:a50:aa96:: with SMTP id q22mr2142516edc.179.1569552654959; Thu, 26 Sep 2019 19:50:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569552654; cv=none; d=google.com; s=arc-20160816; b=Py6vuHE95A1v+h8EHV9CqdeCGxXORbDxrSQESt7aytXJhhDZ3UjH3boje0rufv3paP xoVR8zkffnC385REIc0MeDvjCBNQHfceH0H9QDAG7xv2s+J4R5SNLvrb/khHbu4fE2ex AYU9RY2nmFO7jIc/wj7jXlVoYomJ8KHvprPkSuUb4go0/UHA6sJ2GniKNnYaCu3fs3FT xYo8XPsFIy4xlRgAXEko68kNmlEkx9z0KC5NxFgIqvJYOhs3plLsuOCveStJNrESxhHB lOs1Rb94PjOUExSr5CPdFDwY3tLX+wsZnu7Zsp+YZpgXhUNHo7ZOFx1d7kZBbYSs24D0 a+Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=2eS8yR/+nkFyWJdVZoxVxJsQ5SlE5wYhk6owlcunwTo=; b=Fms+14xLR7LFRDhf4Njm2JWwAAln5FSyoeOjg4iC9ohw8MF8vRpvofcKLFAE5ueFuY nuwir7oReDjTcp4n7uHJChm7cyX598vBfYOzoRHRjpCi4F3Mkt25x3tuUV5h2+9z9YrK bfpIFt5Lt1HLTBkb64POWqWQMNc+jhEkUds+J3mvgKZHqnPOqE20LYSkQUFUs7KZ8Bll K1gIh8NrOo7Z7NmvyT3gAs0K/Diymmg/b8bqCBZxh+KgptAN5v/7nOT4dj32NxW1ktyY KYvISl8Sv571mOfsGTYSq3bc3c2zemdn1rPQ7Spy+RWDtV90uVV/JI0GHn2jTRIBuo0w frOA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i10si745471ede.101.2019.09.26.19.50.30; Thu, 26 Sep 2019 19:50:54 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728270AbfI0Cu0 (ORCPT + 99 others); Thu, 26 Sep 2019 22:50:26 -0400 Received: from mga11.intel.com ([192.55.52.93]:21067 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727796AbfI0Cu0 (ORCPT ); Thu, 26 Sep 2019 22:50:26 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Sep 2019 19:50:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,553,1559545200"; d="p7s'?scan'208";a="219621729" Received: from orsmsx104.amr.corp.intel.com ([10.22.225.131]) by fmsmga002.fm.intel.com with ESMTP; 26 Sep 2019 19:50:25 -0700 Received: from orsmsx153.amr.corp.intel.com (10.22.226.247) by ORSMSX104.amr.corp.intel.com (10.22.225.131) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 26 Sep 2019 19:50:25 -0700 Received: from orsmsx103.amr.corp.intel.com ([169.254.5.5]) by ORSMSX153.amr.corp.intel.com ([169.254.12.237]) with mapi id 14.03.0439.000; Thu, 26 Sep 2019 19:50:25 -0700 From: "Stotland, Inga" To: "linux-bluetooth@vger.kernel.org" , "Gix, Brian" CC: "michal.lowas-rzechonek@silvair.com" Subject: Re: [PATCH BlueZ v3 3/3] mesh: Fix Key Ring permissions for local nodes Thread-Topic: [PATCH BlueZ v3 3/3] mesh: Fix Key Ring permissions for local nodes Thread-Index: AQHVdJZoFMOUUqc+tEyrdZ8iI4HYlac+4ZOAgAAuiwCAADisAA== Date: Fri, 27 Sep 2019 02:50:25 +0000 Message-ID: <112b44e9e00c909a1d98997df1eeed0c2151eb0b.camel@intel.com> References: <20190926181444.4916-1-brian.gix@intel.com> <20190926181444.4916-4-brian.gix@intel.com> <3c389010afa470574d5a90a4dc31a2bad9c26e84.camel@intel.com> <0a384749e155689d7981a443059d6cb5a6522f75.camel@intel.com> In-Reply-To: <0a384749e155689d7981a443059d6cb5a6522f75.camel@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [10.251.130.16] Content-Type: multipart/signed; micalg=sha-1; protocol="application/x-pkcs7-signature"; boundary="=-+E6D3b31g91Q0upBf1Vb" MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org --=-+E6D3b31g91Q0upBf1Vb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Brian, On Thu, 2019-09-26 at 23:27 +0000, Gix, Brian wrote: > On Thu, 2019-09-26 at 20:41 +0000, Stotland, Inga wrote: > > Hi Brian, > >=20 > > On Thu, 2019-09-26 at 11:14 -0700, Brian Gix wrote: > > > We do *not* automatically create populated key rings for imported > > > or > > > joined nodes, > >=20 > > Why not for Import()? Since both the DevKey and NetKey are in the > > possesion of the node... >=20 > There are two (known) use cases for Import() >=20 > 1. Node previously existed on a different physical piece of hardware, > and is being migrated to this daemon. >=20 > 2. Node was newly provisioned Out-Of-Band, and this is the net result > of the provisioning. >=20 > In *neither* case is it a given that the Node should be able to > provision another node (the effect of adding > the Net Key to the key ring). In neither case is it a given that the > Node should be able to modify it's own > Config Server states (the effect of adding it's Device Key to the key > ring). >=20 > However, if it *is* the case that one or more of these operations > should be available to the Node, the > Application that performed the Import may call the ImportSubnet() > and/or the ImportRemoteNode() methods. In > actuality, if this was the intent (particularily on a Node being > migrated) a key-ring of some sort should have > existed on the other physical piece of hardware. >=20 >=20 > The point of this larger patch-set is to no longer assume that every > Node has the ability to use it's own > network keys to provision other nodes, or use it's own Device Key to > change it's own Config Server states. >=20 > Yes, that can still happen (as it can with non BlueZ nodes) but it > should be by a deliberate mechanism, not as > a "time saving default". >=20 >=20 >=20 Sounds good. Could you please add this description to the commit message? > > > but we also do not *forbid* any node from adding a key > > > in it's possesion to the local key ring. > > > --- > > > mesh/manager.c | 5 ----- > > > mesh/node.c | 15 --------------- > > > 2 files changed, 20 deletions(-) > > >=20 > > > diff --git a/mesh/manager.c b/mesh/manager.c > > > index 501ec10fe..633597659 100644 > > > --- a/mesh/manager.c > > > +++ b/mesh/manager.c > > > @@ -282,7 +282,6 @@ static struct l_dbus_message > > > *import_node_call(struct l_dbus *dbus, > > > void *user_data) > > > { > > > struct mesh_node *node =3D user_data; > > > -struct mesh_net *net =3D node_get_net(node); > > > struct l_dbus_message_iter iter_key; > > > uint16_t primary; > > > uint8_t num_ele; > > > @@ -298,10 +297,6 @@ static struct l_dbus_message > > > *import_node_call(struct l_dbus *dbus, > > > return dbus_error(msg, MESH_ERROR_INVALID_ARGS, > > > "Bad device > > > key"); > > >=20 > > > -if (mesh_net_is_local_address(net, primary, num_ele)) > > > -return dbus_error(msg, MESH_ERROR_INVALID_ARGS, > > > -"Cannot overwrite local device > > > key"); > > > - > > > if (!keyring_put_remote_dev_key(node, primary, num_ele, key)) > > > return dbus_error(msg, MESH_ERROR_FAILED, NULL); > > >=20 > > > diff --git a/mesh/node.c b/mesh/node.c > > > index 833377e99..af45a6130 100644 > > > --- a/mesh/node.c > > > +++ b/mesh/node.c > > > @@ -1681,7 +1681,6 @@ static void get_managed_objects_cb(struct > > > l_dbus_message *msg, void *user_data) > > >=20 > > > } else if (req->type =3D=3D REQUEST_TYPE_IMPORT) { > > > struct node_import *import =3D req->import; > > > -struct keyring_net_key net_key; > > >=20 > > > if (!create_node_config(node, node->uuid)) > > > goto fail; > > > @@ -1692,23 +1691,9 @@ static void get_managed_objects_cb(struct > > > l_dbus_message *msg, void *user_data) > > > import->net_idx, import- > > > > net_key)) > > > goto fail; > > >=20 > > > -memcpy(net_key.old_key, import->net_key, 16); > > > -net_key.net_idx =3D import->net_idx; > > > -if (import->flags.kr) > > > -net_key.phase =3D KEY_REFRESH_PHASE_TWO; > > > -else > > > -net_key.phase =3D KEY_REFRESH_PHASE_NONE; > > > - > > > /* Initialize directory for storing keyring info */ > > > init_storage_dir(node); > > >=20 > > > -if (!keyring_put_remote_dev_key(node, import->unicast, > > > -num_ele, import- > > > > dev_key)) > > > -goto fail; > > > - > > > -if (!keyring_put_net_key(node, import->net_idx, > > > &net_key)) > > > -goto fail; > > > - > > > } else { > > > /* Callback for create node request */ > > > struct keyring_net_key net_key; --=-+E6D3b31g91Q0upBf1Vb Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Disposition: attachment; filename="smime.p7s" Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIKbDCCBOsw ggPToAMCAQICEDabxALowUBS+21KC0JI8fcwDQYJKoZIhvcNAQEFBQAwbzELMAkGA1UEBhMCU0Ux FDASBgNVBAoTC0FkZF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