Bug 1853774

Summary: iptables-services load sysctl.d/ indiscriminately of .conf suffix
Product: Red Hat Enterprise Linux 8 Reporter: Tomas Dolezal <todoleza>
Component: iptablesAssignee: Phil Sutter <psutter>
Status: CLOSED ERRATA QA Contact: Tomas Dolezal <todoleza>
Severity: medium Docs Contact:
Priority: unspecified    
Version: ---CC: iptables-maint-list, todoleza
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: iptables-1.8.4-15.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 01:54:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tomas Dolezal 2020-07-03 22:24:28 UTC
Description of problem:
On rhel8 the sysctl.d is governed by systemd (man:SYSCTL.D(5)) which describes that only applicable files in allowed paths are of '*.conf' format. iptables initscript does not reflect that in its load_sysctl function that seeks in '/etc/sysctl.d/*' glob.

Version-Release number of selected component (if applicable):
iptables-1.8.4-10.el8_2.1.x86_64

How reproducible:
always

Steps to Reproduce:
uncomment following line in /etc/sysconfig/iptables-config:
#IPTABLES_SYSCTL_LOAD_LIST=".nf_conntrack .bridge-nf
use e.g.
echo 'net.nf_conntrack_max = 120838' >> /etc/sysctl.d/foo.anysuffix
restart iptables service

Actual results:
sysctl from any file is loaded

Expected results:
.conf suffixes are respected

Additional info:

Comment 2 Phil Sutter 2020-07-06 16:05:50 UTC
This should be a trivial RHEL-only fix to iptables init script like so:

--- a/iptables.init
+++ b/iptables.init
@@ -134,7 +134,7 @@ load_sysctl() {
         echo -n $"Loading sysctl settings: "
         ret=0
         for item in $IPTABLES_SYSCTL_LOAD_LIST; do
-            fgrep -hs $item /etc/sysctl.d/* | sysctl -p - >/dev/null
+            fgrep -hs $item /etc/sysctl.d/*.conf | sysctl -p - >/dev/null
             let ret+=$?;
         done
         [ $ret -eq 0 ] && success || failure

Comment 8 errata-xmlrpc 2020-11-04 01:54:58 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 (iptables bug fix and enhancement update), 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://access.redhat.com/errata/RHBA-2020:4518