Bug 2222044 - systemd restart firewalld.service compounds rules when CleanUpOnExit=no
Summary: systemd restart firewalld.service compounds rules when CleanUpOnExit=no
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: firewalld
Version: 8.8
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Eric Garver
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-11 16:27 UTC by Curtis Taylor
Modified: 2023-08-14 15:39 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-162043 0 None None None 2023-07-11 16:29:06 UTC
Red Hat Knowledge Base (Solution) 7024524 0 None None None 2023-07-13 13:42:31 UTC

Description Curtis Taylor 2023-07-11 16:27:23 UTC
Description of problem:
restarting firewalld.service resultes in more rules every restart, eventually slowing the system.

Version-Release number of selected component (if applicable):
First began in firewalld 0.8.0-4 and confirmed through 

How reproducible:
Easily on an RHEL system with firewalld 0.8.0-4 or newer.

Steps to Reproduce:
1. Install firewalld 0.8.0-4 or newer.
2. Set CleanUpOnExit=no in /etc/firewalld/firewalld.conf
3. systemctl restart firewalld  ### to make new setting effective
4. nft list ruleset | wc -l
5. systemctl restart firewalld
6. nft list ruleset | wc -l

Actual results:
After ever restart the ruleset grows

Expected results:
After restart of firewalld.service ruleset does not grow.

Additional info:
firewall-cmd --reload, or systemctl reload firewalld, which send SIGHUP instead of stop/start firewalld, the ruleset does not grow even with FlushAllOnReload=no:

FlushAllOnReload=no:

# nft list ruleset | wc -l
528
# firewall-cmd --reload
success
# nft list ruleset | wc -l
528

Customer uses CleanUpOnExit=no to avoid all windows where firewall rules might not exist.

Comment 1 Curtis Taylor 2023-07-11 16:33:19 UTC
* versions where seen  was incomplete in description *

Version-Release number of selected component (if applicable):
First began in firewalld 0.8.0-4 and confirmed through (current)  _ firewalld-1.2.1-1.el9 _

Comment 2 Eric Garver 2023-08-10 15:20:50 UTC
Upstream PR: https://github.com/firewalld/firewalld/pull/1192

Comment 3 Eric Garver 2023-08-14 15:39:26 UTC
Upstream commits:

c66e752a00c0 ("test(CleanUpOnExit): verify restart does not duplicate rules")
6a155ea7195f ("fix(nftables): always flush main table on start")
8be561d26931 ("chore(nftables): add delete table helper")


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