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.
+++ This bug was initially created as a clone of Bug #1999102 +++
Description of problem:
With default capabilities (NET_ADMIN, NET_RAW), firewalld
is unable to insert nf_nat_ftp module when activating the ftp service.
Version-Release number of selected component (if applicable):
firewalld-1.0.0-2.el9
How reproducible:
Always.
Steps to Reproduce:
1. start firewalld with --debug
2. firewall-cmd --add-service ftp
3. /var/log/firewalld contains "modprobe: ERROR: could not insert 'nf_nat_ftp': Operation not permitted"
Actual results:
[root@ci-vm-10-0-137-226 ~]# rpm -q selinux-policy firewalld
selinux-policy-34.1.14-1.el9.noarch
firewalld-1.0.0-2.el9.noarch
[root@ci-vm-10-0-137-226 ~]# sed -i -e 's/^\(FIREWALLD_ARGS=\).*$/\1--debug/' /etc/sysconfig/firewalld
[root@ci-vm-10-0-137-226 ~]# cat /etc/sysconfig/firewalld
# firewalld command line args
# possible values: --debug
FIREWALLD_ARGS=--debug
[root@ci-vm-10-0-137-226 ~]# systemctl start firewalld
[root@ci-vm-10-0-137-226 ~]# firewall-cmd --add-service ftp
success
[root@ci-vm-10-0-137-226 ~]# grep ERROR /var/log/firewalld
2021-08-30 07:41:53 DEBUG1: modprobe: ERROR: could not insert 'nf_nat_ftp': Operation not permitted
Expected results:
The module insertion succeeds.
Additional info:
When firewalld runs with full capabilities the problem does not occur (the module is inserted successfully).
--- Additional comment from Eric Garver on 2021-08-30 14:07:47 UTC ---
So we do need CAP_SYS_MODULE in RHEL-9. I'm passing this to selinux-policy so they can update the firewalld policy.
--- Additional comment from Eric Garver on 2021-08-30 14:13:12 UTC ---
(In reply to Eric Garver from comment #1)
> So we do need CAP_SYS_MODULE in RHEL-9. I'm passing this to selinux-policy
> so they can update the firewalld policy.
My bad. We still nede the firewalld bug to backport:
13801962073f ("fix(firewalld): keep linux capability CAP_SYS_MODULE")
I have patched firewalld to use CAP_SYS_MODULE policy and it currently works, although it should not. ref. bz1999102#c4
selinux-policy-34.1.14-1.el9.noarch
sesearch -A -s firewalld_t -c capability
allow firewalld_t firewalld_t:capability { net_admin net_raw setpcap };
pscap | grep firewalld
1 1751 root firewalld net_admin, net_raw, sys_module +
Tomas/Eric,
Can I get the firewalld package version which reproduces the missing permission problem in selinux-policy? The latest one available does not seem so.
beaker-rhel9# rpm -q firewalld
firewalld-1.0.0-2.el9.noarch
beaker-rhel9# pscap | grep firewalld
1 26173 root firewalld net_admin, net_raw +
beaker-rhel9# firewall-cmd --add-service ftp
success
beaker-rhel9# grep ERROR /var/log/firewalld
2021-09-08 09:26:45 DEBUG1: modprobe: ERROR: could not insert 'nf_nat_ftp': Operation not permitted
beaker-rhel9# lsmod |grep nf_nat_ftp
<>
beaker-rhel9# ausearch -i -m avc,user_avc -ts recent
<no matches>
beaker-rhel9# getenforce
Permissive
The -3 package version looks as expected and this workaround makes the scenario working:
beaker-rhel9# cat local_firewalld.cil
(allow firewalld_t firewalld_t (capability (sys_module)))
beaker-rhel9# semodule -i local_firewalld.cil
I've submitted a Fedora PR to address the issue:
https://github.com/fedora-selinux/selinux-policy/pull/866
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 (new packages: selinux-policy), 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-2022:3918