Bug 1999152
| Summary: | selinux-policy needs to allow CAP_SYS_MODULE for firewalld | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | Eric Garver <egarver> | 
| Component: | selinux-policy | Assignee: | Zdenek Pytela <zpytela> | 
| Status: | CLOSED ERRATA | QA Contact: | Milos Malik <mmalik> | 
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | unspecified | CC: | egarver, lvrabec, mmalik, qe-baseos-daemons, ssekidde, todoleza | 
| Target Milestone: | rc | Keywords: | Triaged | 
| Target Release: | 9.0 | Flags: | pm-rhel:
                mirror+
                 | 
  
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | selinux-policy-34.1.16-1.el9 | Doc Type: | No Doc Update | 
| Doc Text: | Story Points: | --- | |
| Clone Of: | 1999102 | Environment: | |
| Last Closed: | 2022-05-17 15:49:27 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: | 1999102 | ||
| 
 
        
          Description
        
        
          Eric Garver
        
        
        
        
        
          2021-08-30 14:17:53 UTC
        
       
      
      
      
    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 Commit to backport:
commit dabb900c7b0e96b575edcbb7e032e603be83c716
Author: Zdenek Pytela <zpytela>
Date:   Thu Sep 9 16:02:27 2021 +0200
    Allow firewalld load kernel modules
    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  |