From patchwork Sun Aug 30 21:10:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Dobrovolsky X-Patchwork-Id: 1354029 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=hN2xHF7L; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=c9RYYdg7; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BfmJD74d8z9sSP for ; Mon, 31 Aug 2020 07:12:43 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=ey7u4SzDpxYFD0+Vy+oJnzoE2S18i564mfO1QTkk3OE=; b=hN2xHF7LB6UAfJtB00Gm7+r9Iw WmU/0holJHXMhcHTwSi2iZFXdd6/Omi+5W4Tl6hadkJPB6LnsVa7lNZV/6FxK5ZFf6Y1XJTP41fU1 wjXEbEiQWAs3cGOQSKiY2EwZznu90MUtXiZGJwfgBegaafUiNz1ADuYNCWwugedtP93qsi1gzdOwv 60Tkc8irQDBxfcSRFTA4SVQ/WAorttqndKnFb4B9OsAfyiLYQBrZ3AotuIoyITb6140dN9iZ42OGW bPHF+tdhNN6EGtkBSxDWgRC/s1itwM+9xxDmayz7EPjo14AuFnZSr9caBCVDBnagbfoD+Yei74qDY nZHvhfIg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kCUbE-000764-A4; Sun, 30 Aug 2020 21:10:52 +0000 Received: from mail-lf1-x144.google.com ([2a00:1450:4864:20::144]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kCUb9-00075S-Le for openwrt-devel@lists.openwrt.org; Sun, 30 Aug 2020 21:10:48 +0000 Received: by mail-lf1-x144.google.com with SMTP id 12so2391060lfb.11 for ; Sun, 30 Aug 2020 14:10:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=eoFL3ULyEwH/726hqLBJM9+e5w+LhhcdOZRLMpo/vMs=; b=c9RYYdg7nflKAe938+gMoBsjLg0bXkMCm8NBXJmIMaAQZi1wSYxmRuGgWplIsp9UKB 0zwHpKdsQDdB6OcEKD5QgxOAFGv2bqGUCIHBWwSiyCOEQcXE+tGn+iSsigPHT/YJB5BM dnXDCc2sdCbywQyvcNkuzMuNmM0+KtSswky546YiPKESTBAqpiZzPSbozrlmpx6cr5vW LuPV6QmvcBkZDfJ7v9s1XvS9RsdWzacEWV5MhSQvXoSH91KeFoGcna4PK8sJcSoj1Fzk 1hZU0fdLJ1iLxfdkU2TYFio1XM6z5cnQAI2QmaJkTv0i/6iZxYzfGRXN/tJC4LmRES1B TibA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=eoFL3ULyEwH/726hqLBJM9+e5w+LhhcdOZRLMpo/vMs=; b=E3urm/UtvDxdl7MOjapRFMhFhyDVNGzNvNpyBEOkLtmE/KuwyxdvK9Q2M/4lgf58XV hTum0YA6nD61XkyZWryLHEEWtQKZ2fsxShuhqLS6tI3DYGL/sX0edwhAAvudZK/5VZaq rQtwwhDz5Z/gCE0wHeF/GbrNXY/7n9JrNYrUKBWZtFzKpzQ+T6Qk3zuipjipsBgR+7LQ 3Xiw3fq+MtkyCJvJ/a/d+i26nv5eAwWULtFDrd6Z5hlFuhBdk2P+PxRYjoKaUl2CZM0K gKHPQvTmLYxv1LdRtMU7bSGaClkwbteEl0i7dN8MPLjNweVpQxZGsMHCeKRzb+H1i7PW Hucw== X-Gm-Message-State: AOAM530UJLZtLQrYKmknVEqa4W/peM/TDii2qci9H0JyAnc/TOqDzrRW alBQpBvlcDuLePn2b7TWTsA= X-Google-Smtp-Source: ABdhPJx3sXjNULutbFAGJaFM6ErZ9W6w7GwyyaxRaC2D7GnuGOSraS9Rsb9fnG1rCtLhob24CHFWAg== X-Received: by 2002:ac2:4c05:: with SMTP id t5mr4163187lfq.89.1598821844560; Sun, 30 Aug 2020 14:10:44 -0700 (PDT) Received: from localhost.localdomain (ip-95-220-29-46.bb.netbynet.ru. [95.220.29.46]) by smtp.gmail.com with ESMTPSA id j11sm1458716lfe.96.2020.08.30.14.10.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Aug 2020 14:10:43 -0700 (PDT) From: Alexey Dobrovolsky To: Jo-Philipp Wich , openwrt-devel@lists.openwrt.org Subject: [PATCH] fw3: zones: limit zone names to 11 bytes Date: Mon, 31 Aug 2020 00:10:09 +0300 Message-Id: <20200830211009.3359-1-dobrovolskiy.alexey@gmail.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200830_171047_727426_BADDACF5 X-CRM114-Status: GOOD ( 10.71 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:144 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [dobrovolskiy.alexey[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexey Dobrovolsky MIME-Version: 1.0 Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org As defined in currently used iptables v1.8.4 [0], [1], chain name must be under 29 chars. Thus, user can only edit 11 chars. See also [3]. [0] https://git.netfilter.org/iptables/tree/iptables/xtables.c?h=v1.8.4&id=2b506c6681c7b01803f06b258a39e9da9012e5c5#n1004 [1] https://git.netfilter.org/iptables/tree/include/linux/netfilter/x_tables.h?h=v1.8.4&id=2b506c6681c7b01803f06b258a39e9da9012e5c5#n7 [3] https://dev.archive.openwrt.org/ticket/20380 Signed-off-by: Alexey Dobrovolsky --- zones.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zones.h b/zones.h index d786736..05f8554 100644 --- a/zones.h +++ b/zones.h @@ -22,8 +22,11 @@ #include "options.h" #include "iptables.h" -/* 32 - sizeof("postrouting_") - sizeof("_rule") - sizeof("\0") */ -#define FW3_ZONE_MAXNAMELEN 14 +/* + * chain name in iptables must be under 29 chars + * 29 - sizeof("postrouting_") - sizeof("_rule") - sizeof("\0") + */ +#define FW3_ZONE_MAXNAMELEN 11 extern const struct fw3_option fw3_zone_opts[];