Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp5179577rwb; Wed, 21 Sep 2022 04:26:49 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7ELxEq69GoraCoRR42qK+MBdxHIHv86XOZ81NbxmcS4rxY0QrEQroU1YM5QLEjAAboCMpj X-Received: by 2002:a17:907:7609:b0:770:8665:dfd4 with SMTP id jx9-20020a170907760900b007708665dfd4mr19478567ejc.494.1663759609724; Wed, 21 Sep 2022 04:26:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1663759609; cv=pass; d=google.com; s=arc-20160816; b=vNAiPt7hSOhrD/E8ZdYcwxMkyQqJ1QbfLpVFVRX/qFlMiuiP3Ot6sgSsjkyT1wfjK7 ror6fSTPnEfTDml0QrsU3NDoTSF80ek0+CK2XhnDFYn9l56XFqfxT24av7yaiJKbaMfX fVQxoR/draFhyVQXsO9l46aRK/RT8D/uolOBLqYmoHyPaOfAqY5JrsfWdowbqk8OMBq9 /Tkw6Z/Nij17ljMDmzXNtXQd9IdTCmsRPfw1vM9HqZQ7Dr2kbTGruFbAa4lWZ1KSVvUH ioyKHYk35eR+KfEgeGymniiEUEaLspHmeMoQYflUIMlhsaUsP+J+QWGPXJR81VN2RWaY qFcQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Dr9l7AIIPCk+EeoqyB01vF9Fi1ucpPBAGwWASqexoE8=; b=sZBZNj79MwBVwou1XkvN8wW6W9DU+fnFR2KwshpQn6jUOaDShLr4TLmSt6a7r+P7CR kYzWjj/X+IpQgAQdXQa+RDO4MrQ7KsfpUyX9LwIZf3vTNzFXF61ioCTuT1Pg6787w0jO Qze2c5f5i2J9OesWBtQ5TyOxnF4Q0nKmIZr7YI51TXOEyfA3bUxREZRTE4dzDj9MiBaS VWXYFjWb9UR3b28IUuefHE2+/9s7krHqL4K5EE/NBpIBml66mwXUFPohySa7RaJdt+DG t7EODXoiob6LvxD6QC6gvcKnvSENswh6eky3MS76LaW8IOle3wQ52VK6X+HChMZI2XU7 bnKQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@hotmail.com header.s=selector1 header.b=qhYK+Khw; arc=pass (i=1); spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hotmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw5-20020a170906478500b00730d37d3f0asi2001169ejc.766.2022.09.21.04.26.22; Wed, 21 Sep 2022 04:26:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@hotmail.com header.s=selector1 header.b=qhYK+Khw; arc=pass (i=1); spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hotmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229522AbiIULRm (ORCPT + 99 others); Wed, 21 Sep 2022 07:17:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229545AbiIULRl (ORCPT ); Wed, 21 Sep 2022 07:17:41 -0400 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-oln040092069091.outbound.protection.outlook.com [40.92.69.91]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 810EB7756F for ; Wed, 21 Sep 2022 04:17:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T/3RaeG63tDBtl3jlHV0B1B6eW9Xzdr6PSiczvkjCc1RMRrEH0ITfgrmVDr7dXH4w5kKwOvpez4Ndwjfq8H/2oAkUcexRMc607UeOeIAzMi5sTGQpxeh8ysFdXJQtm56oJ6IQVI3NAxzkjKF25XicT8Des2BwvUn0cGKzV+CKXsXz0xqaq6QYRiZykK5rE7Cgu5lyksSmDJyvjZy7rgEwbgB6UjXSxG+mpQhkGby1pQMFLWmOf7lGJJwYN4KjCzOw5ErznG6rCSjmxYtHpZ9Vk/SGwpD9GNXqJ+1hrX07BlBxu90UrSnV65MJS+ozoDX7AW3X5wEkG6flvhyi1u3vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Dr9l7AIIPCk+EeoqyB01vF9Fi1ucpPBAGwWASqexoE8=; b=cXvf5moIWla3hFe02a8MCGufVasW4/Md+gJqzmDRljpMiI9+LFQZk68n3sJqVPNtDfkuvs+PrLrw6GpegIN7ce+cCh1121iamMRrc84fWOCRvHzrf+cmTMTJXj085W/jn0bckCV/YTR/wsLn2t4pSHwMpbXdqir6GlD2qCMhsUHvbRXZ8vOWUv8aXm1/ggUrzem8aBo07QX7XRf6bRHLAYHc/w8SRHvDYE//U++f9TNqFHxGSz5YX4JWU9UMYGiTlcyRHISfuEXc0KRG4q7FBZc7Tb8YAua73NRZfCuXld7iSPxUE2VUM6tq8DzS31czicODYRE+FjG1tnNtfDk6aQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Dr9l7AIIPCk+EeoqyB01vF9Fi1ucpPBAGwWASqexoE8=; b=qhYK+KhwEU83ZpWCgeWApzWciMJsTJGiKszKaFPGy4DZaMbzm9FyaEK8aKFX5+3RdrCclTA/ixEFA8Df+hf7d8stjOGPwmry1mY11rwLtJtTkDuZQPVBgBPSYYMUWb94m/XSD/sdrohkOAhHtFWgfxudLwdXpFIm0/EHnws1EPWq+TW6v00zGf9iAj9CL4cjNOqjpKS/BQUYngzuUoGTjU3JfMniXWHuomk9Vr+1pZ0b29fDRB5eBgGq9WKdoEZz7sTurd6EjiGwF8JztASJ1eKgxiRmv0l0Yu+BAsl3qTzPd37yBO+m1rtbrYbinWk5tu7wbx2XUCQFjxrUIAaXXA== Received: from VI1PR09MB4239.eurprd09.prod.outlook.com (2603:10a6:800:12f::23) by AS2PR09MB6342.eurprd09.prod.outlook.com (2603:10a6:20b:579::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.16; Wed, 21 Sep 2022 11:17:38 +0000 Received: from VI1PR09MB4239.eurprd09.prod.outlook.com ([fe80::adeb:7a9b:9960:27bf]) by VI1PR09MB4239.eurprd09.prod.outlook.com ([fe80::adeb:7a9b:9960:27bf%2]) with mapi id 15.20.5632.021; Wed, 21 Sep 2022 11:17:38 +0000 From: Isak Westin To: linux-bluetooth@vger.kernel.org Cc: Isak Westin Subject: [PATCH BlueZ v2 2/3] mesh: Do not accept publication for unbound appkey Date: Wed, 21 Sep 2022 13:16:29 +0200 Message-ID: X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220921111630.23589-1-isak.westin@hotmail.com> References: <20220921111630.23589-1-isak.westin@hotmail.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TMN: [nTm4Bam/qFbLim2/3u2CkZN9GoEB92Xu] X-ClientProxiedBy: ZRAP278CA0017.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:10::27) To VI1PR09MB4239.eurprd09.prod.outlook.com (2603:10a6:800:12f::23) X-Microsoft-Original-Message-ID: <20220921111630.23589-2-isak.westin@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR09MB4239:EE_|AS2PR09MB6342:EE_ X-MS-Office365-Filtering-Correlation-Id: 9e742cf7-d1b3-498f-73e1-08da9bc2e420 X-MS-Exchange-SLBlob-MailProps: ZILSnhm0P3lUkjXuSDdeTQka1McTh6g4fbbaNHcFdNnzsfNEqlJinPcbRlCG85P9V7MKfdaLCQ41HWzHgKgtwl2cz9+gnaedJ27vaFF9XlXc4LhClvqDs0C5jMwC93QFG9xf/td+q+bQNnu+ab7sPGll0Wk9ozNeM5nthjIja8knVcmoj6K/7PPzUouI4WdjuXS63gYJnQjn69/wiFvluB4Hyci3zzWEhDcm0QXQHN4toeY/ek7viseA3gXYMFYKlGuJKHYVjRcH7fSMkmtuOSzrn8wvluFJhkXy0lZpFXpPKGU6Wp1pq+HYv1DGcCQ2vCzOXBtPGiXxuxOjpv9CHt+nWJck/GMqOa1R1tPyQzgSO/74UYXPdM4kWLT2hYS3xwgmoKyMGw4jFKl8ffty9tjtev9sTY/Ka3LZnfzmuZU2hi1DtSBdZuWBG7rUKH0q9i5F9jswaWYol0NyPPkBx2lr5Wh2WcbhA3iqqQvN9+UiTMVrJNF6tnzkCkkcaU4oFXXJHu3nHl7gJiKO2IQnJk/vpUsqPnwfeieHjC4a510u2uRJz0QfM3sJe+HZTNb0U65j54PWfXZdnNLGPUw3u3eUKXLQlyFnsmRmyNzYu2ACkBeKMBlgb+VaXgXX7a+jIbaESrIY4v2xFJl1mXHE4mUiQ1SUn1CVOiKp/oGcxDCbijrDEgj9yICbd3PPk7WXc10TOk4QpwmI+KdEObigjqJ7LY8H7UjFkbYBrwBR6I6Y/C3Nh6Cs9lq7KYRR7aQv4wOheTLZHCAwqIrA+VTvkRYNyC8YVWhS X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: L/uMosWyFhVaDBQGFuhC7D+zuMd7wbb4iWdzfMMyNr1pjeV744IrIBvItDQNuEWc0S9WxEkOB9KmH2Gnn/6hNWs9/zGHu1jMqgu3OdvIGcsLkH3eDmZJBPMUEXIs0B4LJ/P2tAdiUqwrGZraDXTeSGwSIsJY8ruKPS/XifuqKGNgOkPGE2USXMs7c6+8cJN25o6b33cFpVGKWEIVw6z4Us37nLsTLn3A/zUlT+oUfJGlIBQa/bFcYQakWGStJm1jkgNUEoCO78C404PyCco4Zc3zpRl0zCmRpOT4ffzbReTvznWvoWM8LVl3ZDtYw7PLJOzwjdj8zEdjRyj7EtqSfoQbG37gIhDEgdQkvbcg4nJwmihifGGoBySn93TMoMkmwOgVCE7Q410ukmous3f3FEa0g5Zvca3kcXpCjXxARzrVdLMcgOJwSV6OW5/94V9a78Jo1bpzFvfiivgj9kevmvaKb4dNfyeJCRxhJisAnz3XP38BpYwyI8E37uV6oZCj4TGY/HwoyKqwQyHp7FZQRNWBEXGXSJRS6m6LDxHhca3MKyAHk2QxfvaozfkWLZOZ5QxrnVSYK5PoEjuB6WkwB6BHN4kjSnAkWxyIkZ8kzNNamgJZRGwA89ZLZ8qx140luPwXiPJtZZpc9PPF082ljQ== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?qrcpwzCcMKU7zeaO7cWw8mk2t30tuAxLChobL9t750PI1agSKUpl4XMlnIq1?= =?us-ascii?Q?884xY0PoDB+nBbAiqsPMPF9K55sG9e4fLfDjR2qgPOSolIjF3GAoYwU1FuMe?= =?us-ascii?Q?I6PHV+av+qm9v9lg2ArAc6bghwgnLjTnHiIFW45UlP1+bVWQZ7ldVsRs5wgu?= =?us-ascii?Q?OSl6NU4IhvsoL0+xAjp6EtuR0YqTwh9kaJR1MM9o5YLroFVYW+/YPbCF9A30?= =?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xuxtJPgPYteSEWF?= =?us-ascii?Q?NW9nyVHeOCcuNRhaIe4Tia/YQpitYV+3ovIDfoAEfvw9RlirWh6FnBv0F//h?= =?us-ascii?Q?jHsTtW6BWVlz1snhTHU8B2/xdYLUHzCuWN9573tue0N5pN3aGnx2CXsZmgMk?= =?us-ascii?Q?lzY4HmHASJRiUSpJu0PA3kAdkK0nUS3N3Nnfoqvv2g=3D=3D?= X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-64da6.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 9e742cf7-d1b3-498f-73e1-08da9bc2e420 X-MS-Exchange-CrossTenant-AuthSource: VI1PR09MB4239.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2022 11:17:38.2607 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR09MB6342 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org If a user tries to configure publication of a model with an appkey that is not bound to that model, an error should be returned. --- mesh/model.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mesh/model.c b/mesh/model.c index 82078ed85..d48e6ef12 100644 --- a/mesh/model.c +++ b/mesh/model.c @@ -1063,7 +1063,8 @@ int mesh_model_pub_set(struct mesh_node *node, uint16_t addr, uint32_t id, if (!mod->pub_enabled || (mod->cbs && !(mod->cbs->pub))) return MESH_STATUS_INVALID_PUB_PARAM; - if (!appkey_have_key(node_get_net(node), idx)) + if (!appkey_have_key(node_get_net(node), idx) || + !has_binding(mod->bindings, idx)) return MESH_STATUS_INVALID_APPKEY; /* -- 2.20.1