Bug 1841829

Summary: Fix for segfault with '-F' in iptables dumps
Product: Red Hat Enterprise Linux 8 Reporter: Phil Sutter <psutter>
Component: iptablesAssignee: Phil Sutter <psutter>
Status: CLOSED ERRATA QA Contact: Jiri Peska <jpeska>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.3CC: iptables-maint-list, todoleza
Target Milestone: rc   
Target Release: 8.3   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: iptables-1.8.4-14.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 Phil Sutter 2020-05-29 15:05:26 UTC
When restoring a dump file containing '-F' (chain flush) commands, iptables-restore may segfault if a rule was added to that chain in the same dump before.

Fixed by upstream commit:

commit 5bd3ab5c778033877d44a0c619ef6f98f34516af
Author: Phil Sutter <phil>
Date:   Fri Apr 24 11:32:08 2020 +0200

    nft: Fix for '-F' in iptables dumps
    
    When restoring a dump which contains an explicit flush command,
    previously added rules are removed from cache and the following commit
    will try to create netlink messages based on freed memory.
    
    Fix this by weeding any rule-based commands from obj_list if they
    address the same chain.
    
    Signed-off-by: Phil Sutter <phil>

This commit adds a relevant testcase:

commit f2ace0cdf25a5911ac84015829d65d6050a5e82d
Author: Phil Sutter <phil>
Date:   Tue Apr 21 14:10:53 2020 +0200

    tests: shell: Test -F in dump files
    
    While not really useful, iptables-nft-restore shouldn't segfault either.
    This tests the problem described in nfbz#1407.
    
    Signed-off-by: Phil Sutter <phil>

Comment 6 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