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 2083509 - samba-dcerpcd and samba rpcd programs need selinux-policy permissions
Summary: samba-dcerpcd and samba rpcd programs need selinux-policy permissions
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: selinux-policy
Version: 9.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: 9.1
Assignee: Zdenek Pytela
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On: 2083504
Blocks: 2083511
TreeView+ depends on / blocked
 
Reported: 2022-05-10 09:30 UTC by Pavel Filipensky
Modified: 2022-12-15 16:18 UTC (History)
6 users (show)

Fixed In Version: selinux-policy-34.1.34-1.el9
Doc Type: No Doc Update
Doc Text:
Clone Of: 2083504
: 2083511 (view as bug list)
Environment:
Last Closed: 2022-11-15 11:13:50 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github fedora-selinux selinux-policy pull 1219 0 None Merged Add support for samba-dcerpcd 2022-06-09 07:50:17 UTC
Github fedora-selinux selinux-policy pull 1227 0 None open Update policy for samba-dcerpcd 2022-06-09 07:50:17 UTC
Red Hat Issue Tracker RHELPLAN-121543 0 None None None 2022-05-10 10:04:09 UTC
Red Hat Product Errata RHBA-2022:8283 0 None None None 2022-11-15 11:14:09 UTC

Description Pavel Filipensky 2022-05-10 09:30:05 UTC
+++ This bug was initially created as a clone of Bug #2083504 +++

After RHEL 9.1 rebase to samba 4.16.1 the samba test fails because of missing selinux policy permissions. Samba has added new programs (Release Notes https://www.samba.org/samba/history/samba-4.16.0.html).

Please give the needed permissions to these programs:

# ls -lZ /usr/libexec/samba/
lrwxrwxrwx. 1 root root system_u:object_r:bin_t:s0      34 Apr 23  2021 cups_backend_smb -> /etc/alternatives/cups_backend_smb
-rwxr-xr-x  1 root root ?                          1428008 Feb 15 12:31 rpcd_classic
-rwxr-xr-x  1 root root ?                            45168 Feb 15 12:31 rpcd_epmapper
-rwxr-xr-x  1 root root ?                            78104 Feb 15 12:31 rpcd_fsrvp
-rwxr-xr-x  1 root root ?                           424552 Feb 15 12:31 rpcd_lsad
-rwxr-xr-x  1 root root ?                           128712 Feb 15 12:31 rpcd_mdssvc
-rwxr-xr-x  1 root root ?                            28768 Feb 15 12:31 rpcd_rpcecho
-rwxr-xr-x  1 root root ?                           512976 Feb 15 12:31 rpcd_spoolss
-rwxr-xr-x  1 root root ?                            90712 Feb 15 12:31 rpcd_winreg
-rwxr-xr-x  1 root root ?                           525464 Feb 15 12:31 samba-bgqd
-rwxr-xr-x  1 root root ?                           197960 Feb 15 12:31 samba-dcerpcd


The denied access is here:


avc:  denied  { write } for  pid=53381 comm="samba-dcerpcd" name="samba-dcerpcd.pid" dev="tmpfs"
avc:  denied  { setgid } for  pid=53485 comm="rpcd_lsad"


and here:


type=AVC msg=audit(1652102482.309:2296): avc:  denied  { setgid } for  pid=52973 comm="rpcd_lsad" capability=6  scontext=system_u:system_r:winbind_t:s0 tcontext=system_u:system_r:winbind_t:s0 tclass=capability permissive=0            
type=AVC msg=audit(1652102482.934:2300): avc:  denied  { setgid } for  pid=52995 comm="rpcd_lsad" capability=6  scontext=system_u:system_r:winbind_t:s0 tcontext=system_u:system_r:winbind_t:s0 tclass=capability permissive=0
type=AVC msg=audit(1652102483.579:2304): avc:  denied  { setgid } for  pid=53015 comm="rpcd_lsad" capability=6  scontext=system_u:system_r:winbind_t:s0 tcontext=system_u:system_r:winbind_t:s0 tclass=capability permissive=0
type=AVC msg=audit(1652102484.263:2308): avc:  denied  { setgid } for  pid=53035 comm="rpcd_lsad" capability=6  scontext=system_u:system_r:winbind_t:s0 tcontext=system_u:system_r:winbind_t:s0 tclass=capability permissive=0
type=AVC msg=audit(1652102484.985:2312): avc:  denied  { setgid } for  pid=53056 comm="rpcd_lsad" capability=6  scontext=system_u:system_r:winbind_t:s0 tcontext=system_u:system_r:winbind_t:s0 tclass=capability permissive=0


Full logs:


http://idm-artifacts.usersys.redhat.com/samba/Nightly/RHEL8.7/2022-04-17/tier-1/tier1_ws2019/7/tier1-restraint.01/recipes/1/tasks/10/results/1652101918/logs/avc.log
http://idm-artifacts.usersys.redhat.com/samba/Nightly/RHEL8.7/2022-04-17/tier-1/tier1_ws2019/7/tier1-restraint.01/recipes/1/tasks/10/results/1652101914/logs/avc.log

--- Additional comment from Pavel Filipensky on 2022-05-10 09:27:54 UTC ---

The denied access: denied  { write } for  pid=53381 comm="samba-dcerpcd" name="samba-dcerpcd.pid" dev="tmpfs"
needs to be fixed via granting access for "/run"  (for pid files) - see smb.conf(5):

   pid directory (G)

       This option specifies the directory where pid files will be placed.

       Default: pid directory = /run

       Example: pid directory = /var/run/

Comment 1 Milos Malik 2022-05-10 13:54:08 UTC
Steps to Reproduce:

1) get a RHEL-9.1 machine (targeted policy is active)
2) install the latest samba* packages (4.16.1-100.el9)
3) start the winbind service
4) search for SELinux denials

