From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 8834676007 for ; Thu, 22 Apr 2021 19:04:07 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 6B88420044 for ; Thu, 22 Apr 2021 19:03:37 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id ABEDA20034 for ; Thu, 22 Apr 2021 19:03:35 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 74D4A46271 for ; Thu, 22 Apr 2021 19:03:35 +0200 (CEST) Message-ID: <2c5178ab-281a-6d54-307c-d505f037d188@proxmox.com> Date: Thu, 22 Apr 2021 19:03:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:89.0) Gecko/20100101 Thunderbird/89.0 Content-Language: en-US To: Proxmox VE development discussion , Aaron Lauterer References: <20210422123010.14006-1-a.lauterer@proxmox.com> From: Thomas Lamprecht In-Reply-To: <20210422123010.14006-1-a.lauterer@proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.017 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [firewall.pm, netfilter.org] Subject: [pve-devel] applied: [PATCH firewall] fix #967: source: dest: limit length X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2021 17:04:07 -0000 On 22.04.21 14:30, Aaron Lauterer wrote: > iptables-restore has a buffer limit of 1024 for paramters [0]. > > If users end up adding a long list of IPs in the source or dest field > they might reach this limit. The result is that the rule will not be > applied and pve-firewall will show some error in the syslog which will > be "hidden" for most users. > > Enforcing a smaller limit ourselves should help to avoid any such > situation. 512 characters should help to not run into any problems that > stem from differences in what counts as character. If people need longer > lists, using IP sets are the better approach anyway. > > [0] http://git.netfilter.org/iptables/tree/iptables/xshared.c?h=v1.8.7#n469 > > Signed-off-by: Aaron Lauterer > --- > src/PVE/Firewall.pm | 2 ++ > 1 file changed, 2 insertions(+) > > applied, thanks! Even in the worst case IP-address length, namely Ipv4-mapped IPv6 (which we do not really support anyway, so only as theoretical worst-case), for example: "0000:0000:0000:0000:0000:ffff:192.168.100.228", there we would need 45 + 1 characters per entry plus separator, so even then one could add 11 IPs in there, which is IMO more than enough for direct apply - IPsets should be preferred, like you hint in the gui patch anyway.