Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6773118ybi; Mon, 8 Jul 2019 08:25:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqwICtDLnkT71By+mM0o//6LP33Lej50fdgK2UlH3rl9H+cp/s0Za1Ohhu0mX1uqROBPamG8 X-Received: by 2002:a17:902:2a29:: with SMTP id i38mr25859169plb.46.1562599554310; Mon, 08 Jul 2019 08:25:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562599554; cv=none; d=google.com; s=arc-20160816; b=Dv8LZDMuLUKctt/FCW0OyQ+/ptFTBneEfacrQzggNOJjLdyRkkZJf7dU6MdLl7t2hP 6C7eDH8kEAymsGsD0IG+0Cfvx9YgX5QGWJlgVB0Lrgd1S7GQjAIUgbpSlh3sdARQhfd0 O4Ie2qfUomL9XLIyTqqNCvOlgUCz8bjVNbhCjxOjO9lFJPtR7qhUJ3gwGrR+FxofSYlX EiMLd/K4RbL9Qa8PDjKZJ6+dBWNX10tuW3owjkfIYfyz/M0FIBI5eyfPZVSImtzMeeWD z+PizRePL1XdXHG0ejnaQVvkvpRndam2B48UN1bta8o+O8zqD/8pWFpxWo2+AjnqxDac jxmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=ZEpkOPJ+GJaq9j+01thh6Wu8K5xS3Xfa0eBBDLzDcYg=; b=Rl0ZHUuZ4QEcFedJSU6Sj5PtAby1SWJY8nGjkj0fYMRQO4mp1ZqDsFm9wi391h82tI 8/8g5yvDjDPCqm1c2AKjXtOiS9e0WyTNXEg2sUXVqq4WYY+szkOXUxEXBndGSADljSd7 h2XYnzIfWGTyaYFix7TfPov1PUEV9VFopoqRS7z7phLe28ILivn6kl/WTaHyPYsQrzaT H5bswx4R69bEkvy/nL+1P0jvahZuKaLn0Z8vOnvfh3yKAOv5Cm7QeKo9rYwAmWPHDAZe oRfoSgpPfMyji8MGOztXtBXsvc1oj7Q3wHJQIPNYhEWPZFzlEaePwqHQhzOTOSn61vID g7og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=eGwylQhD; 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 v1si17587623plp.264.2019.07.08.08.25.39; Mon, 08 Jul 2019 08:25: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; dkim=pass header.i=@silvair-com.20150623.gappssmtp.com header.s=20150623 header.b=eGwylQhD; 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 S1729330AbfGHONW (ORCPT + 99 others); Mon, 8 Jul 2019 10:13:22 -0400 Received: from mail-wr1-f47.google.com ([209.85.221.47]:39551 "EHLO mail-wr1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728941AbfGHONW (ORCPT ); Mon, 8 Jul 2019 10:13:22 -0400 Received: by mail-wr1-f47.google.com with SMTP id x4so17296363wrt.6 for ; Mon, 08 Jul 2019 07:13:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=silvair-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZEpkOPJ+GJaq9j+01thh6Wu8K5xS3Xfa0eBBDLzDcYg=; b=eGwylQhDEeAqj706RZyntXYgeKrHAKvhxLEtp056mZwA3Jcq+qJOT4BEe7z4irSdzM Rh+u+mJHROSGDiYzXP0aGYf0GTztc6qTJo3Sbqh0LwWPX7dQ2ThDpPBBzf7k3zr/LkoO Sp9JGgaZ7QL/yl+ZHbT788eqpX73YF5wkK8ccJ8XlgmmM+nkpJPdiz/ShzsrGnrWvwg6 AbI47NRABEkx8masFBY9Qqfg/M5aWWjsW2JP34r6uS7V5PNz3y42mne9+qmaaTIMmqb8 GPIjd5Fqa8a9FD0crAXJtkCkmeBS/OaxOnC06gxJCtJTcFytntsSmGxpMW/JQejai/WE fGBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZEpkOPJ+GJaq9j+01thh6Wu8K5xS3Xfa0eBBDLzDcYg=; b=HCZbqugJpkX+Mu5bamHhuNRdUC2KoTA8yvwZ2zT+h/kvGYY8hygklOItPHBQhNTVDN Z5z7Q68CkpCE4GswAEvbJE4NNoYS3gP62N8d7GHwKm9Zv0S+yPkaBeqiZMfBElrp+/lY 08/par3h99JILvdkPMcHVS7itoOAY6IsLP+eVFLKKdnYruU4uQ69Z5+BqTLxqBOSE6Ci B+sK5dtpuVGqmwQqz6XBsKX85awZChdRhkS8e4QoPAQvallJh7Mci+5WeseRtFYLS9Kh D4BOItHki+EnW58CGzTY5jPadHUPg8wCdjdAJWC6J2b+UkbyUPV6CUE8qrzvTbH1PWCX RPsw== X-Gm-Message-State: APjAAAUtpMHZ1Au29XDx6pjAPWdnc/YYB96E7OwEKzbRR7+j+OfZd83a x/BkNqd71D1Agnd1HabgdN5YEIHwf83h2A== X-Received: by 2002:adf:f706:: with SMTP id r6mr18094253wrp.23.1562595199779; Mon, 08 Jul 2019 07:13:19 -0700 (PDT) Received: from localhost.localdomain ([217.153.94.18]) by smtp.gmail.com with ESMTPSA id m7sm5392574wrx.65.2019.07.08.07.13.18 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 08 Jul 2019 07:13:18 -0700 (PDT) From: Jakub Witowski To: linux-bluetooth@vger.kernel.org Subject: [RFC BlueZ 0/1] Validate element indexation Date: Mon, 8 Jul 2019 16:13:13 +0200 Message-Id: <20190708141314.13950-1-jakub.witowski@silvair.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hello, I've prepared validation of element indexation. First of all I've used 64-bit unsigned value to collect all given indexes. As You can deduce from "4.2.1.1 Composition Data Page 0", the maximum value of elements can be 61. It is limited by max message size which is 376. Furthermore the element indexes should be given with no gap between them, for example: element index: 3, 2, 0, 1 will be ok, element index: 3, 2, 0 should return an error because the idx 1 is missing Secondly I think, that the validation of element index value may be required, cause for now we support 255 (uint8_t). Please let me know what do You thing of aboves. BR, Jakub Witowski Jakub Witowski (1): mesh: Validate element indexation mesh/node.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) -- 2.20.1