Following SELinux denial appears multiple times in enforcing mode:
----
type=PROCTITLE msg=audit(05/10/2022 09:49:34.292:416) : proctitle=/usr/libexec/samba/rpcd_lsad --configfile=/etc/samba/smb.conf --worker-group=4 --worker-index=5 --debuglevel=0 
type=SYSCALL msg=audit(05/10/2022 09:49:34.292:416) : arch=x86_64 syscall=setgroups success=no exit=EPERM(Operation not permitted) a0=0x0 a1=0x0 a2=0x7f3e02e7042b a3=0x0 items=0 ppid=16774 pid=16784 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=rpcd_lsad exe=/usr/libexec/samba/rpcd_lsad subj=system_u:system_r:winbind_t:s0 key=(null) 
type=AVC msg=audit(05/10/2022 09:49:34.292:416) : avc:  denied  { setgid } for  pid=16784 comm=rpcd_lsad capability=setgid  scontext=system_u:system_r:winbind_t:s0 tcontext=system_u:system_r:winbind_t:s0 tclass=capability permissive=0 
----

# rpm -qa selinux\* \*samba\* | sort
python3-samba-4.16.1-100.el9.x86_64
samba-4.16.1-100.el9.x86_64
samba-client-libs-4.16.1-100.el9.x86_64
samba-common-4.16.1-100.el9.noarch
samba-common-libs-4.16.1-100.el9.x86_64
samba-common-tools-4.16.1-100.el9.x86_64
samba-libs-4.16.1-100.el9.x86_64
samba-winbind-4.16.1-100.el9.x86_64
samba-winbind-modules-4.16.1-100.el9.x86_64
selinux-policy-34.1.30-2.el9.noarch
selinux-policy-targeted-34.1.30-2.el9.noarch
#

Comment 2 Milos Malik 2022-05-10 13:57:02 UTC
Following SELinux denial appears in permissive mode:
----
type=PROCTITLE msg=audit(05/10/2022 09:54:47.582:459) : proctitle=/usr/libexec/samba/rpcd_lsad --configfile=/etc/samba/smb.conf --worker-group=5 --worker-index=5 --debuglevel=0 
type=SYSCALL msg=audit(05/10/2022 09:54:47.582:459) : arch=x86_64 syscall=setgroups success=yes exit=0 a0=0x0 a1=0x0 a2=0x7fbd9328942b a3=0x0 items=0 ppid=16893 pid=16903 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=rpcd_lsad exe=/usr/libexec/samba/rpcd_lsad subj=system_u:system_r:winbind_t:s0 key=(null) 
type=AVC msg=audit(05/10/2022 09:54:47.582:459) : avc:  denied  { setgid } for  pid=16903 comm=rpcd_lsad capability=setgid  scontext=system_u:system_r:winbind_t:s0 tcontext=system_u:system_r:winbind_t:s0 tclass=capability permissive=1 
----

Comment 4 Zdenek Pytela 2022-06-07 18:35:11 UTC
To backport:
commit 7367896085db099d956d666b94601fa9fc9df92a
Author: Zdenek Pytela <zpytela>
Date:   Wed Jun 1 12:55:02 2022 +0200

    Add support for samba-dcerpcd

Comment 5 Zdenek Pytela 2022-06-09 09:05:34 UTC
Additional one:
commit 044ed83f8ebde938bbc49f6e071a8548ddc8505d (HEAD -> rawhide, upstream/rawhide)
Author: Zdenek Pytela <zpytela>
Date:   Wed Jun 8 16:24:15 2022 +0200

    Update policy for samba-dcerpcd

Comment 16 errata-xmlrpc 2022-11-15 11:13:50 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 (selinux-policy 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-2022:8283


Note You need to log in before you can comment on or make changes to this bug.