Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1103782

Summary: race condition in setting firewall zone for active connection
Product: Red Hat Enterprise Linux 7 Reporter: Vladimir Benes <vbenes>
Component: NetworkManagerAssignee: Thomas Haller <thaller>
Status: CLOSED ERRATA QA Contact: Desktop QE <desktop-qa-list>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 7.1CC: danw, dcbw, jklimes, jkurik, jruemker, thaller
Target Milestone: rcKeywords: ZStream
Target Release: 7.1   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: NetworkManager-0.9.9.1-22.git20140326.4dba720.el7_0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1104728 (view as bug list) Environment:
Last Closed: 2015-03-05 13:51:28 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:
Bug Depends On:    
Bug Blocks: 1104728    
Attachments:
Description Flags
firewalld log with error in the end
none
journal log targzed none

Description Vladimir Benes 2014-06-02 14:22:15 UTC
Description of problem:
I can see a ZONE_CONFLICT error in logs sporadically but reproducibly after service firewalld restart, adding connection with autoconnect yes and then modifying it while NM auto connecting it.    

Version-Release number of selected component (if applicable):
NetworkManager-0.9.9.1-19.git20140326.4dba720.el7_0.x86_64

How reproducible:
once in 50 cases. have beaker job that catches it everytime.

Steps to Reproduce:
1.restart firewalld service
2.nmcli connection add type ethernet ifname eth0 con-name ethie
3.nmcli connection edit ethie
4.set connection.zone drop
5.nmcli connection up id ethie
6.check zone via firewall-cmd --zone=drop --list-all

Actual results:
sometimes there is ZONE_CONFLICT in logs and device not added to desired zone

Expected results:
no conflict, device correctly in the desired zone

Additional info:

Comment 1 Vladimir Benes 2014-06-02 14:24:53 UTC
Created attachment 901468 [details]
firewalld log with error in the end

Comment 2 Vladimir Benes 2014-06-02 14:28:28 UTC
Created attachment 901469 [details]
journal log targzed

Comment 3 Jirka Klimes 2014-06-02 14:35:36 UTC
*** Bug 1103781 has been marked as a duplicate of this bug. ***

Comment 4 Thomas Haller 2014-06-03 07:16:55 UTC
Please review branch th/rh1103782_firewall_zone_conflict.

It contains some cleanup/refactoring, that I did while fixing this. First I thought I would need them, but in the end the actual fix was much simpler. They are not needed, but I would still apply them as cleanup.

Comment 5 Jirka Klimes 2014-06-04 08:59:45 UTC
> firewall: refactor CBInfo data in NMFirewallManager
I don't like declaring  char iface[1]; and then allocating it dynamically. It is kind of unexpected.

Other than that, the branch looks good.

Comment 6 Vladimir Benes 2014-06-04 10:35:10 UTC
*** Bug 1104566 has been marked as a duplicate of this bug. ***

Comment 7 Dan Winship 2014-06-04 12:30:51 UTC
(In reply to Jirka Klimes from comment #5)
> > firewall: refactor CBInfo data in NMFirewallManager
> I don't like declaring  char iface[1]; and then allocating it dynamically.

agreed. drop that patch.

If we're always going to be passing FALSE for the "add" parameter to nm_firewall_manager_add_or_change_zone(), and always passing NULL for the "zone" parameter to nm_firewall_manager_remove_from_zone(), then we should probably just remove those arguments and the code that handles them. But that could be done as an additional patch on master separate from the z-stream fix.)

Comment 12 Vladimir Benes 2014-10-27 16:39:05 UTC
it looks like I can see the bug again:

after setting zone to drop, firewalld is stopped and connection upping fails.

Comment 13 Vladimir Benes 2014-10-27 16:40:43 UTC
uhm, connection upping works but then I cannot see device via
firewall-cmd --zone=drop --list-all

Comment 14 Thomas Haller 2014-10-27 17:23:16 UTC
(In reply to Vladimir Benes from comment #13)
> uhm, connection upping works but then I cannot see device via
> firewall-cmd --zone=drop --list-all

Can you show a logfile? Or a failed test case?

Comment 18 errata-xmlrpc 2015-03-05 13:51:28 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/RHBA-2015-0311.html