Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7155398ybi; Mon, 8 Jul 2019 15:46:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqwKMh6F6Fnj0eBi6wUQrxXAwt3iKWcqo1d2zXdPF2xfsGpJ+8bqoJaxd5ptJqXS64oxCO+m X-Received: by 2002:a63:1908:: with SMTP id z8mr18970526pgl.433.1562625964105; Mon, 08 Jul 2019 15:46:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562625964; cv=none; d=google.com; s=arc-20160816; b=a9uzapNqRm++VE7Lje17aYlFSX0ESvugXgPWgjZJ7s4ns32TzdAvTy4FmWqPuY4xBB RseEDUPj6Jyx3BAib8HiNZx2ZRshtQhEoCInTkbGKrb16sb4dZvYb+DD6CEJu5G7zGel ZMPVbSdlzQ5YQDf1iZ+Wk/grDJ84KmNYBZgdoir2YUMGXxuUQRAaRYe3W6WcLwA+SoVa 5H/Wm5iWPpUsHqbuooeSJeZdAoRm+KvEHGqU64onqlHKT9N0KxQOBOxozGCmBKSDchMV mnyxrS17OJaO2MHwhP3eEtMZ0NfciNo05OHWIJGAIEcg/M4G9X0rYSo69KP6c8Z2eOan 3GYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:date:from :dkim-signature; bh=rCy9lTyFlchYxHM7RHUu+DdDngvtOzKKharJdmOjoSQ=; b=cTcMA2RTBCdioqimpS8Fth7D8pP/9nYKjp58AEPaAT+2YAG+gJTK0K3b5T1NFLViQb tuRIkhWA9Yu65fMA93i5zGXpbNt6/zFCxkuOBAytDgHMkOG6umeSwc1NNMaSpiGTJc4g GPDT8haAUpWHKIBRdBgamF9xhuDXQgzVTyo84OvQ9vV8rrLNPleTyZxsVZ0KSbFCa26+ VfarkPuKJUahcPxWlVV+7InRV/unXzJJnUotYAX2Za3f4hUYBNd9985yhtenJtEp4Jeb iwst7lU8B5yXMQAEYze2ADds7Cn0iEQWvEF+hf+fBVXk7xfZuWKkRu4Ux1zQ8DvbDY/F 1Wbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=EJER6KPO; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f20si22712447pfn.166.2019.07.08.15.45.49; Mon, 08 Jul 2019 15:46:04 -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=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=EJER6KPO; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732128AbfGHSWQ (ORCPT + 99 others); Mon, 8 Jul 2019 14:22:16 -0400 Received: from mail-lf1-f43.google.com ([209.85.167.43]:36772 "EHLO mail-lf1-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732117AbfGHSWQ (ORCPT ); Mon, 8 Jul 2019 14:22:16 -0400 Received: by mail-lf1-f43.google.com with SMTP id q26so11596982lfc.3 for ; Mon, 08 Jul 2019 11:22:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silvair-com.20150623.gappssmtp.com; s=20150623; h=from:date:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=rCy9lTyFlchYxHM7RHUu+DdDngvtOzKKharJdmOjoSQ=; b=EJER6KPO5TqRmtx8cmrGzr+uWdqR/Fakn1AlWksUSMv4ISsvmZo7Sl3IW2Ro9iEekL 2M8wT3dWD6S004h0JJ3BjByCETVSvdKF+HHDITZN8ZcmsOEj7HbiHYOH3vXwPP9S4m2n /zLdKDl5bAzfiocvpAiZbNZAz1YMLVG1RZXcfG2Yi6bKkM/s5IKHSGM+HGNTiGoNW1Yh mZUKVtxA3GysVQQsc277FRsNK0hDe6STQpP5sWv4o6dlZyXwXgZZyy+FYRlNTI53dNIb tIY+LxlGu25g+b/+KQz8BRDDawmCBS3C6S6eOrUrRU2sYXpKi9RA8nQjGDtfR3N9JUWc Ejcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=rCy9lTyFlchYxHM7RHUu+DdDngvtOzKKharJdmOjoSQ=; b=c5XWLnY1iKwgZnJYNS1IPu6Yi3noIiQ3Ipalvq9Z41KVW1N9a5D90fqcdXJ7JQ7Fgu q0wD507zApi5yBnK3IKAyw2udeTpEbBYHmuzI1hiUIbZcXpLD1gR1Qj+Qee0mGidPGKf HwR6CI9iLyGvbhqUm7rNiy8hNSh1aMZq19PgkQfQ2NS/GP25OyiYU920eGJUsrpXxwXP Yr2OOWt15h4x2Z+4BDfr1sRnL/XwVM5xkF6S6Jta4qTOxtaCEwJCbZ45xJT/cUJqjo6A 1sixqHgjXiz5jJzbwNZ9RoMY2zrQcwbaAW8p9sHQvvmha/9ldAdr2TnINuiAbMP1I/nJ d+aA== X-Gm-Message-State: APjAAAV2UM1bUOAT49g57JpUFxtWnC+m68pbi2AjgiIVVGepdUNJoHwf Sb3NmPlxeGyyePfKXM6r4vbHXA== X-Received: by 2002:ac2:4466:: with SMTP id y6mr5083374lfl.0.1562610134457; Mon, 08 Jul 2019 11:22:14 -0700 (PDT) Received: from kynes (apn-77-112-37-101.dynamic.gprs.plus.pl. [77.112.37.101]) by smtp.gmail.com with ESMTPSA id l11sm3182157lfc.18.2019.07.08.11.22.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Jul 2019 11:22:13 -0700 (PDT) From: "=?utf-8?Q?Micha=C5=82?= Lowas-Rzechonek" X-Google-Original-From: =?utf-8?Q?Micha=C5=82?= Lowas-Rzechonek Date: Mon, 8 Jul 2019 20:22:11 +0200 To: "Stotland, Inga" Cc: "jakub.witowski@silvair.com" , "linux-bluetooth@vger.kernel.org" , "Gix, Brian" Subject: Re: [RFC BlueZ 0/1] Validate element indexation Message-ID: <20190708182211.yxkucondnw5x6ay7@kynes> Mail-Followup-To: "Stotland, Inga" , "jakub.witowski@silvair.com" , "linux-bluetooth@vger.kernel.org" , "Gix, Brian" References: <20190708141314.13950-1-jakub.witowski@silvair.com> <65651744c67ae13bd95ffac88fae42f0f6c16c61.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <65651744c67ae13bd95ffac88fae42f0f6c16c61.camel@intel.com> User-Agent: NeoMutt/20180716 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Inga, Jakub, On 07/08, Stotland, Inga wrote: > I agree that the validation for the gaps is needed. Interesting point > about max number of elements... > > 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... 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. 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: - in case of existing nodes, generate Composition Data from both existing and temporary instances, and byte-compare the two - in case of new nodes, simply save the temporary instace to 'nodes' list 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 I think this would make things slightly more consistent, and we would get rid of most "is_new" checks during attach/join/create/import. regard -- Michał Lowas-Rzechonek Silvair http://silvair.com Jasnogórska 44, 31-358 Krakow, POLAND