Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp141335rwb; Tue, 4 Oct 2022 01:43:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ZQc3b2eMFNCtCXRoV6gZWk8YzLJ0GLvovpMBepPkucjjGhnxpYv/RxJ/cxi2yKsYmRkeX X-Received: by 2002:a05:6a00:1486:b0:557:f3c7:219f with SMTP id v6-20020a056a00148600b00557f3c7219fmr27088602pfu.0.1664872989436; Tue, 04 Oct 2022 01:43:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664872989; cv=none; d=google.com; s=arc-20160816; b=hzu53nSjW/jpzWo6nRLPlO1+0O0Vgq1lJOOupQ7aA5n/fEySSP1k4s53tp2gadEx4q 3YqFy8e2bhAToYW4VvEo01en26jGhC26JzwEny3kJlulfWbJJ32kyWtnVhpifZTPHgQA RIX05zarTSvqT1Lnxaat/qse+StRxga8B/78aVr6wxHtHoK1I3DpRbo49ttatu0k1K/+ agbgyCJMVbtSa9fbGkCYqP6KLRU9KvdGPsPffEqYvNP68j6JzyvexE3Lcfa4Do3YpRiu RDjcvbkoNhsQvXeqQXrVoTmGXVRSBoQxwNn4/5RlpM0ihXXjW4kkwbqjrPvbIYsezw4i DiQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=CS1NiDY5Nw/GVS2H06w5L/JmO5otU1cAD2qxObzwTok=; b=LPTsBHoBIwyGSB2XZuaCArdSv8rR7kmEo4eOvXXeRRuglRQmg94UjYlWheulaMeQQg VFB9mJq7bzhryEWGy5gRHkgvYskpxsyq8/4Lt79tkfTmabGP7wl2TFSoXrHJB6+SHho+ I5ezVwt8WQNL2N3YIl0xPlQpeYT6lsTu6OPA5c8RhFeuCD6J8TakS/GGRSwVpM5SIDuA 9Rx9ZKBchpVectpcd/CHe/ikprfR75ppnoRILFEZEUjjEH0UrNhX4w1+jWeXjTRFhwLB TAOKkMz2OHgw6jbcwX2DbZmi0xrpupodXZ5KirG93FgpbNyiY0FfvC+o+DRVYXYJxMmI e3Yg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k22-20020a056a00135600b00535e3dc1519si10844294pfu.64.2022.10.04.01.42.08; Tue, 04 Oct 2022 01:43:09 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229895AbiJDIZ4 (ORCPT + 99 others); Tue, 4 Oct 2022 04:25:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230144AbiJDIZz (ORCPT ); Tue, 4 Oct 2022 04:25:55 -0400 Received: from voyager.loytec.com (voyager.loytec.com [88.198.4.4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B5CD22B05 for ; Tue, 4 Oct 2022 01:25:53 -0700 (PDT) Received: from 212-17-98-152.static.upcbusiness.at ([212.17.98.152] helo=lexx.office.loytec.com) by voyager.loytec.com with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ofdFP-0002Gv-TA for linux-bluetooth@vger.kernel.org; Tue, 04 Oct 2022 10:25:51 +0200 Received: from loytec-dev-vm.delta.corp ([10.101.25.21]) by lexx.office.loytec.com (8.15.2/8.15.2/Some OS 1.2.3-4.5) with ESMTP id 2948PkTb2433476; Tue, 4 Oct 2022 10:25:49 +0200 From: Isak Westin To: linux-bluetooth@vger.kernel.org Cc: Isak Westin Subject: [PATCH BlueZ 2/4] mesh: Verify padding bits in Friend Poll messages Date: Tue, 4 Oct 2022 10:25:28 +0200 Message-Id: <20221004082530.25719-3-isak.westin@loytec.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20221004082530.25719-1-isak.westin@loytec.com> References: <20221004082530.25719-1-isak.westin@loytec.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 212.17.98.152 X-SA-Exim-Mail-From: isak.westin@loytec.com X-SA-Exim-Scanned: No (on voyager.loytec.com); SAEximRunCond expanded to false X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE 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 The padding bits in a Friend Poll message must be zero. See MshPRFv1.0.1 section 3.6.5.1. --- mesh/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesh/net.c b/mesh/net.c index 379a6e250..a8a527c2f 100644 --- a/mesh/net.c +++ b/mesh/net.c @@ -2059,7 +2059,7 @@ static bool ctl_received(struct mesh_net *net, uint32_t net_key_id, break; case NET_OP_FRND_POLL: - if (len != 1 || ttl) + if (len != 1 || ttl || pkt[0] > 1) return false; print_packet("Rx-NET_OP_FRND_POLL", pkt, len); -- 2.20.1