Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7521966ybi; Mon, 8 Jul 2019 23:37:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxS1pTC8SiFp4iBbX42yjCQS/E21DqguSCz8qT4Zj7W8AIT32NkaBOQVGbQbKX/Hvn0+AP6 X-Received: by 2002:a65:50cb:: with SMTP id s11mr28557540pgp.371.1562654229799; Mon, 08 Jul 2019 23:37:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562654229; cv=none; d=google.com; s=arc-20160816; b=TmVMqR6sYLZTjPWQ7gaeIzaOZ4ndVh7kvdiHEEj9msZ+sV14e30Is9DCo8reIJHV/x mPqBXcXDaIDVQwCB7iVJFQVKb4SybD50ubJNUdwKEpT9NBX057wE9YZsH3y3hUxKHGIK BB5gjG644KcFklCSe0hc5t29jsksD2qjvoDiMcg4yCDXKGnHzTpVeDVvi8o3kligRNdP BPQLJZw59rIjnTSPGOBUip5I7cAwLAwwEpNAO2S+gK/QZ5BBc3T4XAugqSK8J7Hu5Mp8 0+FXXXGMtBE2PyfxUxic6xXbg7JYnUE+u633i4bIivjx9nJcdDUNgrvfS6py+G6JC/+0 EigA== 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=msYltUh63uT6YFRl/c/LibpYpkG8i7PwA96tSQ0UImQ=; b=kQGtcjzfpvERjPkXIEwXb5MToz7oz0YjbUxpOZred1dI4mjt14HPw9NMdEamVG/pHF JbxWjiRA3/uW+D8HsMbO1l3O85nHByAtEvRRRo3B1ZEW7Fy+S/VSe+ZdfOgVEqks6+T+ Tir8eNg6eSFM65CUFA+jOLMH+iyIM+Fuav6Wdx8vjX2NMqbU6APNlYMVi6qaicF57ONQ dYR+1QY7IWJqSEkLQhUDuz59QUX8uwzYdvkuXJR32pNY1EC5lPRk1gxbW+jJGa5NAWGQ 5IaHI0uQ8VHV6IjHr3R7g1VFQW/HWWt7ZXAF1m8+ZH7zF57vM9kFKtWp6G/aczCABnD5 Ee8A== 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 z20si21086063pfa.282.2019.07.08.23.36.41; Mon, 08 Jul 2019 23:37:09 -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 S1725913AbfGIGgj (ORCPT + 99 others); Tue, 9 Jul 2019 02:36:39 -0400 Received: from mga03.intel.com ([134.134.136.65]:17850 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725961AbfGIGgj (ORCPT ); Tue, 9 Jul 2019 02:36:39 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jul 2019 23:36:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,469,1557212400"; d="p7s'?scan'208";a="156085608" Received: from orsmsx106.amr.corp.intel.com ([10.22.225.133]) by orsmga007.jf.intel.com with ESMTP; 08 Jul 2019 23:36:13 -0700 Received: from orsmsx162.amr.corp.intel.com (10.22.240.85) by ORSMSX106.amr.corp.intel.com (10.22.225.133) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 8 Jul 2019 23:36:13 -0700 Received: from orsmsx103.amr.corp.intel.com ([169.254.5.44]) by ORSMSX162.amr.corp.intel.com ([169.254.3.137]) with mapi id 14.03.0439.000; Mon, 8 Jul 2019 23:36:13 -0700 From: "Stotland, Inga" To: "michal.lowas-rzechonek@silvair.com" CC: "jakub.witowski@silvair.com" , "linux-bluetooth@vger.kernel.org" , "Gix, Brian" Subject: Re: [RFC BlueZ 0/1] Validate element indexation Thread-Topic: [RFC BlueZ 0/1] Validate element indexation Thread-Index: AQHVNZdTQzhqil0Lq0+dZ8aBJmT0kKbBZWOAgAAY5YCAAM0RgA== Date: Tue, 9 Jul 2019 06:36:12 +0000 Message-ID: <17fa8e7dc1318ba9a1d141ad819be86d1a7ec9ea.camel@intel.com> References: <20190708141314.13950-1-jakub.witowski@silvair.com> <65651744c67ae13bd95ffac88fae42f0f6c16c61.camel@intel.com> <20190708182211.yxkucondnw5x6ay7@kynes> In-Reply-To: <20190708182211.yxkucondnw5x6ay7@kynes> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [10.252.203.194] Content-Type: multipart/signed; micalg=sha-1; protocol="application/x-pkcs7-signature"; boundary="=-Y9jGWX2NLL7GBcTxvo6V" MIME-Version: 1.0 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org --=-Y9jGWX2NLL7GBcTxvo6V Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Michal, On Mon, 2019-07-08 at 20:22 +0200, Micha=C5=82 Lowas-Rzechonek wrote: > Inga, Jakub, >=20 > On 07/08, Stotland, Inga wrote: > > I agree that the validation for the gaps is needed. Interesting > > point > > about max number of elements... > >=20 > > I wonder if a better check woul be to we to add to construct > > composition data as a validation point to make sure it fits in mesh > > message. Plus, an additional strict check can be done when Attach > > method is called: stored composition can be byte compared to the > > one > > dynamically generated from collected properties... >=20 > If I read that correctly, this means we would need a way to build > Composition Data on the fly, during get_manager_object_cb processing. >=20 > I think it would be possible to get rid of validate_model_property > function - instead, we could build a temporary mesh_node instance > using information provided by the application as-is, and then: >=20 > - in case of existing nodes, generate Composition Data from both > existing and temporary instances, and byte-compare the two >=20 > - in case of new nodes, simply save the temporary instace to 'nodes' > list >=20 > All of that assumes that Composition Data generationchecks that: > - everything fits into a buffer (this is already done) > - mandatory models are present > - indexation is OK >=20 > I think this would make things slightly more consistent, and we would > get rid of most "is_new" checks during attach/join/create/import. >=20 This is exactly what I meant. Thanks for writing this up in a more explanatory way. This would be a comprehensive validation of the node's integrity. Regards, Inga --=-Y9jGWX2NLL7GBcTxvo6V Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Disposition: attachment; filename="smime.p7s" Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIKbDCCBOsw ggPToAMCAQICEDabxALowUBS+21KC0JI8fcwDQYJKoZIhvcNAQEFBQAwbzELMAkGA1UEBhMCU0Ux FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5hbCBUVFAgTmV0 d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9vdDAeFw0xMzEyMTEwMDAwMDBa Fw0yMDA1MzAxMDQ4MzhaMHkxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEUMBIGA1UEBxMLU2Fu dGEgQ2xhcmExGjAYBgNVBAoTEUludGVsIENvcnBvcmF0aW9uMSswKQYDVQQDEyJJbnRlbCBFeHRl cm5hbCBCYXNpYyBJc3N1aW5nIENBIDRCMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQ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