RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1349903 - FirewallD fails to parse direct rules with a lot of destination addresses
Summary: FirewallD fails to parse direct rules with a lot of destination addresses
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: firewalld
Version: 7.2
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Thomas Woerner
QA Contact: Tomas Dolezal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-06-24 13:30 UTC by Thiago Basilio
Modified: 2016-11-03 21:03 UTC (History)
2 users (show)

Fixed In Version: firewalld-0.4.2-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 21:03:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:2597 0 normal SHIPPED_LIVE Moderate: firewalld security, bug fix, and enhancement update 2016-11-03 12:11:47 UTC

Description Thiago Basilio 2016-06-24 13:30:29 UTC
Description of problem:
On FirewallD you have two options when dealing with DIRECT rules:
... 1) Inserting them temporary using firewall-cmd --direct command;
... 2) Permanently storing them into the XML file (/etc/firewalld/direct.xml);

In RHEL 7.2 the current FirewallD version is 0.3.9.

If the administrator inserts DIRECT rules with lots of destination addresses using method 1, it works and the rule is inserted.
If the method 2 is used, when the administrator reloads FirewallD (firewall-cmd --reload) the rules will not be inserted (decode error, lack of arguments, incomplete arguments).

Version-Release number of selected component (if applicable):
-

How reproducible:
Create some DIRECT rules using firewall-cmd --permanent --direct <RULE> with lots of destination addresses.

Steps to Reproduce:
1. Clear all DIRECT rules, backup your /etc/firewalld/direct.xml file.

2. Clear /etc/firewalld/direct.xml file, insert the rules for testing.
You can break things using this script:
#!/bin/bash
ADDRS=$(for i in $(seq 1 49); do for j in $(seq 1 255); do echo -n "1.1.$i.$j,"; done; done; echo "1.2.0.0")
CMD="firewall-cmd -q --permanent --direct --add-rule ipv4 mangle PREROUTING"
$CMD 1 -s 1.0.0.0/24 -d $ADDRS -j MARK --set-mark 1 -m comment --comment "MARK ADDRS"

3. Reload the firewall (firewall-cmd --reload) and check its logfile (/var/log/firewalld) for parse/command error(s).

Actual results:
Rules are not inserted on firewall because of decode error(s) and/or missing/incomplete iptables arguments.

Example log:
2016-06-24 10:24:32 WARNING: COMMAND_FAILED: '/sbin/iptables -w2 -t mangle -I PREROUTING_direct 1 26.27,1.1.26.28,1.1.26.29,1.1.26.30,1.1.26.31,1.1.26.32,1.1.26.33,1.1.26.34,1.1.26.35,1.1.26.36,1.1.26.37,1.1.26.38,1.1.26.39,1.1.26.40,1.1.26.41,1.1.26.42,1.1.26.43,1.1.26.44,1.1.26.45,1.1.26.46,1.1.26.47,1.1.26.48,1.1.26.49,1.1.26.50,1.1.26.51,1.1.26.52,1.1.26.53,1.1.26.54,1.1.26.55,1.1.26.56,1.1.26.57,1.1.26.58,1.1.26.59,1.1.26.60,1.1.26.61,1.1.26.62,1.1.26.63,1.1.26.6 <SNIP>

Expected results:
All rules on /etc/firewalld/direct.xml should be parsed and inserted properly on the firewall.

Additional info:

Comment 1 Thomas Woerner 2016-06-24 13:33:48 UTC
Here is the upstream patch: https://github.com/t-woerner/firewalld/commit/3451763190a7d997613ab6eb448271d778999d6c

Comment 7 errata-xmlrpc 2016-11-03 21:03:11 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2016-2597.html


Note You need to log in before you can comment on or make changes to this bug.